Skip to content

Commit

Permalink
fix uninitialized toleration
Browse files Browse the repository at this point in the history
Since we're building the job spec in code we might as well leverage the
core.TolerationOpEqual const (which fixes an incorrect/incompatible
toleration operator value specified as "=").
  • Loading branch information
dweomer committed Aug 16, 2020
1 parent 2b44dc0 commit ca65177
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/helm/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
rbac "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/api/errors"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -54,7 +53,7 @@ func Register(ctx context.Context, apply apply.Apply,
apply = apply.WithSetID(Name).
WithCacheTypes(helms, jobs, crbs, sas, cm).
WithStrictCaching().WithPatcher(batch.SchemeGroupVersion.WithKind("Job"), func(namespace, name string, pt types.PatchType, data []byte) (runtime.Object, error) {
err := jobs.Delete(namespace, name, &metav1.DeleteOptions{})
err := jobs.Delete(namespace, name, &meta.DeleteOptions{})
if err == nil {
return nil, fmt.Errorf("replace job")
}
Expand Down Expand Up @@ -238,7 +237,7 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap, *core.ConfigMap)
},
{
Key: "node.cloudprovider.kubernetes.io/uninitialized",
Operator: "=",
Operator: core.TolerationOpEqual,
Value: "true",
Effect: "NoSchedule",
},
Expand Down

0 comments on commit ca65177

Please sign in to comment.