From d029e478396fccf8ff8a0f5260042736a0269105 Mon Sep 17 00:00:00 2001 From: Lu Dang Date: Fri, 20 Nov 2020 22:25:52 -0500 Subject: [PATCH] use v1beta2 as the storage version of PingSource - flip storage version to v1beta2 in PingSource CRD - add post-install job to migrate existing PingSource objects to v1beta2 --- config/core/resources/pingsource.yaml | 4 ++-- config/post-install/clusterrole.yaml | 4 +--- config/post-install/storage-version-migrator.yaml | 11 +++++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config/core/resources/pingsource.yaml b/config/core/resources/pingsource.yaml index 406085be8a6..ebb7c9642c8 100644 --- a/config/core/resources/pingsource.yaml +++ b/config/core/resources/pingsource.yaml @@ -184,7 +184,7 @@ spec: - <<: *version name: v1beta1 served: true - storage: true + storage: false schema: openAPIV3Schema: type: object @@ -323,7 +323,7 @@ spec: - <<: *version name: v1beta2 served: true - storage: false + storage: true schema: openAPIV3Schema: type: object diff --git a/config/post-install/clusterrole.yaml b/config/post-install/clusterrole.yaml index a065622dcbb..6870bf3ffac 100644 --- a/config/post-install/clusterrole.yaml +++ b/config/post-install/clusterrole.yaml @@ -35,9 +35,7 @@ rules: - apiGroups: - "sources.knative.dev" resources: - - "sinkbindings" - - "apiserversources" - - "containersources" + - "pingsources" verbs: - "get" - "list" diff --git a/config/post-install/storage-version-migrator.yaml b/config/post-install/storage-version-migrator.yaml index 0485784e3be..8c7b1add64b 100644 --- a/config/post-install/storage-version-migrator.yaml +++ b/config/post-install/storage-version-migrator.yaml @@ -15,7 +15,12 @@ apiVersion: batch/v1 kind: Job metadata: - name: storage-version-migration + # Adding a prefix to avoid naming conflict with previous version's post-install jobs, + # we cannot use `generateName` here as it's not supported by `kubectl apply -f` + # + # If `ttlSecondsAfterFinished` feature gate becomes generally available in the future, + # we can rely on that and keep using the same Job name. + name: v0.21-storage-version-migration namespace: knative-eventing labels: app: "storage-version-migration" @@ -37,6 +42,4 @@ spec: - name: migrate image: ko://knative.dev/eventing/vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate args: - - "sinkbindings.sources.knative.dev" - - "apiserversources.sources.knative.dev" - - "containersources.sources.knative.dev" + - "pingsources.sources.knative.dev"