Skip to content

Commit

Permalink
Merge pull request #58 from vmware/mshobha/fix-lint-check-v1.48
Browse files Browse the repository at this point in the history
Fix lint check for golangci-lint v1.48.0
  • Loading branch information
shobha2626 authored Aug 18, 2022
2 parents 4248b2d + 97abf36 commit a1f8166
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 108 deletions.
20 changes: 5 additions & 15 deletions internal/client/clustergroup/cluster_group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ func New(transport *transport.Client) ClientService {
return &Client{Client: transport}
}

/*
Client for cluster group resource service API
*/
// Client for cluster group resource service API.
type Client struct {
*transport.Client
}
Expand All @@ -35,9 +33,7 @@ type ClientService interface {
ManageV1alpha1ClusterGroupResourceServiceUpdate(request *clustergroupmodel.VmwareTanzuManageV1alpha1ClusterGroupRequest) (*clustergroupmodel.VmwareTanzuManageV1alpha1ClusterGroupResponse, error)
}

/*
ManageV1alpha1ClusterGroupResourceServiceGet gets a cluster group
*/
// ManageV1alpha1ClusterGroupResourceServiceGet gets a cluster group.
func (c *Client) ManageV1alpha1ClusterGroupResourceServiceGet(
fn *clustergroupmodel.VmwareTanzuManageV1alpha1ClustergroupFullName,
) (*clustergroupmodel.VmwareTanzuManageV1alpha1ClustergroupGetClusterGroupResponse, error) {
Expand All @@ -49,9 +45,7 @@ func (c *Client) ManageV1alpha1ClusterGroupResourceServiceGet(
return clusterGroupResponse, err
}

/*
ManageV1alpha1ClusterGroupResourceServiceDelete deletes a cluster group
*/
// ManageV1alpha1ClusterGroupResourceServiceDelete deletes a cluster group.
func (c *Client) ManageV1alpha1ClusterGroupResourceServiceDelete(
fn *clustergroupmodel.VmwareTanzuManageV1alpha1ClustergroupFullName,
) error {
Expand All @@ -60,9 +54,7 @@ func (c *Client) ManageV1alpha1ClusterGroupResourceServiceDelete(
return c.Delete(requestURL)
}

/*
ManageV1alpha1ClusterGroupResourceServiceCreate creates a cluster group
*/
// ManageV1alpha1ClusterGroupResourceServiceCreate creates a cluster group.
func (c *Client) ManageV1alpha1ClusterGroupResourceServiceCreate(
request *clustergroupmodel.VmwareTanzuManageV1alpha1ClusterGroupRequest,
) (*clustergroupmodel.VmwareTanzuManageV1alpha1ClusterGroupResponse, error) {
Expand All @@ -72,9 +64,7 @@ func (c *Client) ManageV1alpha1ClusterGroupResourceServiceCreate(
return clusterGroupResponse, err
}

/*
ManageV1alpha1ClusterGroupResourceServiceUpdate updates a cluster group
*/
// ManageV1alpha1ClusterGroupResourceServiceUpdate updates a cluster group.
func (c *Client) ManageV1alpha1ClusterGroupResourceServiceUpdate(
request *clustergroupmodel.VmwareTanzuManageV1alpha1ClusterGroupRequest,
) (*clustergroupmodel.VmwareTanzuManageV1alpha1ClusterGroupResponse, error) {
Expand Down
16 changes: 4 additions & 12 deletions internal/client/workspace/workspace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ type ClientService interface {
ManageV1alpha1WorkspaceResourceServiceUpdate(fn *workspacemodel.VmwareTanzuManageV1alpha1WorkspaceRequest) (*workspacemodel.VmwareTanzuManageV1alphaWorkspaceResponse, error)
}

/*
ManageV1alpha1WorkspaceResourceServiceUpdate updates a workspace.
*/
// ManageV1alpha1WorkspaceResourceServiceUpdate updates a workspace.
func (c *Client) ManageV1alpha1WorkspaceResourceServiceUpdate(
request *workspacemodel.VmwareTanzuManageV1alpha1WorkspaceRequest,
) (*workspacemodel.VmwareTanzuManageV1alphaWorkspaceResponse, error) {
Expand All @@ -48,9 +46,7 @@ func (c *Client) ManageV1alpha1WorkspaceResourceServiceUpdate(
return namespaceResponse, err
}

/*
ManageV1alpha1WorkspaceResourceServiceCreate creates a workspace.
*/
// ManageV1alpha1WorkspaceResourceServiceCreate creates a workspace.
func (c *Client) ManageV1alpha1WorkspaceResourceServiceCreate(
request *workspacemodel.VmwareTanzuManageV1alpha1WorkspaceRequest,
) (*workspacemodel.VmwareTanzuManageV1alphaWorkspaceResponse, error) {
Expand All @@ -60,9 +56,7 @@ func (c *Client) ManageV1alpha1WorkspaceResourceServiceCreate(
return namespaceResponse, err
}

/*
ManageV1alpha1WorkspaceResourceServiceGet gets a workspace.
*/
// ManageV1alpha1WorkspaceResourceServiceGet gets a workspace.
func (c *Client) ManageV1alpha1WorkspaceResourceServiceGet(
fn *workspacemodel.VmwareTanzuManageV1alpha1WorkspaceFullName,
) (*workspacemodel.VmwareTanzuManageV1alpha1WorkspaceGetWorkspaceResponse, error) {
Expand All @@ -74,9 +68,7 @@ func (c *Client) ManageV1alpha1WorkspaceResourceServiceGet(
return workspaceResponse, err
}

/*
ManageV1alpha1WorkspaceResourceServiceDelete deletes a workspace.
*/
// ManageV1alpha1WorkspaceResourceServiceDelete deletes a workspace.
func (c *Client) ManageV1alpha1WorkspaceResourceServiceDelete(
fn *workspacemodel.VmwareTanzuManageV1alpha1WorkspaceFullName,
) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/helper/request_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func ConstructRequestURL(paths ...string) (url RequestURL) {

// AppendQueryParams appends query parameters to a request URL.
func (ru RequestURL) AppendQueryParams(queryParameters url.Values) (url RequestURL) {
if queryParameters == nil || len(queryParameters) == 0 {
if len(queryParameters) == 0 {
return ru
}

Expand Down
17 changes: 9 additions & 8 deletions internal/models/cluster/cluster_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import (
)

// VmwareTanzuManageV1alpha1ClusterType Type describe type of cluster.
//
// - TYPE_UNSPECIFIED: TYPE_UNSPECIFIED cluster type.
// - ATTACHED: ATTACHED cluster type.
// - PROVISIONED: PROVISIONED cluster type.
// - TANZU_KUBERNETES_GRID_SERVICE: Tanzu Kubernetes Grid Service cluster type.
// - TANZU_KUBERNETES_GRID: Tanzu Kubernetes Grid cluster type.
//
// swagger:model vmware.tanzu.manage.v1alpha1.cluster.Type
/*
- TYPE_UNSPECIFIED: TYPE_UNSPECIFIED cluster type.
- ATTACHED: ATTACHED cluster type.
- PROVISIONED: PROVISIONED cluster type.
- TANZU_KUBERNETES_GRID_SERVICE: Tanzu Kubernetes Grid Service cluster type.
- TANZU_KUBERNETES_GRID: Tanzu Kubernetes Grid cluster type.
swagger:model vmware.tanzu.manage.v1alpha1.cluster.Type
*/
type VmwareTanzuManageV1alpha1ClusterType string

func NewVmwareTanzuManageV1alpha1ClusterType(value VmwareTanzuManageV1alpha1ClusterType) *VmwareTanzuManageV1alpha1ClusterType {
Expand Down
17 changes: 9 additions & 8 deletions internal/models/cluster/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import (
)

// VmwareTanzuManageV1alpha1CommonClusterHealth Health describes the health of a resource.
//
// - HEALTH_UNSPECIFIED: Unspecified health.
// - HEALTHY: Resource is healthy.
// - WARNING: Resource is in warning state.
// - UNHEALTHY: Resource is unhealthy.
// - DISCONNECTED: Resource is disconnected.
//
// swagger:model vmware.tanzu.manage.v1alpha1.common.cluster.Health
/*
- HEALTH_UNSPECIFIED: Unspecified health.
- HEALTHY: Resource is healthy.
- WARNING: Resource is in warning state.
- UNHEALTHY: Resource is unhealthy.
- DISCONNECTED: Resource is disconnected.
swagger:model vmware.tanzu.manage.v1alpha1.common.cluster.Health
*/
type VmwareTanzuManageV1alpha1CommonClusterHealth string

func NewVmwareTanzuManageV1alpha1CommonClusterHealth(value VmwareTanzuManageV1alpha1CommonClusterHealth) *VmwareTanzuManageV1alpha1CommonClusterHealth {
Expand Down
21 changes: 11 additions & 10 deletions internal/models/cluster/infra_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import (
)

// VmwareTanzuManageV1alpha1CommonClusterInfrastructureProvider InfrastructureProvider definition - indicates the cluster infrastructure provider.
//
// - INFRASTRUCTURE_PROVIDER_UNSPECIFIED: Unspecified infrastructure provider (default).
// - INFRASTRUCTURE_PROVIDER_NONE: No cloud provider (likely bare metal).
// - AWS_EC2: AmazonWeb Services EC2.
// - GCP_GCE: Google Cloud.
// - AZURE_COMPUTE: Azure Compute.
// - VMWARE_VSPHERE: VMWare vSphere.
// - OPENSHIFT: OpenShift.
//
// swagger:model vmware.tanzu.manage.v1alpha1.common.cluster.InfrastructureProvider
/*
- INFRASTRUCTURE_PROVIDER_UNSPECIFIED: Unspecified infrastructure provider (default).
- INFRASTRUCTURE_PROVIDER_NONE: No cloud provider (likely bare metal).
- AWS_EC2: AmazonWeb Services EC2.
- GCP_GCE: Google Cloud.
- AZURE_COMPUTE: Azure Compute.
- VMWARE_VSPHERE: VMWare vSphere.
- OPENSHIFT: OpenShift.
swagger:model vmware.tanzu.manage.v1alpha1.common.cluster.InfrastructureProvider
*/
type VmwareTanzuManageV1alpha1CommonClusterInfrastructureProvider string

func NewVmwareTanzuManageV1alpha1CommonClusterInfrastructureProvider(value VmwareTanzuManageV1alpha1CommonClusterInfrastructureProvider) *VmwareTanzuManageV1alpha1CommonClusterInfrastructureProvider {
Expand Down
15 changes: 8 additions & 7 deletions internal/models/cluster/k8s_provider_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
)

// VmwareTanzuManageV1alpha1CommonClusterKubernetesProviderType KubernetesProviderType definition - indicates the k8s provider Type.
//
// - KUBERNETES_PROVIDER_UNSPECIFIED: Unspecified k8s provider (default).
// - VMWARE_TANZU_KUBERNETES_GRID: VMware Tanzu Kubernetes Grid.
// - VMWARE_TANZU_KUBERNETES_GRID_SERVICE: VMware Tanzu Kubernetes Grid Service (Guest Cluster Management).
// - VMWARE_TANZU_KUBERNETES_GRID_HOSTED: VMware Tanzu Kubernetes Grid hosted in TMC.
//
// swagger:model vmware.tanzu.manage.v1alpha1.common.cluster.KubernetesProviderType
/*
- KUBERNETES_PROVIDER_UNSPECIFIED: Unspecified k8s provider (default).
- VMWARE_TANZU_KUBERNETES_GRID: VMware Tanzu Kubernetes Grid.
- VMWARE_TANZU_KUBERNETES_GRID_SERVICE: VMware Tanzu Kubernetes Grid Service (Guest Cluster Management).
- VMWARE_TANZU_KUBERNETES_GRID_HOSTED: VMware Tanzu Kubernetes Grid hosted in TMC.
swagger:model vmware.tanzu.manage.v1alpha1.common.cluster.KubernetesProviderType
*/
type VmwareTanzuManageV1alpha1CommonClusterKubernetesProviderType string

func NewVmwareTanzuManageV1alpha1CommonClusterKubernetesProviderType(value VmwareTanzuManageV1alpha1CommonClusterKubernetesProviderType) *VmwareTanzuManageV1alpha1CommonClusterKubernetesProviderType {
Expand Down
25 changes: 13 additions & 12 deletions internal/models/cluster/nodepool/nodepool_phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ package nodepool
import "encoding/json"

// VmwareTanzuManageV1alpha1ClusterNodepoolStatusPhase Phase of the nodepool resource.
//
// - PHASE_UNSPECIFIED: Unspecified phase.
// - CREATING: Resource is pending processing.
// - READY: Resource is in ready state.
// - ERROR: Error in processing.
// - DELETING: Resource is being deleted.
// - RESIZING: Resizing state.
// - UPGRADING: An upgrade is in progress.
// - UPGRADE_FAILED: An upgrade has failed.
// - WAITING: The cluster is not created yet. so wait till then.
//
// swagger:model vmware.tanzu.manage.v1alpha1.cluster.nodepool.Status.Phase
/*
- PHASE_UNSPECIFIED: Unspecified phase.
- CREATING: Resource is pending processing.
- READY: Resource is in ready state.
- ERROR: Error in processing.
- DELETING: Resource is being deleted.
- RESIZING: Resizing state.
- UPGRADING: An upgrade is in progress.
- UPGRADE_FAILED: An upgrade has failed.
- WAITING: The cluster is not created yet. so wait till then.
swagger:model vmware.tanzu.manage.v1alpha1.cluster.nodepool.Status.Phase
*/
type VmwareTanzuManageV1alpha1ClusterNodepoolStatusPhase string

func NewVmwareTanzuManageV1alpha1ClusterNodepoolStatusPhase(value VmwareTanzuManageV1alpha1ClusterNodepoolStatusPhase) *VmwareTanzuManageV1alpha1ClusterNodepoolStatusPhase {
Expand Down
15 changes: 8 additions & 7 deletions internal/models/cluster/nodepool/nodepool_severity.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ package nodepool
import "encoding/json"

// VmwareTanzuCoreV1alpha1StatusConditionSeverity Severity expresses the severity of a Condition Type failing.
//
// - SEVERITY_UNSPECIFIED: Unspecified severity.
// - ERROR: Failure of a condition type should be viewed as an error.
// - WARNING: Failure of a condition type should be viewed as a warning, but that things could still work.
// - INFO: Failure of a condition type should be viewed as purely informational, and that things could still work.
//
// swagger:model vmware.tanzu.core.v1alpha1.status.Condition.Severity
/*
- SEVERITY_UNSPECIFIED: Unspecified severity.
- ERROR: Failure of a condition type should be viewed as an error.
- WARNING: Failure of a condition type should be viewed as a warning, but that things could still work.
- INFO: Failure of a condition type should be viewed as purely informational, and that things could still work.
swagger:model vmware.tanzu.core.v1alpha1.status.Condition.Severity
*/
type VmwareTanzuCoreV1alpha1StatusConditionSeverity string

func NewVmwareTanzuCoreV1alpha1StatusConditionSeverity(value VmwareTanzuCoreV1alpha1StatusConditionSeverity) *VmwareTanzuCoreV1alpha1StatusConditionSeverity {
Expand Down
13 changes: 7 additions & 6 deletions internal/models/cluster/nodepool/nodepools_condition_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ package nodepool
import "encoding/json"

// VmwareTanzuCoreV1alpha1StatusConditionStatus Status describes the state of condition.
//
// - STATUS_UNSPECIFIED: Controller is actively working to achieve the condition.
// - TRUE: Reconciliation has succeeded. Once all transition conditions have succeeded, the "happy state" condition should be set to True..
// - FALSE: Reconciliation has failed. This should be a terminal failure state until user action occurs.
//
// swagger:model vmware.tanzu.core.v1alpha1.status.Condition.Status
/*
- STATUS_UNSPECIFIED: Controller is actively working to achieve the condition.
- TRUE: Reconciliation has succeeded. Once all transition conditions have succeeded, the "happy state" condition should be set to True..
- FALSE: Reconciliation has failed. This should be a terminal failure state until user action occurs.
swagger:model vmware.tanzu.core.v1alpha1.status.Condition.Status
*/
type VmwareTanzuCoreV1alpha1StatusConditionStatus string

func NewVmwareTanzuCoreV1alpha1StatusConditionStatus(value VmwareTanzuCoreV1alpha1StatusConditionStatus) *VmwareTanzuCoreV1alpha1StatusConditionStatus {
Expand Down
27 changes: 14 additions & 13 deletions internal/models/cluster/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ import (
)

// VmwareTanzuManageV1alpha1ClusterPhase Phase of the cluster resource.
//
// - PHASE_UNSPECIFIED: Unspecified phase.
// - PENDING: Resource is pending processing.
// - PROCESSING: Processing the resource.
// - CREATING: Resource is being created.
// - READY: Resource is ready state.
// - DELETING: Resource is being deleted.
// - ERROR: Error in processing.
// - DETACHING: Resource is being detached.
// - UPGRADING: An upgrade is in progress.
// - UPGRADE_FAILED: An upgrade has failed.
//
// swagger:model vmware.tanzu.manage.v1alpha1.cluster.Phase
/*
- PHASE_UNSPECIFIED: Unspecified phase.
- PENDING: Resource is pending processing.
- PROCESSING: Processing the resource.
- CREATING: Resource is being created.
- READY: Resource is ready state.
- DELETING: Resource is being deleted.
- ERROR: Error in processing.
- DETACHING: Resource is being detached.
- UPGRADING: An upgrade is in progress.
- UPGRADE_FAILED: An upgrade has failed.
swagger:model vmware.tanzu.manage.v1alpha1.cluster.Phase
*/
type VmwareTanzuManageV1alpha1ClusterPhase string

func NewVmwareTanzuManageV1alpha1ClusterPhase(value VmwareTanzuManageV1alpha1ClusterPhase) *VmwareTanzuManageV1alpha1ClusterPhase {
Expand Down
19 changes: 10 additions & 9 deletions internal/models/namespace/status_phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ import (
)

// VmwareTanzuManageV1alpha1ClusterNamespaceStatusPhase The overall phase of the namespace.
//
// - PHASE_UNSPECIFIED: Phase_unspecified is the default phase
// - CREATING: Creating phase is set when the namespace is being created.
// - ATTACHING: Attaching phase is set when the namespace is being attached.
// - UPDATING: Updating phase is set when the namespace is being updated.
// - READY: Ready phase is set when the namespace is successfully created/attached/updated.
// - ERROR: Error phase is set when there was a failure while creating/attaching/updating the namespace.
//
// swagger:model vmware.tanzu.manage.v1alpha1.cluster.namespace.Status.Phase
/*
- PHASE_UNSPECIFIED: Phase_unspecified is the default phase
- CREATING: Creating phase is set when the namespace is being created.
- ATTACHING: Attaching phase is set when the namespace is being attached.
- UPDATING: Updating phase is set when the namespace is being updated.
- READY: Ready phase is set when the namespace is successfully created/attached/updated.
- ERROR: Error phase is set when there was a failure while creating/attaching/updating the namespace.
swagger:model vmware.tanzu.manage.v1alpha1.cluster.namespace.Status.Phase
*/
type VmwareTanzuManageV1alpha1ClusterNamespaceStatusPhase string

func NewVmwareTanzuManageV1alpha1ClusterNamespaceStatusPhase(value VmwareTanzuManageV1alpha1ClusterNamespaceStatusPhase) *VmwareTanzuManageV1alpha1ClusterNamespaceStatusPhase {
Expand Down

0 comments on commit a1f8166

Please sign in to comment.