Skip to content

Commit ec6fe35

Browse files
Merge pull request #437 from posikoya/posikoya/remove-scaffolding-comments
Remove scaffolding TODOs from v1beta1 webhooks
2 parents 1874769 + 0ea6ad3 commit ec6fe35

4 files changed

Lines changed: 4 additions & 60 deletions

File tree

internal/webhook/v1beta1/ansibletest_webhook.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ var (
3636
ErrInvalidAnsibleTestType = errors.New("invalid object type for AnsibleTest webhook")
3737
)
3838

39-
// nolint:unused
40-
// log is for logging in this package.
39+
// ansibletestlog is for logging in this package.
4140
var ansibletestlog = logf.Log.WithName("ansibletest-resource")
4241

4342
// SetupAnsibleTestWebhookWithManager registers the webhook for AnsibleTest in the manager.
@@ -51,17 +50,11 @@ func SetupAnsibleTestWebhookWithManager(mgr ctrl.Manager) error {
5150
Complete()
5251
}
5352

54-
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
55-
5653
// +kubebuilder:webhook:path=/mutate-test-openstack-org-v1beta1-ansibletest,mutating=true,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=ansibletests,verbs=create;update,versions=v1beta1,name=mansibletest-v1beta1.kb.io,admissionReviewVersions=v1
5754

5855
// AnsibleTestCustomDefaulter struct is responsible for setting default values on the custom resource of the
5956
// Kind AnsibleTest when those are created or updated.
60-
//
61-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
62-
// as it is used only for temporary operations and does not need to be deeply copied.
6357
type AnsibleTestCustomDefaulter struct {
64-
// TODO(user): Add more fields as needed for defaulting
6558
}
6659

6760
var _ webhook.CustomDefaulter = &AnsibleTestCustomDefaulter{}
@@ -81,18 +74,11 @@ func (d *AnsibleTestCustomDefaulter) Default(_ context.Context, obj runtime.Obje
8174
return nil
8275
}
8376

84-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
85-
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
86-
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
8777
// +kubebuilder:webhook:path=/validate-test-openstack-org-v1beta1-ansibletest,mutating=false,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=ansibletests,verbs=create;update,versions=v1beta1,name=vansibletest-v1beta1.kb.io,admissionReviewVersions=v1
8878

8979
// AnsibleTestCustomValidator struct is responsible for validating the AnsibleTest resource
9080
// when it is created, updated, or deleted.
91-
//
92-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
93-
// as this struct is used only for temporary operations and does not need to be deeply copied.
9481
type AnsibleTestCustomValidator struct {
95-
// TODO(user): Add more fields as needed for validation
9682
}
9783

9884
var _ webhook.CustomValidator = &AnsibleTestCustomValidator{}

internal/webhook/v1beta1/horizontest_webhook.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ var (
3535
ErrInvalidHorizonTestType = errors.New("invalid object type for HorizonTest webhook")
3636
)
3737

38-
// nolint:unused
39-
// log is for logging in this package.
38+
// horizontestlog is for logging in this package.
4039
var horizontestlog = logf.Log.WithName("horizontest-resource")
4140

4241
// SetupHorizonTestWebhookWithManager registers the webhook for HorizonTest in the manager.
@@ -50,17 +49,11 @@ func SetupHorizonTestWebhookWithManager(mgr ctrl.Manager) error {
5049
Complete()
5150
}
5251

53-
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
54-
5552
// +kubebuilder:webhook:path=/mutate-test-openstack-org-v1beta1-horizontest,mutating=true,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=horizontests,verbs=create;update,versions=v1beta1,name=mhorizontest-v1beta1.kb.io,admissionReviewVersions=v1
5653

5754
// HorizonTestCustomDefaulter struct is responsible for setting default values on the custom resource of the
5855
// Kind HorizonTest when those are created or updated.
59-
//
60-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
61-
// as it is used only for temporary operations and does not need to be deeply copied.
6256
type HorizonTestCustomDefaulter struct {
63-
// TODO(user): Add more fields as needed for defaulting
6457
}
6558

6659
var _ webhook.CustomDefaulter = &HorizonTestCustomDefaulter{}
@@ -80,18 +73,11 @@ func (d *HorizonTestCustomDefaulter) Default(_ context.Context, obj runtime.Obje
8073
return nil
8174
}
8275

83-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
84-
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
85-
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
8676
// +kubebuilder:webhook:path=/validate-test-openstack-org-v1beta1-horizontest,mutating=false,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=horizontests,verbs=create;update,versions=v1beta1,name=vhorizontest-v1beta1.kb.io,admissionReviewVersions=v1
8777

8878
// HorizonTestCustomValidator struct is responsible for validating the HorizonTest resource
8979
// when it is created, updated, or deleted.
90-
//
91-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
92-
// as this struct is used only for temporary operations and does not need to be deeply copied.
9380
type HorizonTestCustomValidator struct {
94-
// TODO(user): Add more fields as needed for validation
9581
}
9682

9783
var _ webhook.CustomValidator = &HorizonTestCustomValidator{}

internal/webhook/v1beta1/tempest_webhook.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ var (
3535
ErrInvalidTempestType = errors.New("invalid object type for Tempest webhook")
3636
)
3737

38-
// nolint:unused
39-
// log is for logging in this package.
38+
// tempestlog is for logging in this package.
4039
var tempestlog = logf.Log.WithName("tempest-resource")
4140

4241
// SetupTempestWebhookWithManager registers the webhook for Tempest in the manager.
@@ -50,17 +49,11 @@ func SetupTempestWebhookWithManager(mgr ctrl.Manager) error {
5049
Complete()
5150
}
5251

53-
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
54-
5552
// +kubebuilder:webhook:path=/mutate-test-openstack-org-v1beta1-tempest,mutating=true,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=tempests,verbs=create;update,versions=v1beta1,name=mtempest-v1beta1.kb.io,admissionReviewVersions=v1
5653

5754
// TempestCustomDefaulter struct is responsible for setting default values on the custom resource of the
5855
// Kind Tempest when those are created or updated.
59-
//
60-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
61-
// as it is used only for temporary operations and does not need to be deeply copied.
6256
type TempestCustomDefaulter struct {
63-
// TODO(user): Add more fields as needed for defaulting
6457
}
6558

6659
var _ webhook.CustomDefaulter = &TempestCustomDefaulter{}
@@ -80,18 +73,11 @@ func (d *TempestCustomDefaulter) Default(_ context.Context, obj runtime.Object)
8073
return nil
8174
}
8275

83-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
84-
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
85-
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
8676
// +kubebuilder:webhook:path=/validate-test-openstack-org-v1beta1-tempest,mutating=false,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=tempests,verbs=create;update,versions=v1beta1,name=vtempest-v1beta1.kb.io,admissionReviewVersions=v1
8777

8878
// TempestCustomValidator struct is responsible for validating the Tempest resource
8979
// when it is created, updated, or deleted.
90-
//
91-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
92-
// as this struct is used only for temporary operations and does not need to be deeply copied.
9380
type TempestCustomValidator struct {
94-
// TODO(user): Add more fields as needed for validation
9581
}
9682

9783
var _ webhook.CustomValidator = &TempestCustomValidator{}

internal/webhook/v1beta1/tobiko_webhook.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ var (
3535
ErrInvalidTobikoType = errors.New("invalid object type for Tobiko webhook")
3636
)
3737

38-
// nolint:unused
39-
// log is for logging in this package.
38+
// tobikolog is for logging in this package.
4039
var tobikolog = logf.Log.WithName("tobiko-resource")
4140

4241
// SetupTobikoWebhookWithManager registers the webhook for Tobiko in the manager.
@@ -50,17 +49,11 @@ func SetupTobikoWebhookWithManager(mgr ctrl.Manager) error {
5049
Complete()
5150
}
5251

53-
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
54-
5552
// +kubebuilder:webhook:path=/mutate-test-openstack-org-v1beta1-tobiko,mutating=true,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=tobikoes,verbs=create;update,versions=v1beta1,name=mtobiko-v1beta1.kb.io,admissionReviewVersions=v1
5653

5754
// TobikoCustomDefaulter struct is responsible for setting default values on the custom resource of the
5855
// Kind Tobiko when those are created or updated.
59-
//
60-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
61-
// as it is used only for temporary operations and does not need to be deeply copied.
6256
type TobikoCustomDefaulter struct {
63-
// TODO(user): Add more fields as needed for defaulting
6457
}
6558

6659
var _ webhook.CustomDefaulter = &TobikoCustomDefaulter{}
@@ -80,18 +73,11 @@ func (d *TobikoCustomDefaulter) Default(_ context.Context, obj runtime.Object) e
8073
return nil
8174
}
8275

83-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
84-
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
85-
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
8676
// +kubebuilder:webhook:path=/validate-test-openstack-org-v1beta1-tobiko,mutating=false,failurePolicy=fail,sideEffects=None,groups=test.openstack.org,resources=tobikoes,verbs=create;update,versions=v1beta1,name=vtobiko-v1beta1.kb.io,admissionReviewVersions=v1
8777

8878
// TobikoCustomValidator struct is responsible for validating the Tobiko resource
8979
// when it is created, updated, or deleted.
90-
//
91-
// NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods,
92-
// as this struct is used only for temporary operations and does not need to be deeply copied.
9380
type TobikoCustomValidator struct {
94-
// TODO(user): Add more fields as needed for validation
9581
}
9682

9783
var _ webhook.CustomValidator = &TobikoCustomValidator{}

0 commit comments

Comments
 (0)