Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add V1 version of Pipeline CRD #5349

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
v1beta1.SchemeGroupVersion.WithKind("TaskRun"): &v1beta1.TaskRun{},
v1beta1.SchemeGroupVersion.WithKind("PipelineRun"): &v1beta1.PipelineRun{},
// v1
v1.SchemeGroupVersion.WithKind("Task"): &v1.Task{},
v1.SchemeGroupVersion.WithKind("Task"): &v1.Task{},
v1.SchemeGroupVersion.WithKind("Pipeline"): &v1.Pipeline{},
}

func newDefaultingAdmissionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
Expand Down Expand Up @@ -150,6 +151,14 @@ func newConversionController(ctx context.Context, cmw configmap.Watcher) *contro
v1GroupVersion: &v1.Task{},
},
},
v1.Kind("Pipeline"): {
DefinitionName: pipeline.PipelineResource.String(),
HubVersion: v1beta1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1beta1GroupVersion: &v1beta1.Pipeline{},
v1GroupVersion: &v1.Pipeline{},
},
},
},

// A function that infuses the context passed to ConvertTo/ConvertFrom/SetDefaults with custom metadata
Expand Down
22 changes: 19 additions & 3 deletions config/300-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ spec:
- name: v1beta1
served: true
storage: true
# Opt into the status subresource so metadata.generation
# starts to increment
subresources:
status: {}
schema:
Expand All @@ -43,6 +41,24 @@ spec:
# See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
# See issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
- name: v1
served: false
storage: false
schema:
openAPIV3Schema:
type: object
# OpenAPIV3 schema allows Kubernetes to perform validation on the schema fields
# and use the schema in tooling such as `kubectl explain`.
# Using "x-kubernetes-preserve-unknown-fields: true"
# at the root of the schema (or within it) allows arbitrary fields.
# We currently perform our own validation separately.
# See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema
# for more info.
x-kubernetes-preserve-unknown-fields: true
# Opt into the status subresource so metadata.generation
# starts to increment
subresources:
status: {}
names:
kind: Pipeline
plural: pipelines
Expand All @@ -54,7 +70,7 @@ spec:
conversion:
strategy: Webhook
webhook:
conversionReviewVersions: ["v1beta1"]
conversionReviewVersions: ["v1beta1", "v1"]
clientConfig:
service:
name: tekton-pipelines-webhook
Expand Down