Skip to content

Commit

Permalink
manual updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Oct 3, 2024
1 parent a5de974 commit a6a6748
Show file tree
Hide file tree
Showing 173 changed files with 166 additions and 328 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/azureasomanagedcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type azureASOManagedClusterWebhook struct {
// +kubebuilder:webhook:verbs=create,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-azureasomanagedcluster,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azureasomanagedclusters,versions=v1alpha1,name=validation.azureasomanagedcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedClusterWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedClusterWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcluster_webhook.go#L48

Added line #L48 was not covered by tests
_, ok := obj.(*AzureASOManagedCluster)
if !ok {
return nil, apierrors.NewBadRequest("expected an AzureASOManagedCluster")
Expand All @@ -60,11 +60,11 @@ func (ampw *azureASOManagedClusterWebhook) ValidateCreate(ctx context.Context, o
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedClusterWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedClusterWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcluster_webhook.go#L63

Added line #L63 was not covered by tests
return nil, nil
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedClusterWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcluster_webhook.go#L68

Added line #L68 was not covered by tests
return nil, nil
}
6 changes: 3 additions & 3 deletions api/v1alpha1/azureasomanagedcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type azureASOManagedControlPlaneWebhook struct {
// +kubebuilder:webhook:verbs=create,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-azureasomanagedcontrolplane,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azureasomanagedcontrolplanes,versions=v1alpha1,name=validation.azureasomanagedcontrolplane.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedControlPlaneWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedControlPlaneWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcontrolplane_webhook.go#L48

Added line #L48 was not covered by tests
_, ok := obj.(*AzureASOManagedControlPlane)
if !ok {
return nil, apierrors.NewBadRequest("expected an AzureASOManagedControlPlane")
Expand All @@ -60,11 +60,11 @@ func (ampw *azureASOManagedControlPlaneWebhook) ValidateCreate(ctx context.Conte
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedControlPlaneWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedControlPlaneWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcontrolplane_webhook.go#L63

Added line #L63 was not covered by tests
return nil, nil
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedControlPlaneWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedControlPlaneWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedcontrolplane_webhook.go#L68

Added line #L68 was not covered by tests
return nil, nil
}
6 changes: 3 additions & 3 deletions api/v1alpha1/azureasomanagedmachinepool_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type azureASOManagedMachinePoolWebhook struct {
// +kubebuilder:webhook:verbs=create,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha1-azureasomanagedmachinepool,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azureasomanagedmachinepools,versions=v1alpha1,name=validation.azureasomanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedMachinePoolWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedMachinePoolWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedmachinepool_webhook.go#L48

Added line #L48 was not covered by tests
_, ok := obj.(*AzureASOManagedMachinePool)
if !ok {
return nil, apierrors.NewBadRequest("expected an AzureASOManagedMachinePool")
Expand All @@ -60,11 +60,11 @@ func (ampw *azureASOManagedMachinePoolWebhook) ValidateCreate(ctx context.Contex
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedMachinePoolWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedMachinePoolWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedmachinepool_webhook.go#L63

Added line #L63 was not covered by tests
return nil, nil
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (ampw *azureASOManagedMachinePoolWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (ampw *azureASOManagedMachinePoolWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

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

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/azureasomanagedmachinepool_webhook.go#L68

Added line #L68 was not covered by tests
return nil, nil
}
2 changes: 1 addition & 1 deletion api/v1beta1/azurecluster_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func validateControlPlaneOutboundLB(lb *LoadBalancerSpec, apiserverLB LoadBalanc
func validatePrivateDNSZoneName(privateDNSZoneName string, apiserverLBType LBType, fldPath *field.Path) field.ErrorList {
var allErrs field.ErrorList

if len(privateDNSZoneName) > 0 {
if privateDNSZoneName != "" {
if apiserverLBType != Internal {
allErrs = append(allErrs, field.Invalid(fldPath, apiserverLBType,
"PrivateDNSZoneName is available only if APIServerLB.Type is Internal"))
Expand Down
5 changes: 0 additions & 5 deletions api/v1beta1/azurecluster_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,6 @@ func TestValidateSecurityRule(t *testing.T) {
},
}
for _, testCase := range tests {
testCase := testCase
t.Run(testCase.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down Expand Up @@ -1030,7 +1029,6 @@ func TestValidateAPIServerLB(t *testing.T) {
}

for _, test := range testcases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down Expand Up @@ -1110,7 +1108,6 @@ func TestPrivateDNSZoneName(t *testing.T) {
}

for _, test := range testcases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down Expand Up @@ -1267,7 +1264,6 @@ func TestValidateNodeOutboundLB(t *testing.T) {
}

for _, test := range testcases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down Expand Up @@ -1347,7 +1343,6 @@ func TestValidateControlPlaneNodeOutboundLB(t *testing.T) {
}

for _, test := range testcases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/azurecluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ func TestAzureCluster_ValidateUpdate(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremachine_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func ValidateCapacityReservationGroupID(capacityReservationGroupID *string, fldP
}

// ValidateVMExtensions validates the VMExtensions spec.
func ValidateVMExtensions(disableExtensionOperations *bool, vmExtensions []VMExtension, fldPath *field.Path) field.ErrorList {
func ValidateVMExtensions(disableExtensionOperations *bool, vmExtensions []VMExtension, _ *field.Path) field.ErrorList {
allErrs := field.ErrorList{}

if ptr.Deref(disableExtensionOperations, false) && len(vmExtensions) > 0 {
Expand Down
8 changes: 4 additions & 4 deletions api/v1beta1/azuremachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type azureMachineWebhook struct {
}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (mw *azureMachineWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (mw *azureMachineWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
m, ok := obj.(*AzureMachine)
if !ok {
return nil, apierrors.NewBadRequest("expected an AzureMachine resource")
Expand All @@ -75,7 +75,7 @@ func (mw *azureMachineWebhook) ValidateCreate(ctx context.Context, obj runtime.O
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (mw *azureMachineWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (mw *azureMachineWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
var allErrs field.ErrorList
old, ok := oldObj.(*AzureMachine)
if !ok {
Expand Down Expand Up @@ -228,12 +228,12 @@ func (mw *azureMachineWebhook) ValidateUpdate(ctx context.Context, oldObj, newOb
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (mw *azureMachineWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (mw *azureMachineWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

Check warning on line 231 in api/v1beta1/azuremachine_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azuremachine_webhook.go#L231

Added line #L231 was not covered by tests
return nil, nil
}

// Default implements webhook.Defaulter so a webhook will be registered for the type.
func (mw *azureMachineWebhook) Default(ctx context.Context, obj runtime.Object) error {
func (mw *azureMachineWebhook) Default(_ context.Context, obj runtime.Object) error {
m, ok := obj.(*AzureMachine)
if !ok {
return apierrors.NewBadRequest("expected an AzureMachine resource")
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/azuremachinetemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var _ webhook.CustomDefaulter = &AzureMachineTemplate{}
var _ webhook.CustomValidator = &AzureMachineTemplate{}

// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
func (r *AzureMachineTemplate) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (r *AzureMachineTemplate) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
t := obj.(*AzureMachineTemplate)
spec := t.Spec.Template.Spec

Expand Down Expand Up @@ -142,12 +142,12 @@ func (r *AzureMachineTemplate) ValidateUpdate(ctx context.Context, oldRaw runtim
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (r *AzureMachineTemplate) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (r *AzureMachineTemplate) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

Check warning on line 145 in api/v1beta1/azuremachinetemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azuremachinetemplate_webhook.go#L145

Added line #L145 was not covered by tests
return nil, nil
}

// Default implements webhookutil.defaulter so a webhook will be registered for the type.
func (r *AzureMachineTemplate) Default(ctx context.Context, obj runtime.Object) error {
func (r *AzureMachineTemplate) Default(_ context.Context, obj runtime.Object) error {
t := obj.(*AzureMachineTemplate)
if err := t.Spec.Template.Spec.SetDefaultSSHPublicKey(); err != nil {
ctrl.Log.WithName("SetDefault").Error(err, "SetDefaultSSHPublicKey failed")
Expand Down
3 changes: 0 additions & 3 deletions api/v1beta1/azuremachinetemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ func TestAzureMachineTemplate_ValidateCreate(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down Expand Up @@ -593,7 +592,6 @@ func TestAzureMachineTemplate_ValidateUpdate(t *testing.T) {

// dry-run=true
for _, amt := range tests {
amt := amt
t.Run(amt.name, func(t *testing.T) {
g := NewWithT(t)
ctx := admission.NewContextWithRequest(context.Background(), admission.Request{AdmissionRequest: admissionv1.AdmissionRequest{DryRun: ptr.To(true)}})
Expand All @@ -607,7 +605,6 @@ func TestAzureMachineTemplate_ValidateUpdate(t *testing.T) {
}
// dry-run=false
for _, amt := range tests {
amt := amt
t.Run(amt.name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremanagedcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *AzureManagedCluster) ValidateCreate() (admission.Warnings, error) {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *AzureManagedCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
func (r *AzureManagedCluster) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1beta1/azuremanagedcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type azureManagedControlPlaneWebhook struct {
}

// Default implements webhook.Defaulter so a webhook will be registered for the type.
func (mw *azureManagedControlPlaneWebhook) Default(ctx context.Context, obj runtime.Object) error {
func (mw *azureManagedControlPlaneWebhook) Default(_ context.Context, obj runtime.Object) error {
m, ok := obj.(*AzureManagedControlPlane)
if !ok {
return apierrors.NewBadRequest("expected an AzureManagedControlPlane")
Expand Down Expand Up @@ -106,7 +106,7 @@ func (mw *azureManagedControlPlaneWebhook) Default(ctx context.Context, obj runt
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedcontrolplanes,versions=v1beta1,name=validation.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (mw *azureManagedControlPlaneWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (mw *azureManagedControlPlaneWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {
m, ok := obj.(*AzureManagedControlPlane)
if !ok {
return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlane")
Expand All @@ -124,7 +124,7 @@ func (mw *azureManagedControlPlaneWebhook) ValidateCreate(ctx context.Context, o
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (mw *azureManagedControlPlaneWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (mw *azureManagedControlPlaneWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
var allErrs field.ErrorList
old, ok := oldObj.(*AzureManagedControlPlane)
if !ok {
Expand Down Expand Up @@ -241,7 +241,7 @@ func (mw *azureManagedControlPlaneWebhook) ValidateUpdate(ctx context.Context, o
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
func (mw *azureManagedControlPlaneWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (mw *azureManagedControlPlaneWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) {

Check warning on line 244 in api/v1beta1/azuremanagedcontrolplane_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azuremanagedcontrolplane_webhook.go#L244

Added line #L244 was not covered by tests
return nil, nil
}

Expand Down
4 changes: 0 additions & 4 deletions api/v1beta1/azuremanagedcontrolplane_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ func TestValidateVersion(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
allErrs := validateVersion(tt.version, field.NewPath("spec").Child("Version"))
Expand Down Expand Up @@ -273,7 +272,6 @@ func TestValidateLoadBalancerProfile(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
allErrs := validateLoadBalancerProfile(tt.profile, field.NewPath("spec").Child("loadBalancerProfile"))
Expand Down Expand Up @@ -465,7 +463,6 @@ func TestValidateAutoScalerProfile(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
allErrs := validateAutoScalerProfile(tt.profile, field.NewPath("spec").Child("autoScalerProfile"))
Expand Down Expand Up @@ -1390,7 +1387,6 @@ func TestValidatingWebhook(t *testing.T) {
}

for _, tt := range tests {
tt := tt
// client is used to fetch the AzureManagedControlPlane, we do not want to return an error on client.Get
client := mockClient{ReturnError: false}
t.Run(tt.name, func(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type azureManagedControlPlaneTemplateWebhook struct {
}

// Default implements webhook.Defaulter so a webhook will be registered for the type.
func (mcpw *azureManagedControlPlaneTemplateWebhook) Default(ctx context.Context, obj runtime.Object) error {
func (mcpw *azureManagedControlPlaneTemplateWebhook) Default(_ context.Context, obj runtime.Object) error {
mcp, ok := obj.(*AzureManagedControlPlaneTemplate)
if !ok {
return apierrors.NewBadRequest("expected an AzureManagedControlPlaneTemplate")
Expand All @@ -61,7 +61,7 @@ func (mcpw *azureManagedControlPlaneTemplateWebhook) Default(ctx context.Context
}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) {

Check warning on line 64 in api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go#L64

Added line #L64 was not covered by tests
mcp, ok := obj.(*AzureManagedControlPlaneTemplate)
if !ok {
return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlaneTemplate")
Expand All @@ -79,7 +79,7 @@ func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateCreate(ctx context.
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
var allErrs field.ErrorList
old, ok := oldObj.(*AzureManagedControlPlaneTemplate)
if !ok {
Expand Down Expand Up @@ -235,7 +235,7 @@ func (mcp *AzureManagedControlPlaneTemplate) validateManagedControlPlaneTemplate
}

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

Check warning on line 238 in api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go

View check run for this annotation

Codecov / codecov/patch

api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go#L238

Added line #L238 was not covered by tests
return nil, nil
}

Expand Down
Loading

0 comments on commit a6a6748

Please sign in to comment.