Skip to content

Commit

Permalink
Address intrange linter violations
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and skitt committed Nov 18, 2024
1 parent 7ef12d9 commit 66be51b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/cable/libreswan/libreswan.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func extractSubnets(endpoint *subv1.EndpointSpec) []string {
func whack(args ...string) error {
var err error

for i := 0; i < 3; i++ {
for range 3 {
err = func() error {
ctx, cancel := context.WithTimeout(context.TODO(), whackTimeout)
defer cancel()
Expand Down Expand Up @@ -653,7 +653,7 @@ func (i *libreswan) waitForControlSocket() error {
const retryInterval = 100 * time.Millisecond
const controlSocketPath = "/run/pluto/pluto.ctl"

for i := 0; i < maxAttempts; i++ {
for range maxAttempts {
_, err := os.Stat(controlSocketPath)
if err == nil {
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/cableengine/syncer/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func testGatewaySyncing() {
It("should periodically update the Gateway resource timestamp", func() {
var lastTimestamp int64

for i := 0; i < 3; i++ {
for range 3 {
var currentTimestamp int64

Eventually(func() int64 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/globalnet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func main() {

var localCluster *submarinerv1.Cluster
// During installation, sometimes creation of clusterCRD by submariner-gateway-pod would take few secs.
for i := 0; i < 100; i++ {
for range 100 {
localCluster, err = submarinerClient.SubmarinerV1().Clusters(spec.Namespace).Get(context.TODO(), spec.ClusterID,
metav1.GetOptions{})
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/netlink/netlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (n *netlinkType) EnableLooseModeReversePathFilter(interfaceName string) err
}

func (n *netlinkType) EnsureLooseModeIsConfigured(interfaceName string) error {
for i := 0; i < 10; i++ {
for range 10 {
// Revisit: This is a temporary work-around to fix https://github.com/submariner-io/submariner/issues/2422
// Allow the interface to get initialized.
time.Sleep(100 * time.Millisecond)
Expand Down
2 changes: 1 addition & 1 deletion pkg/packetfilter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (a *Adapter) ensureRuleAtPosition(table TableType, chain string, existingRu

// The required rule is present in the chain, but either there are multiple occurrences or it's not at the desired position.
if numOccurrences > 1 || !isPresentAtRequiredPosition {
for i := 0; i < numOccurrences; i++ {
for range numOccurrences {
logger.V(level.TRACE).Infof("Deleting misplaced occurrence of rule %q from table %q, chain %q", rule, table, chain)

if err := a.Delete(table, chain, rule); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pinger/pinger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var _ = Describe("Pinger", func() {
verifyPingStats := func(count int) {
last := &pinger.LatencyInfo{}

for i := 0; i < count; i++ {
for range count {
var current *pinger.LatencyInfo

Eventually(func() *pinger.LatencyInfo {
Expand Down

0 comments on commit 66be51b

Please sign in to comment.