Skip to content

Commit

Permalink
allow updating the control plane endpoint if previously set
Browse files Browse the repository at this point in the history
  • Loading branch information
varshavaradarajan committed May 3, 2022
1 parent 58a1f3d commit 9b5516d
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions api/v1beta1/docluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ package v1beta1

import (
"fmt"
"reflect"

apierrors "k8s.io/apimachinery/pkg/api/errors"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"

clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
Expand Down Expand Up @@ -68,10 +65,6 @@ func (r *DOCluster) ValidateUpdate(old runtime.Object) error {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "region"), r.Spec.Region, "field is immutable"))
}

if !reflect.DeepEqual(clusterv1.APIEndpoint{}, oldDOCluster.Spec.ControlPlaneEndpoint) && !reflect.DeepEqual(r.Spec.ControlPlaneEndpoint, oldDOCluster.Spec.ControlPlaneEndpoint) {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneEndpoint"), r.Spec.ControlPlaneEndpoint, "field is immutable"))
}

if len(allErrs) == 0 {
return nil
}
Expand Down

0 comments on commit 9b5516d

Please sign in to comment.