Skip to content

Commit

Permalink
Remove v1a1 VM mutation webhook when v1a2 FSS is enabled
Browse files Browse the repository at this point in the history
The v1a1 VM mutation webhook can be safely removed because the
v1a2 VM mutation webhook does that needful now.
  • Loading branch information
sreyasn committed Nov 13, 2023
1 parent 92acdd6 commit 4916b2d
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions webhooks/virtualmachine/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/vmware-tanzu/vm-operator/pkg/context"
"github.com/vmware-tanzu/vm-operator/pkg/lib"
"github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha1"
v1a1mut "github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha1/mutation"
"github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/v1alpha2"
)

Expand All @@ -20,10 +19,6 @@ func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) er
if err := v1alpha2.AddToManager(ctx, mgr); err != nil {
return errors.Wrap(err, "failed to initialize v1alpha2 webhooks")
}
// With v1a2 FSS enabled, the v1a1 VM mutation webhook is added to the manager
if err := v1a1mut.AddToManager(ctx, mgr); err != nil {
return errors.Wrap(err, "failed to initialize v1alpha1 virtual machine mutation webhooks")
}
} else {
if err := v1alpha1.AddToManager(ctx, mgr); err != nil {
return errors.Wrap(err, "failed to initialize v1alpha1 webhooks")
Expand Down

0 comments on commit 4916b2d

Please sign in to comment.