Skip to content

Commit 5aa27f3

Browse files
committed
Update CRD definition to use apiextensions v1
Using `apiextensions.k8s.io/v1` for the Custom Resource Definition, which updates the webhook conversion. Signed-off-by: Vincent Demeester <[email protected]>
1 parent 5fc1bf8 commit 5aa27f3

File tree

8 files changed

+247
-186
lines changed

8 files changed

+247
-186
lines changed

config/300-clustertask.yaml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: apiextensions.k8s.io/v1beta1
15+
apiVersion: apiextensions.k8s.io/v1
1616
kind: CustomResourceDefinition
1717
metadata:
1818
name: clustertasks.tekton.dev
@@ -24,23 +24,28 @@ metadata:
2424
spec:
2525
group: tekton.dev
2626
preserveUnknownFields: false
27-
validation:
28-
openAPIV3Schema:
29-
type: object
30-
# One can use x-kubernetes-preserve-unknown-fields: true
31-
# at the root of the schema (and inside any properties, additionalProperties)
32-
# to get the traditional CRD behaviour that nothing is pruned, despite
33-
# setting spec.preserveUnknownProperties: false.
34-
#
35-
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
36-
# See issue: https://github.com/knative/serving/issues/912
37-
x-kubernetes-preserve-unknown-fields: true
3827
versions:
39-
- name: v1alpha1
28+
- &version
29+
name: v1alpha1
4030
served: true
4131
storage: false
42-
- name: v1beta1
43-
served: true
32+
schema:
33+
openAPIV3Schema:
34+
type: object
35+
# One can use x-kubernetes-preserve-unknown-fields: true
36+
# at the root of the schema (and inside any properties, additionalProperties)
37+
# to get the traditional CRD behaviour that nothing is pruned, despite
38+
# setting spec.preserveUnknownProperties: false.
39+
#
40+
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
41+
# See issue: https://github.com/knative/serving/issues/912
42+
x-kubernetes-preserve-unknown-fields: true
43+
# Opt into the status subresource so metadata.generation
44+
# starts to increment
45+
subresources:
46+
status: {}
47+
- << : *version
48+
name: v1beta1
4449
storage: true
4550
names:
4651
kind: ClusterTask
@@ -49,13 +54,11 @@ spec:
4954
- tekton
5055
- tekton-pipelines
5156
scope: Cluster
52-
# Opt into the status subresource so metadata.generation
53-
# starts to increment
54-
subresources:
55-
status: {}
5657
conversion:
5758
strategy: Webhook
58-
webhookClientConfig:
59-
service:
60-
name: tekton-pipelines-webhook
61-
namespace: tekton-pipelines
59+
webhook:
60+
conversionReviewVersions: ["v1beta1"]
61+
clientConfig:
62+
service:
63+
name: tekton-pipelines-webhook
64+
namespace: tekton-pipelines

config/300-condition.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: apiextensions.k8s.io/v1beta1
15+
apiVersion: apiextensions.k8s.io/v1
1616
kind: CustomResourceDefinition
1717
metadata:
1818
name: conditions.tekton.dev
@@ -23,15 +23,37 @@ metadata:
2323
version: "devel"
2424
spec:
2525
group: tekton.dev
26+
versions:
27+
- name: v1alpha1
28+
served: true
29+
storage: true
30+
schema:
31+
openAPIV3Schema:
32+
type: object
33+
# One can use x-kubernetes-preserve-unknown-fields: true
34+
# at the root of the schema (and inside any properties, additionalProperties)
35+
# to get the traditional CRD behaviour that nothing is pruned, despite
36+
# setting spec.preserveUnknownProperties: false.
37+
#
38+
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
39+
# See issue: https://github.com/knative/serving/issues/912
40+
x-kubernetes-preserve-unknown-fields: true
41+
# Opt into the status subresource so metadata.generation
42+
# starts to increment
43+
subresources:
44+
status: {}
2645
names:
2746
kind: Condition
2847
plural: conditions
2948
categories:
3049
- tekton
3150
- tekton-pipelines
3251
scope: Namespaced
33-
# Opt into the status subresource so metadata.generation
34-
# starts to increment
35-
subresources:
36-
status: {}
37-
version: v1alpha1
52+
conversion:
53+
strategy: Webhook
54+
webhook:
55+
conversionReviewVersions: ["v1alpha1"]
56+
clientConfig:
57+
service:
58+
name: tekton-pipelines-webhook
59+
namespace: tekton-pipelines

config/300-pipeline.yaml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: apiextensions.k8s.io/v1beta1
15+
apiVersion: apiextensions.k8s.io/v1
1616
kind: CustomResourceDefinition
1717
metadata:
1818
name: pipelines.tekton.dev
@@ -24,23 +24,28 @@ metadata:
2424
spec:
2525
group: tekton.dev
2626
preserveUnknownFields: false
27-
validation:
28-
openAPIV3Schema:
29-
type: object
30-
# One can use x-kubernetes-preserve-unknown-fields: true
31-
# at the root of the schema (and inside any properties, additionalProperties)
32-
# to get the traditional CRD behaviour that nothing is pruned, despite
33-
# setting spec.preserveUnknownProperties: false.
34-
#
35-
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
36-
# See issue: https://github.com/knative/serving/issues/912
37-
x-kubernetes-preserve-unknown-fields: true
3827
versions:
39-
- name: v1alpha1
28+
- &version
29+
name: v1alpha1
4030
served: true
4131
storage: false
42-
- name: v1beta1
43-
served: true
32+
# Opt into the status subresource so metadata.generation
33+
# starts to increment
34+
subresources:
35+
status: {}
36+
schema:
37+
openAPIV3Schema:
38+
type: object
39+
# One can use x-kubernetes-preserve-unknown-fields: true
40+
# at the root of the schema (and inside any properties, additionalProperties)
41+
# to get the traditional CRD behaviour that nothing is pruned, despite
42+
# setting spec.preserveUnknownProperties: false.
43+
#
44+
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
45+
# See issue: https://github.com/knative/serving/issues/912
46+
x-kubernetes-preserve-unknown-fields: true
47+
- << : *version
48+
name: v1beta1
4449
storage: true
4550
names:
4651
kind: Pipeline
@@ -49,13 +54,11 @@ spec:
4954
- tekton
5055
- tekton-pipelines
5156
scope: Namespaced
52-
# Opt into the status subresource so metadata.generation
53-
# starts to increment
54-
subresources:
55-
status: {}
5657
conversion:
5758
strategy: Webhook
58-
webhookClientConfig:
59-
service:
60-
name: tekton-pipelines-webhook
61-
namespace: tekton-pipelines
59+
webhook:
60+
conversionReviewVersions: ["v1beta1"]
61+
clientConfig:
62+
service:
63+
name: tekton-pipelines-webhook
64+
namespace: tekton-pipelines

config/300-pipelinerun.yaml

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: apiextensions.k8s.io/v1beta1
15+
apiVersion: apiextensions.k8s.io/v1
1616
kind: CustomResourceDefinition
1717
metadata:
1818
name: pipelineruns.tekton.dev
@@ -24,23 +24,41 @@ metadata:
2424
spec:
2525
group: tekton.dev
2626
preserveUnknownFields: false
27-
validation:
28-
openAPIV3Schema:
29-
type: object
30-
# One can use x-kubernetes-preserve-unknown-fields: true
31-
# at the root of the schema (and inside any properties, additionalProperties)
32-
# to get the traditional CRD behaviour that nothing is pruned, despite
33-
# setting spec.preserveUnknownProperties: false.
34-
#
35-
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
36-
# See issue: https://github.com/knative/serving/issues/912
37-
x-kubernetes-preserve-unknown-fields: true
3827
versions:
39-
- name: v1alpha1
28+
- &version
29+
name: v1alpha1
4030
served: true
4131
storage: false
42-
- name: v1beta1
43-
served: true
32+
schema:
33+
openAPIV3Schema:
34+
type: object
35+
# One can use x-kubernetes-preserve-unknown-fields: true
36+
# at the root of the schema (and inside any properties, additionalProperties)
37+
# to get the traditional CRD behaviour that nothing is pruned, despite
38+
# setting spec.preserveUnknownProperties: false.
39+
#
40+
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
41+
# See issue: https://github.com/knative/serving/issues/912
42+
x-kubernetes-preserve-unknown-fields: true
43+
additionalPrinterColumns:
44+
- name: Succeeded
45+
type: string
46+
jsonPath: ".status.conditions[?(@.type==\"Succeeded\")].status"
47+
- name: Reason
48+
type: string
49+
jsonPath: ".status.conditions[?(@.type==\"Succeeded\")].reason"
50+
- name: StartTime
51+
type: date
52+
jsonPath: .status.startTime
53+
- name: CompletionTime
54+
type: date
55+
jsonPath: .status.completionTime
56+
# Opt into the status subresource so metadata.generation
57+
# starts to increment
58+
subresources:
59+
status: {}
60+
- << : *version
61+
name: v1beta1
4462
storage: true
4563
names:
4664
kind: PipelineRun
@@ -52,26 +70,11 @@ spec:
5270
- pr
5371
- prs
5472
scope: Namespaced
55-
additionalPrinterColumns:
56-
- name: Succeeded
57-
type: string
58-
JSONPath: ".status.conditions[?(@.type==\"Succeeded\")].status"
59-
- name: Reason
60-
type: string
61-
JSONPath: ".status.conditions[?(@.type==\"Succeeded\")].reason"
62-
- name: StartTime
63-
type: date
64-
JSONPath: .status.startTime
65-
- name: CompletionTime
66-
type: date
67-
JSONPath: .status.completionTime
68-
# Opt into the status subresource so metadata.generation
69-
# starts to increment
70-
subresources:
71-
status: {}
7273
conversion:
7374
strategy: Webhook
74-
webhookClientConfig:
75-
service:
76-
name: tekton-pipelines-webhook
77-
namespace: tekton-pipelines
75+
webhook:
76+
conversionReviewVersions: ["v1beta1"]
77+
clientConfig:
78+
service:
79+
name: tekton-pipelines-webhook
80+
namespace: tekton-pipelines

config/300-resource.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: apiextensions.k8s.io/v1beta1
15+
apiVersion: apiextensions.k8s.io/v1
1616
kind: CustomResourceDefinition
1717
metadata:
1818
name: pipelineresources.tekton.dev
@@ -23,15 +23,37 @@ metadata:
2323
version: "devel"
2424
spec:
2525
group: tekton.dev
26+
versions:
27+
- name: v1alpha1
28+
served: true
29+
storage: true
30+
schema:
31+
openAPIV3Schema:
32+
type: object
33+
# One can use x-kubernetes-preserve-unknown-fields: true
34+
# at the root of the schema (and inside any properties, additionalProperties)
35+
# to get the traditional CRD behaviour that nothing is pruned, despite
36+
# setting spec.preserveUnknownProperties: false.
37+
#
38+
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
39+
# See issue: https://github.com/knative/serving/issues/912
40+
x-kubernetes-preserve-unknown-fields: true
41+
# Opt into the status subresource so metadata.generation
42+
# starts to increment
43+
subresources:
44+
status: {}
2645
names:
2746
kind: PipelineResource
2847
plural: pipelineresources
2948
categories:
3049
- tekton
3150
- tekton-pipelines
3251
scope: Namespaced
33-
# Opt into the status subresource so metadata.generation
34-
# starts to increment
35-
subresources:
36-
status: {}
37-
version: v1alpha1
52+
conversion:
53+
strategy: Webhook
54+
webhook:
55+
conversionReviewVersions: ["v1alpha1"]
56+
clientConfig:
57+
service:
58+
name: tekton-pipelines-webhook
59+
namespace: tekton-pipelines

0 commit comments

Comments
 (0)