diff --git a/clab/dependency_manager/dependency_node.go b/clab/dependency_manager/dependency_node.go index 9e82ae0a7..8865db6e8 100644 --- a/clab/dependency_manager/dependency_node.go +++ b/clab/dependency_manager/dependency_node.go @@ -79,7 +79,7 @@ func (d *DependencyNode) getExecs(stage types.WaitForStage, execPhase types.Exec return nil, fmt.Errorf("stage %s unknown", stage) } - var result = []*types.Exec{} + result := []*types.Exec{} for _, x := range sb.Execs { // filter the list of commands for the given phase (on-enter / on-exit) if x.Phase == execPhase { @@ -136,7 +136,6 @@ func (d *DependencyNode) runExecs(ctx context.Context, execPhase types.ExecPhase execResultCollection.Add(hostname, execResult) } execResultCollection.Log() - } // Done is called by a node that has finished all tasks for the provided stage. diff --git a/cmd/inspect.go b/cmd/inspect.go index e31454916..49531c722 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -262,7 +262,8 @@ func printContainerInspect(containers []runtime.GenericContainer, format string) "Name", "Kind/Image", "State", - "IPv4/6 Address"} + "IPv4/6 Address", + } if wide { header = slices.Insert(header, 1, "Owner") diff --git a/cmd/tools_netem.go b/cmd/tools_netem.go index 914b2a2b5..a51cfcdad 100644 --- a/cmd/tools_netem.go +++ b/cmd/tools_netem.go @@ -49,7 +49,8 @@ func init() { netemSetCmd.Flags().Float64VarP(&netemLoss, "loss", "", 0, "random packet loss expressed in percentage (e.g. 0.1 means 0.1%)") netemSetCmd.Flags().Uint64VarP(&netemRate, "rate", "", 0, "link rate limit in kbit") - netemSetCmd.Flags().Float64VarP(&netemCorruption, "corruption", "", 0, "random packet corruption probability expressed in percentage (e.g. 0.1 means 0.1%)") + netemSetCmd.Flags().Float64VarP(&netemCorruption, "corruption", "", 0, + "random packet corruption probability expressed in percentage (e.g. 0.1 means 0.1%)") netemSetCmd.MarkFlagRequired("node") netemSetCmd.MarkFlagRequired("interface") @@ -231,7 +232,8 @@ func qdiscToTableData(qdisc gotc.Object) tableWriter.Row { loss = strconv.FormatFloat(float64(qdisc.Netem.Qopt.Loss)/float64(math.MaxUint32)*100, 'f', 2, 64) + "%" rate = strconv.Itoa(int(qdisc.Netem.Rate.Rate * 8 / 1000)) - corruption = strconv.FormatFloat(float64(qdisc.Netem.Corrupt.Probability)/float64(math.MaxUint32)*100, 'f', 2, 64) + "%" + corruption = strconv.FormatFloat(float64(qdisc.Netem.Corrupt.Probability)/ + float64(math.MaxUint32)*100, 'f', 2, 64) + "%" return tableWriter.Row{ ifDisplayName, diff --git a/internal/tc/tc.go b/internal/tc/tc.go index eff54c0ba..2d971b1f8 100644 --- a/internal/tc/tc.go +++ b/internal/tc/tc.go @@ -26,7 +26,9 @@ func NewTC(ns int) (*tc.Tc, error) { } // SetImpairments sets the impairments on the given interface of a node. -func SetImpairments(tcnl *tc.Tc, nodeName string, link *net.Interface, delay, jitter time.Duration, loss float64, rate uint64, probability float64) (*tc.Object, error) { +func SetImpairments(tcnl *tc.Tc, nodeName string, link *net.Interface, delay, jitter time.Duration, + loss float64, rate uint64, probability float64, +) (*tc.Object, error) { err := tcnl.SetOption(netlink.ExtendedAcknowledge, true) if err != nil { return nil, fmt.Errorf("could not set option ExtendedAcknowledge: %v", err) diff --git a/nodes/rare/rare.go b/nodes/rare/rare.go index d8b0478f2..593764e85 100644 --- a/nodes/rare/rare.go +++ b/nodes/rare/rare.go @@ -39,7 +39,7 @@ func (n *rare) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error { // make ipv6 disabled on all rare node interfaces unconditionally // as ipv6 will be handled by rare/freertr // The setting 'net.ipv6.conf.all.disable_ipv6' 1 - interferes with IPv6 out-of-band management. Commenting it out for now as a workaround. - // cfg.Sysctls["net.ipv6.conf.all.disable_ipv6"] = "1" + // cfg.Sysctls["net.ipv6.conf.all.disable_ipv6"] = "1" n.Cfg.Binds = append(n.Cfg.Binds, fmt.Sprint(filepath.Join(n.Cfg.LabDir, "run"), ":/rtr/run"), diff --git a/types/stages.go b/types/stages.go index 9efe44514..15069d027 100644 --- a/types/stages.go +++ b/types/stages.go @@ -20,7 +20,7 @@ const ( ) var ( - // the defauts we need as pointers, so assign them to vars, such that we can acquire the pointer + // the defauts we need as pointers, so assign them to vars, such that we can acquire the pointer. defaultCommandExecutionPhase = CommandExecutionPhaseEnter defaultCommandTarget = CommandTargetContainer ) @@ -180,9 +180,9 @@ const ( type ExecTarget string const ( - // CommandTargetContainer determines that the commands are meant to be executed within the container + // CommandTargetContainer determines that the commands are meant to be executed within the container. CommandTargetContainer ExecTarget = "container" - // CommandTargetHost determines that the commands are meant to be executed on the host system + // CommandTargetHost determines that the commands are meant to be executed on the host system. CommandTargetHost ExecTarget = "host" )