Skip to content

Commit

Permalink
Set default value to TektonConfig object
Browse files Browse the repository at this point in the history
Currently when running the Tekton operator if the controller pod is up
and webhook pod is not ready the controller will create the TektonConfig
object and that TektonConfig object will not have any default values.

This PR add the default values to TektonConfig object whenever the CR
get's created by the Controller so that even if the webhook pod is not
ready the TektonConfig CR can still have the default values.
  • Loading branch information
vinamra28 committed Sep 21, 2021
1 parent a3d2802 commit 9a80ec5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/reconciler/shared/tektonconfig/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func (tc tektonConfig) createInstance() error {
},
},
}
tcCR.SetDefaults(context.TODO())
_, err := tc.operatorClientSet.OperatorV1alpha1().
TektonConfigs().Create(context.TODO(), tcCR, metav1.CreateOptions{})
return err
Expand Down
2 changes: 2 additions & 0 deletions pkg/reconciler/shared/tektonconfig/tektonconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, tc *v1alpha1.TektonConfi
return nil
}

tc.SetDefaults(ctx)

if err := r.extension.PreReconcile(ctx, tc); err != nil {
// If prereconcile updates the TektonConfig CR, it returns an error
// to reconcile
Expand Down

0 comments on commit 9a80ec5

Please sign in to comment.