Skip to content

Commit 7cc41d5

Browse files
fix lint
Signed-off-by: Xudong Liu <[email protected]>
1 parent 37441be commit 7cc41d5

File tree

10 files changed

+23
-13
lines changed

10 files changed

+23
-13
lines changed

pkg/cloudprovider/vsphereparavirtual/instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
)
3838

3939
type instances struct {
40-
vmClient vmop.VmoperatorV1alpha1Interface
40+
vmClient vmop.V1alpha1Interface
4141
namespace string
4242
}
4343

pkg/cloudprovider/vsphereparavirtual/vmoperator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// discoverNodeByProviderID takes a ProviderID and returns a VirtualMachine if one exists, or nil otherwise
1616
// VirtualMachine not found is not an error
17-
func discoverNodeByProviderID(ctx context.Context, providerID string, namespace string, vmClient vmop.VmoperatorV1alpha1Interface) (*vmopv1alpha1.VirtualMachine, error) {
17+
func discoverNodeByProviderID(ctx context.Context, providerID string, namespace string, vmClient vmop.V1alpha1Interface) (*vmopv1alpha1.VirtualMachine, error) {
1818
var discoveredNode *vmopv1alpha1.VirtualMachine = nil
1919

2020
// Adding Retry here because there is no retry in caller from node controller
@@ -44,7 +44,7 @@ func discoverNodeByProviderID(ctx context.Context, providerID string, namespace
4444

4545
// discoverNodeByName takes a node name and returns a VirtualMachine if one exists, or nil otherwise
4646
// VirtualMachine not found is not an error
47-
func discoverNodeByName(ctx context.Context, name types.NodeName, namespace string, vmClient vmop.VmoperatorV1alpha1Interface) (*vmopv1alpha1.VirtualMachine, error) {
47+
func discoverNodeByName(ctx context.Context, name types.NodeName, namespace string, vmClient vmop.V1alpha1Interface) (*vmopv1alpha1.VirtualMachine, error) {
4848
var discoveredNode *vmopv1alpha1.VirtualMachine = nil
4949

5050
// Adding Retry here because there is no retry in caller from node controller

pkg/cloudprovider/vsphereparavirtual/vmoperator/client/client.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,44 @@ import (
1212
)
1313

1414
var (
15+
// VirtualMachineServiceGVR has virtualmachineservice resource info.
1516
VirtualMachineServiceGVR = schema.GroupVersionResource{
1617
Group: "vmoperator.vmware.com",
1718
Version: "v1alpha1",
1819
Resource: "virtualmachineservices",
1920
}
20-
21+
// VirtualMachineGVR has virtualmachine resource info.
2122
VirtualMachineGVR = schema.GroupVersionResource{
2223
Group: "vmoperator.vmware.com",
2324
Version: "v1alpha1",
2425
Resource: "virtualmachines",
2526
}
2627
)
2728

29+
// VmoperatorV1alpha1Client contains the dynamic client for vm operator group
2830
type VmoperatorV1alpha1Client struct {
2931
dynamicClient *dynamic.DynamicClient
3032
}
3133

34+
// VirtualMachines retrieves the virtualmachine client
3235
func (c *VmoperatorV1alpha1Client) VirtualMachines(namespace string) vmoperator.VirtualMachineInterface {
3336
return newVirtualMachines(c, namespace)
3437
}
3538

39+
// VirtualMachineServices retrieves the virtualmachineservice client
3640
func (c *VmoperatorV1alpha1Client) VirtualMachineServices(namespace string) vmoperator.VirtualMachineServiceInterface {
3741
return newVirtualMachineServices(c, namespace)
3842
}
3943

44+
// Client retrieves the dynamic client
4045
func (c *VmoperatorV1alpha1Client) Client() dynamic.Interface {
4146
if c == nil {
4247
return nil
4348
}
4449
return c.dynamicClient
4550
}
4651

52+
// NewForConfig creates a new client for the given config.
4753
func NewForConfig(c *rest.Config) (*VmoperatorV1alpha1Client, error) {
4854
scheme := runtime.NewScheme()
4955
_ = vmopv1alpha1.AddToScheme(scheme)

pkg/cloudprovider/vsphereparavirtual/vmoperator/client/fake_client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,29 @@ import (
77
"k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator"
88
)
99

10+
// FakeClient contains the fake dynamic client for vm operator group
1011
type FakeClient struct {
1112
DynamicClient *dynamicfake.FakeDynamicClient
1213
}
1314

14-
// NewFakeClientWrapper creates a FakeClientWrapper
15+
// NewFakeClient creates a FakeClientWrapper
1516
func NewFakeClient(fakeClient *dynamicfake.FakeDynamicClient) *FakeClient {
1617
fcw := FakeClient{}
1718
fcw.DynamicClient = fakeClient
1819
return &fcw
1920
}
2021

22+
// VirtualMachines retrieves the virtualmachine client
2123
func (c *FakeClient) VirtualMachines(namespace string) vmoperator.VirtualMachineInterface {
2224
return newVirtualMachines(c, namespace)
2325
}
2426

27+
// VirtualMachineServices retrieves the virtualmachineservice client
2528
func (c *FakeClient) VirtualMachineServices(namespace string) vmoperator.VirtualMachineServiceInterface {
2629
return newVirtualMachineServices(c, namespace)
2730
}
2831

32+
// Client retrieves the dynamic client
2933
func (c *FakeClient) Client() dynamic.Interface {
3034
if c == nil {
3135
return nil

pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type virtualMachines struct {
1919
ns string
2020
}
2121

22-
func newVirtualMachines(c vmoperator.VmoperatorV1alpha1Interface, namespace string) *virtualMachines {
22+
func newVirtualMachines(c vmoperator.V1alpha1Interface, namespace string) *virtualMachines {
2323
return &virtualMachines{
2424
client: c.Client(),
2525
ns: namespace,

pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type virtualMachineServices struct {
1919
}
2020

2121
// newVirtualMachineServices returns a VirtualMachineServices
22-
func newVirtualMachineServices(c vmoperator.VmoperatorV1alpha1Interface, namespace string) *virtualMachineServices {
22+
func newVirtualMachineServices(c vmoperator.V1alpha1Interface, namespace string) *virtualMachineServices {
2323
return &virtualMachineServices{
2424
client: c.Client(),
2525
ns: namespace,

pkg/cloudprovider/vsphereparavirtual/vmoperator/interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1"
1010
)
1111

12-
// VmoperatorV1alpha1Interface has methods to work with Vmoperator V1alpha1 resources.
13-
type VmoperatorV1alpha1Interface interface {
12+
// V1alpha1Interface has methods to work with Vmoperator V1alpha1 resources.
13+
type V1alpha1Interface interface {
1414
Client() dynamic.Interface
1515
VirtualMachines(namespace string) VirtualMachineInterface
1616
VirtualMachineServices(namespace string) VirtualMachineServiceInterface

pkg/cloudprovider/vsphereparavirtual/vmservice/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type VMService interface {
4141

4242
// vmService takes care of mapping of LB type of service to VM service in supervisor cluster
4343
type vmService struct {
44-
vmClient vmop.VmoperatorV1alpha1Interface
44+
vmClient vmop.V1alpha1Interface
4545
namespace string
4646
ownerReference *metav1.OwnerReference
4747
}

pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ var (
8888

8989
// GetVmopClient gets a vm-operator-api client
9090
// This is separate from NewVMService so that a fake client can be injected for testing
91-
func GetVmopClient(config *rest.Config) (vmop.VmoperatorV1alpha1Interface, error) {
91+
func GetVmopClient(config *rest.Config) (vmop.V1alpha1Interface, error) {
9292
return vmopclient.NewForConfig(config)
9393
}
9494

9595
// NewVMService creates a vmService object
96-
func NewVMService(vmClient vmop.VmoperatorV1alpha1Interface, ns string, ownerRef *metav1.OwnerReference) VMService {
96+
func NewVMService(vmClient vmop.V1alpha1Interface, ns string, ownerRef *metav1.OwnerReference) VMService {
9797
return &vmService{
9898
vmClient: vmClient,
9999
namespace: ns,

pkg/cloudprovider/vsphereparavirtual/zone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
type zones struct {
17-
vmClient vmop.VmoperatorV1alpha1Interface
17+
vmClient vmop.V1alpha1Interface
1818
namespace string
1919
}
2020

0 commit comments

Comments
 (0)