Skip to content

Commit

Permalink
Disable pipelines-scc validation for SCC.Default
Browse files Browse the repository at this point in the history
This commit disables checking for presence of `pipelines-scc` on the
cluster for TektonConfig.Spec....SCC.Default field as `pipelines-scc` is
created at a later point in time when the RBAC reconciler is run. Note
that this validation will still happen when the SCC priorities are
compared when `maxAllowed` or namespace SCC are added.
  • Loading branch information
concaf authored and tekton-robot committed Sep 26, 2023
1 parent 2a0eb28 commit 9d8d78e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/apis/operator/v1alpha1/tektonconfig_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ func (tc *TektonConfig) Validate(ctx context.Context) (errs *apis.FieldError) {
}

// verify default SCC exists on the cluster
if err := verifySCCExists(ctx, tc.Spec.Platforms.OpenShift.SCC.Default); err != nil {
errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("error verifying SCC exists: %s - %v", tc.Spec.Platforms.OpenShift.SCC.Default, err), "spec.platforms.openshift.scc.default"))

// we don't want to verify pipelines-scc here as it will be created
// later when the RBAC reconciler will be run
if defaultSCC != PipelinesSCC {
if err := verifySCCExists(ctx, tc.Spec.Platforms.OpenShift.SCC.Default); err != nil {
errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("error verifying SCC exists: %s - %v", tc.Spec.Platforms.OpenShift.SCC.Default, err), "spec.platforms.openshift.scc.default"))
}
}

maxAllowedSCC := tc.Spec.Platforms.OpenShift.SCC.MaxAllowed
Expand Down

0 comments on commit 9d8d78e

Please sign in to comment.