-
Notifications
You must be signed in to change notification settings - Fork 200
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
TektonConfig Fails To Reconcile if Pruner Settings Are Missing #2450
Comments
Starting in Tekton Operator v0.58.0, TektonConfig objects must set a value for `keep` or `keepSince` if the pruner is enabled [1]. If Shipwright bootstraps the TektonConfig object and does not set a value for `.spec.pruner.keep` (or `.keepSince`), it risks failing to reconcile the TektonConfig instance or worse [2]. Fixing by setting the `keep` value to match the Tekton operator default. Fixes shipwright-io#231 [1] tektoncd/operator#410 [2] tektoncd/operator#2450
Starting in Tekton Operator v0.58.0, TektonConfig objects must set a value for `keep` or `keepSince` if the pruner is enabled [1]. If Shipwright bootstraps the TektonConfig object and does not set a value for `.spec.pruner.keep` (or `.keepSince`), it risks failing to reconcile the TektonConfig instance or worse [2]. Fixing by setting the `keep` value to match the Tekton operator default. Fixes shipwright-io#231 [1] tektoncd/operator#410 [2] tektoncd/operator#2450 Signed-off-by: Adam Kaplan <[email protected]>
@adambkaplan defaulting one of these values is already there https://github.com/tektoncd/operator/blob/v0.73.0/pkg/apis/operator/v1alpha1/tektonconfig_defaults.go#L79 |
I can't rule that out for certain. In any case we added a pruner default setting on the Shipwright operator side, and plan to release it soon: shipwright-io/operator#233 |
Expected Behavior
If a
TektonConfig
object is created without the.spec.pruner.keep
or.spec.pruner.keep-since
setting, the operator applies a default setting to one of these values.Actual Behavior
If the
.spec.pruner.keep
and.spec.pruner.keep-since
settings are missing, the operator fails to reconcile because any update request is blocked by the validating webhookSteps to Reproduce the Problem
Observed when deploying the Shipwright Operator with OLM, which uses API dependency resolution to deploy the Tekton Operator.
Additional Info
Kubernetes version:
Output of
kubectl version
:Version 1.30.z
{"level":"info","timestamp":"2024-11-25T18:36:53.401Z","logger":"tekton-operator-lifecycle.event-broadcaster","caller":"record/event.go:364","msg":"Event(v1.ObjectReference{Kind:"TektonConfig", Namespace:"", Name:"config", UID:"de70e9b6-ec63-4b25-b377-add833640a29", APIVersion:"operator.tekton.dev/v1alpha1", ResourceVersion:"17433", FieldPath:""}): type: 'Warning' reason: 'UpdateFailed' Failed to update status for "config": admission webhook "validation.webhook.operator.tekton.dev" denied the request: validation failed: expected exactly one, got neither: spec.pruner.keep, spec.pruner.keep-since\nmissing field(s): spec.pruner.resources","commit":"391a4f0","knative.dev/pod":"openshift-pipelines-operator-648cb677d9-vv4fc"}
The text was updated successfully, but these errors were encountered: