diff --git a/pkg/pebinaryexecutor/pebinary.go b/pkg/pebinaryexecutor/pebinary.go index 11a1718fa54..3e0da37c2de 100644 --- a/pkg/pebinaryexecutor/pebinary.go +++ b/pkg/pebinaryexecutor/pebinary.go @@ -53,7 +53,7 @@ type PEBinaryConfig struct { DisableETCD bool IsServer bool CNIName string - CniPlugin win.CniPlugin + CNIPlugin win.CNIPlugin } type CloudProviderConfig struct { @@ -104,15 +104,15 @@ func (p *PEBinaryConfig) Bootstrap(ctx context.Context, nodeConfig *daemonconfig restConfig, err := clientcmd.BuildConfigFromFlags("", nodeConfig.AgentConfig.KubeConfigK3sController) - p.CNIName, err = getCniPluginName(restConfig) + p.CNIName, err = getCNIPluginName(restConfig) if err != nil { return err } switch p.CNIName { case "", CNICalico: - p.CniPlugin = &win.Calico{} - if err := p.CniPlugin.Setup(ctx, nodeConfig, restConfig, p.DataDir); err != nil { + p.CNIPlugin = &win.Calico{} + if err := p.CNIPlugin.Setup(ctx, nodeConfig, restConfig, p.DataDir); err != nil { return err } case CNINone: @@ -160,7 +160,7 @@ func (p *PEBinaryConfig) Kubelet(ctx context.Context, args []string) error { cniCtx, cancel := context.WithCancel(ctx) if p.CNIName != CNINone { go func() { - if err := p.CniPlugin.Start(cniCtx); err != nil { + if err := p.CNIPlugin.Start(cniCtx); err != nil { logrus.Errorf("error in cni start: %s", err) } }() @@ -185,8 +185,8 @@ func (p *PEBinaryConfig) KubeProxy(ctx context.Context, args []string) error { return nil } - CNIConfig := p.CniPlugin.GetConfig() - vip, err := p.CniPlugin.ReserveSourceVip(ctx) + CNIConfig := p.CNIPlugin.GetConfig() + vip, err := p.CNIPlugin.ReserveSourceVip(ctx) if err != nil || vip == "" { logrus.Errorf("Failed to reserve VIP for kube-proxy: %s", err) } @@ -277,7 +277,7 @@ func getArgs(argsMap map[string]string) []string { return args } -func getCniPluginName(restConfig *rest.Config) (string, error) { +func getCNIPluginName(restConfig *rest.Config) (string, error) { hc, err := helm.NewFactoryFromConfig(restConfig) if err != nil { return "", err diff --git a/pkg/windows/types.go b/pkg/windows/types.go index e368d05aa48..c2380b2ccb1 100644 --- a/pkg/windows/types.go +++ b/pkg/windows/types.go @@ -11,7 +11,7 @@ import ( "k8s.io/client-go/rest" ) -type CniPlugin interface { +type CNIPlugin interface { Setup(ctx context.Context, nodeConfig *daemonconfig.Node, restConfig *rest.Config, dataDir string) error Start(ctx context.Context) error GetConfig() *CNICommonConfig