Skip to content

Commit baf4186

Browse files
committed
Remove unused code and comments from GatewayClass webhook
Clean up redundant license header, TODOs, and unused variables to streamline the code. This improves readability and focuses on the essential functionality of the webhook setup.
1 parent c616001 commit baf4186

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

internal/webhook/v1/gatewayclass_webhook.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
Copyright 2024.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
16-
171
package v1
182

193
import (
@@ -31,8 +15,6 @@ import (
3115
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
3216
)
3317

34-
// nolint:unused
35-
// log is for logging in this package.
3618
var _gcLog = logf.Log.WithName("gatewayclass-resource")
3719

3820
// SetupGatewayClassWebhookWithManager registers the webhook for GatewayClass in the manager.
@@ -45,11 +27,6 @@ func SetupGatewayClassWebhookWithManager(mgr ctrl.Manager) error {
4527
Complete()
4628
}
4729

48-
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
49-
50-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
51-
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
52-
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
5330
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-gatewayclass,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=gatewayclasses,verbs=create;update;delete,versions=v1,name=vgatewayclass-v1.kb.io,admissionReviewVersions=v1
5431

5532
// GatewayClassCustomValidator struct is responsible for validating the GatewayClass resource

0 commit comments

Comments
 (0)