-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: terminate watch mode when all resources complete #15
Conversation
Verifying against |
cmd/cli/cleanup.go
Outdated
for { | ||
newReport, err := clusterService.DeleteResourcesForCluster(clusterId, map[string]string{}, dryRun) | ||
if watch { | ||
err := wait.PollImmediate(30*time.Second, 20*time.Minute, func() (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we test this against a full RHMI install? Is 20 minutes a safe enough timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point. I used 20 minutes because it was the number mentioned in the original JIRA. I'll attempt it against a full cluster.
err := wait.PollImmediate(30*time.Second, watchTimeout, func() (bool, error) { | ||
var currentReport *clusterservice.Report | ||
newReport := runCleanupCommand(clusterService, clusterId, dryRun) | ||
if currentReport == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will currentReport
not always be nil? Or is it being set somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it's set the next loop around.. Nevermind :)
aka "and now my watch has ended" ;)
Verification Steps
./cluster-service cleanup <cluster-id> --dry-run=false --watch
Verify that: