Skip to content

Bump CAPI to v1.10.2 #5517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
./hack/create-custom-cloud-provider-config.sh

# Deploy CAPI
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.6/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.2/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"

# Deploy CAAPH
timeout --foreground 300 bash -c "until curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/download/v0.2.5/addon-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -; do sleep 5; done"
Expand Down
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ settings = {
"deploy_cert_manager": True,
"preload_images_for_kind": True,
"kind_cluster_name": "capz",
"capi_version": "v1.9.6",
"capi_version": "v1.10.2",
"caaph_version": "v0.2.5",
"cert_manager_version": "v1.17.2",
"kubernetes_version": "v1.30.2",
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/azureasomanagedcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

// SetupAzureASOManagedClusterWebhookWithManager sets up and registers the webhook with the manager.
func SetupAzureASOManagedClusterWebhookWithManager(mgr ctrl.Manager) error {
azureASOManagedClusterWebhook := &azureASOManagedClusterWebhook{}
w := &azureASOManagedClusterWebhook{}

Check warning on line 34 in api/v1alpha1/azureasomanagedcluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcluster_webhook.go#L34

Added line #L34 was not covered by tests
return ctrl.NewWebhookManagedBy(mgr).
For(&AzureASOManagedCluster{}).
WithValidator(azureASOManagedClusterWebhook).
WithValidator(w).

Check warning on line 37 in api/v1alpha1/azureasomanagedcluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcluster_webhook.go#L37

Added line #L37 was not covered by tests
Complete()
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/azureasomanagedcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

// SetupAzureASOManagedControlPlaneWebhookWithManager sets up and registers the webhook with the manager.
func SetupAzureASOManagedControlPlaneWebhookWithManager(mgr ctrl.Manager) error {
azureASOManagedControlPlaneWebhook := &azureASOManagedControlPlaneWebhook{}
w := &azureASOManagedControlPlaneWebhook{}

Check warning on line 34 in api/v1alpha1/azureasomanagedcontrolplane_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcontrolplane_webhook.go#L34

Added line #L34 was not covered by tests
return ctrl.NewWebhookManagedBy(mgr).
For(&AzureASOManagedControlPlane{}).
WithValidator(azureASOManagedControlPlaneWebhook).
WithValidator(w).

Check warning on line 37 in api/v1alpha1/azureasomanagedcontrolplane_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcontrolplane_webhook.go#L37

Added line #L37 was not covered by tests
Complete()
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/azureasomanagedmachinepool_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

// SetupAzureASOManagedMachinePoolWebhookWithManager sets up and registers the webhook with the manager.
func SetupAzureASOManagedMachinePoolWebhookWithManager(mgr ctrl.Manager) error {
azureASOManagedMachinePoolWebhook := &azureASOManagedMachinePoolWebhook{}
w := &azureASOManagedMachinePoolWebhook{}

Check warning on line 34 in api/v1alpha1/azureasomanagedmachinepool_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedmachinepool_webhook.go#L34

Added line #L34 was not covered by tests
return ctrl.NewWebhookManagedBy(mgr).
For(&AzureASOManagedMachinePool{}).
WithValidator(azureASOManagedMachinePoolWebhook).
WithValidator(w).

Check warning on line 37 in api/v1alpha1/azureasomanagedmachinepool_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedmachinepool_webhook.go#L37

Added line #L37 was not covered by tests
Complete()
}

Expand Down
44 changes: 34 additions & 10 deletions api/v1beta1/azurecluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package v1beta1

import (
"context"
"fmt"
"reflect"

apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -31,29 +33,51 @@

// SetupWebhookWithManager sets up and registers the webhook with the manager.
func (c *AzureCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
w := new(AzureClusterWebhook)

Check warning on line 36 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L36

Added line #L36 was not covered by tests
return ctrl.NewWebhookManagedBy(mgr).
For(c).
WithValidator(w).
WithDefaulter(w).

Check warning on line 40 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L39-L40

Added lines #L39 - L40 were not covered by tests
Complete()
}

// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=validation.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=default.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

var _ webhook.Validator = &AzureCluster{}
var _ webhook.Defaulter = &AzureCluster{}
// AzureClusterWebhook implements validating and mutating webhook for AzureCluster.
type AzureClusterWebhook struct{}

var _ webhook.CustomValidator = &AzureClusterWebhook{}
var _ webhook.CustomDefaulter = &AzureClusterWebhook{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type.
func (*AzureClusterWebhook) Default(_ context.Context, obj runtime.Object) error {
c, ok := obj.(*AzureCluster)
if !ok {
return fmt.Errorf("expected an AzureCluster object but got %T", c)
}

Check warning on line 58 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L54-L58

Added lines #L54 - L58 were not covered by tests

// Default implements webhook.Defaulter so a webhook will be registered for the type.
func (c *AzureCluster) Default() {
c.setDefaults()
return nil

Check warning on line 61 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L61

Added line #L61 was not covered by tests
}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureCluster) ValidateCreate() (admission.Warnings, error) {
// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*AzureClusterWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
c, ok := obj.(*AzureCluster)
if !ok {
return nil, fmt.Errorf("expected an AzureCluster object but got %T", c)
}

Check warning on line 69 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L68-L69

Added lines #L68 - L69 were not covered by tests

return c.validateCluster(nil)
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*AzureClusterWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) {
c, ok := newObj.(*AzureCluster)
if !ok {
return nil, fmt.Errorf("expected an AzureCluster object but got %T", c)
}

Check warning on line 79 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L78-L79

Added lines #L78 - L79 were not covered by tests

var allErrs field.ErrorList
old := oldRaw.(*AzureCluster)

Expand Down Expand Up @@ -195,7 +219,7 @@
return allErrs
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureCluster) ValidateDelete() (admission.Warnings, error) {
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
func (*AzureClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

Check warning on line 223 in api/v1beta1/azurecluster_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azurecluster_webhook.go#L223

Added line #L223 was not covered by tests
return nil, nil
}
5 changes: 3 additions & 2 deletions api/v1beta1/azurecluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -108,7 +109,7 @@ func TestAzureCluster_ValidateCreate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := tc.cluster.ValidateCreate()
_, err := (&AzureClusterWebhook{}).ValidateCreate(context.Background(), tc.cluster)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -344,7 +345,7 @@ func TestAzureCluster_ValidateUpdate(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
_, err := tc.cluster.ValidateUpdate(tc.oldCluster)
_, err := (&AzureClusterWebhook{}).ValidateUpdate(context.Background(), tc.oldCluster, tc.cluster)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
31 changes: 24 additions & 7 deletions api/v1beta1/azureclusteridentity_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
package v1beta1

import (
"context"
"fmt"

apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"
Expand All @@ -29,22 +32,36 @@

// SetupWebhookWithManager sets up and registers the webhook with the manager.
func (c *AzureClusterIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error {
w := new(azureClusterIdentityWebhook)

Check warning on line 35 in api/v1beta1/azureclusteridentity_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclusteridentity_webhook.go#L35

Added line #L35 was not covered by tests
return ctrl.NewWebhookManagedBy(mgr).
For(c).
WithValidator(w).

Check warning on line 38 in api/v1beta1/azureclusteridentity_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclusteridentity_webhook.go#L38

Added line #L38 was not covered by tests
Complete()
}

// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclusteridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusteridentities,versions=v1beta1,name=validation.azureclusteridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

var _ webhook.Validator = &AzureClusterIdentity{}
type azureClusterIdentityWebhook struct{}

var _ webhook.CustomValidator = &azureClusterIdentityWebhook{}

// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*azureClusterIdentityWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
c, ok := obj.(*AzureClusterIdentity)
if !ok {
return nil, fmt.Errorf("expected an AzureClusterIdentity object but got %T", c)
}

Check warning on line 53 in api/v1beta1/azureclusteridentity_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclusteridentity_webhook.go#L52-L53

Added lines #L52 - L53 were not covered by tests

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureClusterIdentity) ValidateCreate() (admission.Warnings, error) {
return c.validateClusterIdentity()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureClusterIdentity) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*azureClusterIdentityWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) {
c, ok := newObj.(*AzureClusterIdentity)
if !ok {
return nil, fmt.Errorf("expected an AzureClusterIdentity object but got %T", c)
}

Check warning on line 63 in api/v1beta1/azureclusteridentity_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclusteridentity_webhook.go#L62-L63

Added lines #L62 - L63 were not covered by tests

var allErrs field.ErrorList
old := oldRaw.(*AzureClusterIdentity)
if err := webhookutils.ValidateImmutable(
Expand All @@ -59,7 +76,7 @@
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterIdentityKind).GroupKind(), c.Name, allErrs)
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureClusterIdentity) ValidateDelete() (admission.Warnings, error) {
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
func (*azureClusterIdentityWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

Check warning on line 80 in api/v1beta1/azureclusteridentity_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclusteridentity_webhook.go#L80

Added line #L80 was not covered by tests
return nil, nil
}
5 changes: 3 additions & 2 deletions api/v1beta1/azureclusteridentity_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -83,7 +84,7 @@ func TestAzureClusterIdentity_ValidateCreate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := tc.clusterIdentity.ValidateCreate()
_, err := (&azureClusterIdentityWebhook{}).ValidateCreate(context.Background(), tc.clusterIdentity)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down Expand Up @@ -163,7 +164,7 @@ func TestAzureClusterIdentity_ValidateUpdate(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
g := NewWithT(t)
_, err := tc.clusterIdentity.ValidateUpdate(tc.oldClusterIdentity)
_, err := (&azureClusterIdentityWebhook{}).ValidateUpdate(context.Background(), tc.oldClusterIdentity, tc.clusterIdentity)
if tc.wantErr {
g.Expect(err).To(HaveOccurred())
} else {
Expand Down
43 changes: 33 additions & 10 deletions api/v1beta1/azureclustertemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package v1beta1

import (
"context"
"fmt"
"reflect"

apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -32,30 +34,51 @@

// SetupWebhookWithManager will set up the webhook to be managed by the specified manager.
func (c *AzureClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
w := new(azureClusterTemplateWebhook)

Check warning on line 37 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L37

Added line #L37 was not covered by tests
return ctrl.NewWebhookManagedBy(mgr).
For(c).
WithValidator(w).
WithDefaulter(w).

Check warning on line 41 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L40-L41

Added lines #L40 - L41 were not covered by tests
Complete()
}

// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=validation.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=default.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

var _ webhook.Defaulter = &AzureClusterTemplate{}
type azureClusterTemplateWebhook struct{}

var _ webhook.CustomDefaulter = &azureClusterTemplateWebhook{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type.
func (*azureClusterTemplateWebhook) Default(_ context.Context, obj runtime.Object) error {
c, ok := obj.(*AzureClusterTemplate)
if !ok {
return fmt.Errorf("expected an AzureClusterTemplate object but got %T", c)
}

Check warning on line 57 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L53-L57

Added lines #L53 - L57 were not covered by tests

// Default implements webhook.Defaulter so a webhook will be registered for the type.
func (c *AzureClusterTemplate) Default() {
c.setDefaults()
return nil

Check warning on line 60 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L60

Added line #L60 was not covered by tests
}

var _ webhook.Validator = &AzureClusterTemplate{}
var _ webhook.CustomValidator = &azureClusterTemplateWebhook{}

// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*azureClusterTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
c, ok := obj.(*AzureClusterTemplate)
if !ok {
return nil, fmt.Errorf("expected an AzureClusterTemplate object but got %T", c)
}

Check warning on line 70 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L66-L70

Added lines #L66 - L70 were not covered by tests

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureClusterTemplate) ValidateCreate() (admission.Warnings, error) {
return c.validateClusterTemplate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureClusterTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*azureClusterTemplateWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) {
c, ok := newObj.(*AzureClusterTemplate)
if !ok {
return nil, fmt.Errorf("expected an AzureClusterTemplate object but got %T", c)
}

Check warning on line 80 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L79-L80

Added lines #L79 - L80 were not covered by tests

var allErrs field.ErrorList
old := oldRaw.(*AzureClusterTemplate)
if !reflect.DeepEqual(c.Spec.Template.Spec, old.Spec.Template.Spec) {
Expand All @@ -70,7 +93,7 @@
return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterTemplateKind).GroupKind(), c.Name, allErrs)
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (c *AzureClusterTemplate) ValidateDelete() (admission.Warnings, error) {
// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
func (*azureClusterTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

Check warning on line 97 in api/v1beta1/azureclustertemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azureclustertemplate_webhook.go#L97

Added line #L97 was not covered by tests
return nil, nil
}
3 changes: 2 additions & 1 deletion api/v1beta1/azureclustertemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
"context"
"testing"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -57,7 +58,7 @@ func TestValidateUpdate(t *testing.T) {

t.Run("template is immutable", func(t *testing.T) {
g := NewWithT(t)
_, err := newClusterTemplate.ValidateUpdate(oldClusterTemplate)
_, err := (&azureClusterTemplateWebhook{}).ValidateUpdate(context.Background(), oldClusterTemplate, newClusterTemplate)
g.Expect(err).To(HaveOccurred())
})
}
Loading