Skip to content

Commit 9e1a817

Browse files
committed
Update WebhookDescription struct
Rather than providing users with an API to set the "Name" of the webhook, instead provide users with a method to set the generateName of the webhook.
1 parent 5ad863a commit 9e1a817

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

crds/operators.coreos.com_clusterserviceversions.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8687,7 +8687,7 @@ spec:
86878687
type: object
86888688
required:
86898689
- admissionReviewVersions
8690-
- name
8690+
- generateName
86918691
- sideEffects
86928692
- type
86938693
properties:
@@ -8702,11 +8702,11 @@ spec:
87028702
type: string
87038703
failurePolicy:
87048704
type: string
8705+
generateName:
8706+
type: string
87058707
matchPolicy:
87068708
description: MatchPolicyType specifies the type of match policy
87078709
type: string
8708-
name:
8709-
type: string
87108710
objectSelector:
87118711
description: A label selector is a label query over a set of
87128712
resources. The result of matchLabels and matchExpressions

crds/zz_defs.go

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/operators/v1alpha1/clusterserviceversion_types.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const (
164164
// WebhookDescription provides details to OLM about required webhooks
165165
// +k8s:openapi-gen=true
166166
type WebhookDescription struct {
167-
Name string `json:"name"`
167+
GenerateName string `json:"generateName"`
168168
Type WebhookAdmissionType `json:"type"`
169169
DeploymentName string `json:"deploymentName,omitempty"`
170170
ContainerPort int32 `json:"containerPort,omitempty"`
@@ -180,9 +180,9 @@ type WebhookDescription struct {
180180
}
181181

182182
// GetValidatingWebhook returns a ValidatingWebhook generated from the WebhookDescription
183-
func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.ValidatingWebhook {
183+
func (w *WebhookDescription) GetValidatingWebhook(name, namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.ValidatingWebhook {
184184
return admissionregistrationv1.ValidatingWebhook{
185-
Name: w.Name,
185+
Name: name,
186186
Rules: w.Rules,
187187
FailurePolicy: w.FailurePolicy,
188188
MatchPolicy: w.MatchPolicy,
@@ -203,9 +203,9 @@ func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSel
203203
}
204204

205205
// GetMutatingWebhook returns a MutatingWebhook generated from the WebhookDescription
206-
func (w *WebhookDescription) GetMutatingWebhook(namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.MutatingWebhook {
206+
func (w *WebhookDescription) GetMutatingWebhook(name, namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.MutatingWebhook {
207207
return admissionregistrationv1.MutatingWebhook{
208-
Name: w.Name,
208+
Name: name,
209209
Rules: w.Rules,
210210
FailurePolicy: w.FailurePolicy,
211211
MatchPolicy: w.MatchPolicy,

0 commit comments

Comments
 (0)