Skip to content

Commit

Permalink
fix(webhook): populate admissionReviewVersions as a required value
Browse files Browse the repository at this point in the history
Signed-off-by: prateekpandey14 <[email protected]>
  • Loading branch information
prateekpandey14 committed Apr 7, 2021
1 parent 892f231 commit d1ec659
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/webhook/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ func createValidatingWebhookConfig(
},
CABundle: signingCert,
},
TimeoutSeconds: &five,
FailurePolicy: failurePolicy(),
SideEffects: &SideEffectClassNone,
TimeoutSeconds: &five,
FailurePolicy: failurePolicy(),
AdmissionReviewVersions: []string{"v1"},
SideEffects: &SideEffectClassNone,
}

validator := &v1.ValidatingWebhookConfiguration{
Expand Down Expand Up @@ -666,7 +667,7 @@ func preUpgrade(openebsNamespace string) error {
for _, config := range webhookConfigList.Items {
if config.Labels[string(apis.OpenEBSVersionKey)] != version.Current() {
if config.Labels[string(apis.OpenEBSVersionKey)] == "" ||
util.IsCurrentLessThanNewVersion(config.Labels[string(apis.OpenEBSVersionKey)], "1.12.0") {
util.IsCurrentLessThanNewVersion(config.Labels[string(apis.OpenEBSVersionKey)], "2.8.0") {
err = validate.KubeClient().Delete(config.Name, &metav1.DeleteOptions{})
if err != nil {
return fmt.Errorf("failed to delete older webhook config %s: %s", config.Name, err.Error())
Expand Down

0 comments on commit d1ec659

Please sign in to comment.