Skip to content

Commit

Permalink
Resolves an error when deploying the webhook where the k8s api indica…
Browse files Browse the repository at this point in the history
…ted that the webhook config was invalid because of missing SideEffects, and AdmissionReviewVersions (kubeflow#1413)
  • Loading branch information
ssullivan authored Dec 2, 2021
1 parent 97bca03 commit ba316fa
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,20 @@ func (wh *WebHook) selfRegistration(webhookConfigName string) error {
},
}

sideEffect := arv1.SideEffectClassNoneOnDryRun

mutatingWebhook := arv1.MutatingWebhook{
Name: webhookName,
Rules: mutatingRules,
ClientConfig: arv1.WebhookClientConfig{
Service: wh.serviceRef,
CABundle: caCert,
},
FailurePolicy: &wh.failurePolicy,
NamespaceSelector: wh.selector,
TimeoutSeconds: wh.timeoutSeconds,
FailurePolicy: &wh.failurePolicy,
NamespaceSelector: wh.selector,
TimeoutSeconds: wh.timeoutSeconds,
SideEffects: &sideEffect,
AdmissionReviewVersions: []string{"v1"},
}

validatingWebhook := arv1.ValidatingWebhook{
Expand All @@ -398,9 +402,11 @@ func (wh *WebHook) selfRegistration(webhookConfigName string) error {
Service: wh.serviceRef,
CABundle: caCert,
},
FailurePolicy: &wh.failurePolicy,
NamespaceSelector: wh.selector,
TimeoutSeconds: wh.timeoutSeconds,
FailurePolicy: &wh.failurePolicy,
NamespaceSelector: wh.selector,
TimeoutSeconds: wh.timeoutSeconds,
SideEffects: &sideEffect,
AdmissionReviewVersions: []string{"v1"},
}

mutatingWebhooks := []arv1.MutatingWebhook{mutatingWebhook}
Expand Down

0 comments on commit ba316fa

Please sign in to comment.