diff --git a/apis/v1beta1/vspheremachinetemplate_webhooks_test.go b/apis/v1beta1/vspheremachinetemplate_webhooks_test.go index ce44ae0e41..3e02950749 100644 --- a/apis/v1beta1/vspheremachinetemplate_webhooks_test.go +++ b/apis/v1beta1/vspheremachinetemplate_webhooks_test.go @@ -56,7 +56,7 @@ func TestVSphereMachineTemplate_ValidateCreate(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { webhook := &VSphereMachineTemplateWebhook{} - err := webhook.ValidateCreate(context.TODO(), tc.vsphereMachine) + err := webhook.ValidateCreate(context.Background(), tc.vsphereMachine) if tc.wantErr { g.Expect(err).To(HaveOccurred()) } else { @@ -99,7 +99,7 @@ func TestVSphereMachineTemplate_ValidateUpdate(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { webhook := &VSphereMachineTemplateWebhook{} - err := webhook.ValidateUpdate(context.TODO(), tc.oldVSphereMachine, tc.vsphereMachine) + err := webhook.ValidateUpdate(context.Background(), tc.oldVSphereMachine, tc.vsphereMachine) if tc.wantErr { g.Expect(err).To(HaveOccurred()) } else { diff --git a/main.go b/main.go index d9c7d329db..5475828751 100644 --- a/main.go +++ b/main.go @@ -29,11 +29,11 @@ import ( "github.com/spf13/pflag" "gopkg.in/fsnotify.v1" "k8s.io/apimachinery/pkg/api/meta" + cliflag "k8s.io/component-base/cli/flag" "k8s.io/component-base/logs" _ "k8s.io/component-base/logs/json/register" "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" - ctrllog "sigs.k8s.io/controller-runtime/pkg/log" ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager" ctrlsig "sigs.k8s.io/controller-runtime/pkg/manager/signals" @@ -48,7 +48,7 @@ import ( ) var ( - setupLog = ctrllog.Log.WithName("entrypoint") + setupLog = ctrl.Log.WithName("entrypoint") logOptions = logs.NewOptions() managerOpts manager.Options @@ -152,6 +152,7 @@ func main() { InitFlags(pflag.CommandLine) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc) pflag.Parse() if err := logOptions.ValidateAndApply(nil); err != nil {