Skip to content
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

bug 1794817: lib/resourcebuilder/batch.go: skip waiting for job to complete when in Init mode #317

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/resourcebuilder/batch.go
Expand Up @@ -20,6 +20,7 @@ type jobBuilder struct {
client *batchclientv1.BatchV1Client
raw []byte
modifier MetaV1ObjectModifierFunc
mode Mode
}

func newJobBuilder(config *rest.Config, m lib.Manifest) Interface {
Expand All @@ -30,6 +31,7 @@ func newJobBuilder(config *rest.Config, m lib.Manifest) Interface {
}

func (b *jobBuilder) WithMode(m Mode) Interface {
b.mode = m
return b
}

Expand All @@ -47,7 +49,7 @@ func (b *jobBuilder) Do(ctx context.Context) error {
if err != nil {
return err
}
if updated {
if updated && b.mode != InitializingMode {
return WaitForJobCompletion(ctx, b.client, job)
}
return nil
Expand Down