Skip to content

Commit 61c3659

Browse files
committed
Update CSV Validation
This commit updates the CRD validation to only accept CSVs where the WebhookDefinition type is valid.
1 parent 2770864 commit 61c3659

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

crds/operators.coreos.com_clusterserviceversions.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8821,6 +8821,9 @@ spec:
88218821
description: WebhookAdmissionType is the type of admission webhooks
88228822
supported by OLM
88238823
type: string
8824+
enum:
8825+
- ValidatingAdmissionWebhook
8826+
- MutatingAdmissionWebhook
88248827
webhookPath:
88258828
type: string
88268829
status:

crds/zz_defs.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/operators/v1alpha1/clusterserviceversion_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ const (
164164
// WebhookDescription provides details to OLM about required webhooks
165165
// +k8s:openapi-gen=true
166166
type WebhookDescription struct {
167-
GenerateName string `json:"generateName"`
167+
GenerateName string `json:"generateName"`
168+
// +kubebuilder:validation:Enum=ValidatingAdmissionWebhook;MutatingAdmissionWebhook
168169
Type WebhookAdmissionType `json:"type"`
169170
DeploymentName string `json:"deploymentName,omitempty"`
170171
ContainerPort int32 `json:"containerPort,omitempty"`

0 commit comments

Comments
 (0)