@@ -164,7 +164,8 @@ const (
164
164
// WebhookDescription provides details to OLM about required webhooks
165
165
// +k8s:openapi-gen=true
166
166
type WebhookDescription struct {
167
- Name string `json:"name"`
167
+ GenerateName string `json:"generateName"`
168
+ // +kubebuilder:validation:Enum=ValidatingAdmissionWebhook;MutatingAdmissionWebhook
168
169
Type WebhookAdmissionType `json:"type"`
169
170
DeploymentName string `json:"deploymentName,omitempty"`
170
171
ContainerPort int32 `json:"containerPort,omitempty"`
@@ -182,7 +183,7 @@ type WebhookDescription struct {
182
183
// GetValidatingWebhook returns a ValidatingWebhook generated from the WebhookDescription
183
184
func (w * WebhookDescription ) GetValidatingWebhook (namespace string , namespaceSelector * metav1.LabelSelector , caBundle []byte ) admissionregistrationv1.ValidatingWebhook {
184
185
return admissionregistrationv1.ValidatingWebhook {
185
- Name : w .Name ,
186
+ Name : w .GenerateName ,
186
187
Rules : w .Rules ,
187
188
FailurePolicy : w .FailurePolicy ,
188
189
MatchPolicy : w .MatchPolicy ,
@@ -205,7 +206,7 @@ func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSel
205
206
// GetMutatingWebhook returns a MutatingWebhook generated from the WebhookDescription
206
207
func (w * WebhookDescription ) GetMutatingWebhook (namespace string , namespaceSelector * metav1.LabelSelector , caBundle []byte ) admissionregistrationv1.MutatingWebhook {
207
208
return admissionregistrationv1.MutatingWebhook {
208
- Name : w .Name ,
209
+ Name : w .GenerateName ,
209
210
Rules : w .Rules ,
210
211
FailurePolicy : w .FailurePolicy ,
211
212
MatchPolicy : w .MatchPolicy ,
@@ -365,7 +366,7 @@ const (
365
366
CSVReasonInterOperatorGroupOwnerConflict ConditionReason = "InterOperatorGroupOwnerConflict"
366
367
CSVReasonCannotModifyStaticOperatorGroupProvidedAPIs ConditionReason = "CannotModifyStaticOperatorGroupProvidedAPIs"
367
368
CSVReasonDetectedClusterChange ConditionReason = "DetectedClusterChange"
368
- CSVReasonUnsupportedWebhookRules ConditionReason = "UnsupportedWebhookRules "
369
+ CSVReasonInvalidWebhookDescription ConditionReason = "InvalidWebhookDescription "
369
370
)
370
371
371
372
// HasCaResources returns true if the CSV has owned APIServices or Webhooks.
0 commit comments