Skip to content

Commit

Permalink
use v1beta2 as the storage version of PingSource
Browse files Browse the repository at this point in the history
- flip storage version to v1beta2 in PingSource CRD
- add post-install job to migrate existing PingSource objects to v1beta2
  • Loading branch information
eclipselu committed Jan 19, 2021
1 parent 0f2f567 commit d029e47
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions config/core/resources/pingsource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ spec:
- <<: *version
name: v1beta1
served: true
storage: true
storage: false
schema:
openAPIV3Schema:
type: object
Expand Down Expand Up @@ -323,7 +323,7 @@ spec:
- <<: *version
name: v1beta2
served: true
storage: false
storage: true
schema:
openAPIV3Schema:
type: object
Expand Down
4 changes: 1 addition & 3 deletions config/post-install/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ rules:
- apiGroups:
- "sources.knative.dev"
resources:
- "sinkbindings"
- "apiserversources"
- "containersources"
- "pingsources"
verbs:
- "get"
- "list"
Expand Down
11 changes: 7 additions & 4 deletions config/post-install/storage-version-migrator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

0 comments on commit d029e47

Please sign in to comment.