Skip to content

Commit

Permalink
polishing naming
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Apr 26, 2024
1 parent 6ebed6a commit 93129bf
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions apis/core/v1beta1/featureflag_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ var FlagsScheme string
// log is for logging in this package.
var featureflaglog = logf.Log.WithName("featureflag-resource")

func (r *FeatureFlag) SetupWebhookWithManager(mgr ctrl.Manager) error {
func (ff *FeatureFlag) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
For(ff).
Complete()
}

Expand All @@ -49,30 +49,30 @@ func (r *FeatureFlag) SetupWebhookWithManager(mgr ctrl.Manager) error {
var _ webhook.Validator = &FeatureFlag{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (r *FeatureFlag) ValidateCreate() error {
featureflaglog.Info("validate create", "name", r.Name)
func (ff *FeatureFlag) ValidateCreate() error {
featureflaglog.Info("validate create", "name", ff.Name)

if err := validateFeatureFlagFlags(r.Spec.FlagSpec.Flags); err != nil {
if err := validateFeatureFlagFlags(ff.Spec.FlagSpec.Flags); err != nil {
return err
}

return nil
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *FeatureFlag) ValidateUpdate(old runtime.Object) error {
featureflaglog.Info("validate update", "name", r.Name)
func (ff *FeatureFlag) ValidateUpdate(old runtime.Object) error {
featureflaglog.Info("validate update", "name", ff.Name)

if err := validateFeatureFlagFlags(r.Spec.FlagSpec.Flags); err != nil {
if err := validateFeatureFlagFlags(ff.Spec.FlagSpec.Flags); err != nil {
return err
}

return nil
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (r *FeatureFlag) ValidateDelete() error {
featureflaglog.Info("validate delete", "name", r.Name)
func (ff *FeatureFlag) ValidateDelete() error {
featureflaglog.Info("validate delete", "name", ff.Name)

return nil
}
Expand Down

0 comments on commit 93129bf

Please sign in to comment.