diff --git a/config/openshift/base/role.yaml b/config/openshift/base/role.yaml index dcd889f796..a853358dd4 100644 --- a/config/openshift/base/role.yaml +++ b/config/openshift/base/role.yaml @@ -218,6 +218,7 @@ rules: - tekton.dev - triggers.tekton.dev - operator.tekton.dev + - pipelinesascode.tekton.dev resources: - '*' verbs: diff --git a/pkg/reconciler/shared/tektonconfig/upgrade/post_upgrade.go b/pkg/reconciler/shared/tektonconfig/upgrade/post_upgrade.go index 93ce3d629e..287b748302 100644 --- a/pkg/reconciler/shared/tektonconfig/upgrade/post_upgrade.go +++ b/pkg/reconciler/shared/tektonconfig/upgrade/post_upgrade.go @@ -19,6 +19,7 @@ package upgrade import ( "context" + "github.com/tektoncd/operator/pkg/apis/operator/v1alpha1" "github.com/tektoncd/operator/pkg/client/clientset/versioned" upgrade "github.com/tektoncd/operator/pkg/reconciler/shared/tektonconfig/upgrade/helper" "go.uber.org/zap" @@ -43,7 +44,6 @@ func upgradeStorageVersion(ctx context.Context, logger *zap.SugaredLogger, k8sCl "interceptors.triggers.tekton.dev", "pipelineruns.tekton.dev", "pipelines.tekton.dev", - "repositories.pipelinesascode.tekton.dev", "resolutionrequests.resolution.tekton.dev", "taskruns.tekton.dev", "tasks.tekton.dev", @@ -53,6 +53,10 @@ func upgradeStorageVersion(ctx context.Context, logger *zap.SugaredLogger, k8sCl "verificationpolicies.tekton.dev", } + if v1alpha1.IsOpenShiftPlatform() { + crdGroups = append(crdGroups, "repositories.pipelinesascode.tekton.dev") + } + migrator := storageversion.NewMigrator( dynamic.NewForConfigOrDie(restConfig), apixclient.NewForConfigOrDie(restConfig),