Skip to content

Commit

Permalink
Add v1alpha1/[es|kb|apm] versions in v1 crds (#4679) (#4681)
Browse files Browse the repository at this point in the history
  • Loading branch information
barkbay authored Jul 26, 2021
1 parent c1c184f commit 6a838bf
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 4 deletions.
27 changes: 27 additions & 0 deletions config/crds/v1/all-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,15 @@ spec:
storage: false
subresources:
status: {}
- name: v1alpha1
schema:
openAPIV3Schema:
description: to not break compatibility when upgrading from previous versions
of the CRD
properties: {}
type: object
served: false
storage: false
status:
acceptedNames:
kind: ""
Expand Down Expand Up @@ -5519,6 +5528,15 @@ spec:
storage: false
subresources:
status: {}
- name: v1alpha1
schema:
openAPIV3Schema:
description: to not break compatibility when upgrading from previous versions
of the CRD
properties: {}
type: object
served: false
storage: false
status:
acceptedNames:
kind: ""
Expand Down Expand Up @@ -7975,6 +7993,15 @@ spec:
storage: false
subresources:
status: {}
- name: v1alpha1
schema:
openAPIV3Schema:
description: to not break compatibility when upgrading from previous versions
of the CRD
properties: {}
type: object
served: false
storage: false
status:
acceptedNames:
kind: ""
Expand Down
13 changes: 13 additions & 0 deletions config/crds/v1/patches/add-empty-v1alpha1-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Add v1alpha1 to the list of versions, to not break compatibility when upgrading from previous versions of the CRD
# that list the v1alpha1 version in their status.storedVersions. We mark it as `served: false` so it cannot be used.
- op: add
path: /spec/versions/-
value:
name: v1alpha1
served: false
storage: false
schema:
openAPIV3Schema:
properties: {}
type: object
description: "to not break compatibility when upgrading from previous versions of the CRD"
19 changes: 19 additions & 0 deletions config/crds/v1/patches/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ bases:
- ../bases

patchesJson6902:
# patch that apply to CRDS which might have been installed in v1alpha1 version
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
name: apmservers.apm.k8s.elastic.co
path: add-empty-v1alpha1-patch.yaml
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
name: elasticsearches.elasticsearch.k8s.elastic.co
path: add-empty-v1alpha1-patch.yaml
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
name: kibanas.kibana.k8s.elastic.co
path: add-empty-v1alpha1-patch.yaml
# custom patches for APM
- target:
group: apiextensions.k8s.io
Expand Down
8 changes: 4 additions & 4 deletions config/crds/v1beta1/patches/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ bases:
- ../bases

patchesJson6902:
# patches that apply to all CRDS
# patch that apply to CRDS which might have been installed in v1alpha1 version
- target:
group: apiextensions.k8s.io
version: v1beta1
kind: CustomResourceDefinition
name: apmservers.apm.k8s.elastic.co
path: all-patches.yaml
path: add-empty-v1alpha1-patch.yaml
- target:
group: apiextensions.k8s.io
version: v1beta1
kind: CustomResourceDefinition
name: elasticsearches.elasticsearch.k8s.elastic.co
path: all-patches.yaml
path: add-empty-v1alpha1-patch.yaml
- target:
group: apiextensions.k8s.io
version: v1beta1
kind: CustomResourceDefinition
name: kibanas.kibana.k8s.elastic.co
path: all-patches.yaml
path: add-empty-v1alpha1-patch.yaml
# custom patches for apm
- target:
group: apiextensions.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,15 @@ spec:
storage: false
subresources:
status: {}
- name: v1alpha1
schema:
openAPIV3Schema:
description: to not break compatibility when upgrading from previous versions
of the CRD
properties: {}
type: object
served: false
storage: false
status:
acceptedNames:
kind: ""
Expand Down Expand Up @@ -5552,6 +5561,15 @@ spec:
storage: false
subresources:
status: {}
- name: v1alpha1
schema:
openAPIV3Schema:
description: to not break compatibility when upgrading from previous versions
of the CRD
properties: {}
type: object
served: false
storage: false
status:
acceptedNames:
kind: ""
Expand Down Expand Up @@ -8020,6 +8038,15 @@ spec:
storage: false
subresources:
status: {}
- name: v1alpha1
schema:
openAPIV3Schema:
description: to not break compatibility when upgrading from previous versions
of the CRD
properties: {}
type: object
served: false
storage: false
status:
acceptedNames:
kind: ""
Expand Down

0 comments on commit 6a838bf

Please sign in to comment.