Skip to content

Commit

Permalink
Remove requiredCompletions from k8s driver
Browse files Browse the repository at this point in the history
The only value that ever makes sense for requiredCompletions is 1
because we aren't running parallel pods for the bundle job.

Signed-off-by: Carolyn Van Slyck <[email protected]>
  • Loading branch information
carolynvs committed Feb 1, 2021
1 parent 7b4035e commit b6af7cb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions driver/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ type Driver struct {
secrets coreclientv1.SecretInterface
pods coreclientv1.PodInterface
deletionPolicy metav1.DeletionPropagation
requiredCompletions int32
}

// New initializes a Kubernetes driver.
Expand Down Expand Up @@ -154,7 +153,6 @@ func (k *Driver) setDefaults() {
k.SkipCleanup = false
k.BackoffLimit = 0
k.ActiveDeadlineSeconds = 300
k.requiredCompletions = 1
k.deletionPolicy = metav1.DeletePropagationBackground
}

Expand Down Expand Up @@ -210,7 +208,7 @@ func (k *Driver) Run(op *driver.Operation) (driver.OperationResult, error) {
ObjectMeta: meta,
Spec: batchv1.JobSpec{
ActiveDeadlineSeconds: &k.ActiveDeadlineSeconds,
Completions: &k.requiredCompletions,
Completions: defaultInt32Ptr(1),
BackoffLimit: &k.BackoffLimit,
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -438,9 +436,7 @@ func (k *Driver) watchJobStatusAndLogs(podSelector metav1.ListOptions, jobSelect
}

// Wait for pod logs to finish printing
for i := 0; i < int(k.requiredCompletions); i++ {
<-logsStreamingComplete
}
<-logsStreamingComplete

return err
}
Expand Down

0 comments on commit b6af7cb

Please sign in to comment.