Skip to content

Commit

Permalink
Add a flag to disable the ipcache check
Browse files Browse the repository at this point in the history
Add `--skip-ip-cache-check` flag with the default set to true. This is
meant to be a temporary flag while we investigate what's causing the flake.

Ref: #361

Signed-off-by: Michi Mutsuzaki <[email protected]>
  • Loading branch information
michi-covalent committed Aug 31, 2021
1 parent db2cd94 commit af81105
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions connectivity/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Parameters struct {
Verbose bool
Debug bool
PauseOnFail bool
SkipIPCacheCheck bool
}

func (p Parameters) ciliumEndpointTimeout() time.Duration {
Expand Down
18 changes: 11 additions & 7 deletions connectivity/check/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,17 @@ func (ct *ConnectivityTest) validateDeployment(ctx context.Context) error {
}
}

// Set the timeout for all IP cache lookup retries
ipCacheCtx, cancel := context.WithTimeout(ctx, ct.params.ipCacheTimeout())
defer cancel()
for _, cp := range ct.ciliumPods {
err := ct.waitForIPCache(ipCacheCtx, cp)
if err != nil {
return err
if ct.params.SkipIPCacheCheck {
ct.Infof("Skipping IPCache check")
} else {
// Set the timeout for all IP cache lookup retries
ipCacheCtx, cancel := context.WithTimeout(ctx, ct.params.ipCacheTimeout())
defer cancel()
for _, cp := range ct.ciliumPods {
err := ct.waitForIPCache(ipCacheCtx, cp)
if err != nil {
return err
}
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/cli/cmd/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func newCmdConnectivityTest() *cobra.Command {
cmd.Flags().BoolVarP(&params.Verbose, "verbose", "v", false, "Show informational messages and don't buffer any lines")
cmd.Flags().BoolVarP(&params.Debug, "debug", "d", false, "Show debug messages")
cmd.Flags().BoolVarP(&params.PauseOnFail, "pause-on-fail", "p", false, "Pause execution on test failure")
cmd.Flags().BoolVar(&params.SkipIPCacheCheck, "skip-ip-cache-check", true, "Skip IPCache check")

return cmd
}

0 comments on commit af81105

Please sign in to comment.