Skip to content

Commit

Permalink
Merge pull request #2529 from mboersma/importas
Browse files Browse the repository at this point in the history
Standardize more package import aliases
  • Loading branch information
k8s-ci-robot authored Aug 4, 2022
2 parents ade627d + 9428cc0 commit e5a03e7
Show file tree
Hide file tree
Showing 43 changed files with 437 additions and 409 deletions.
28 changes: 28 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@ linters-settings:
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime
alias: ctrl
# CAPI
- pkg: sigs.k8s.io/cluster-api/api/v1alpha3
alias: clusterv1alpha3
- pkg: sigs.k8s.io/cluster-api/api/v1alpha4
alias: clusterv1alpha4
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
alias: clusterv1
# CAPI exp
- pkg: sigs.k8s.io/cluster-api/exp/api/v1alpha3
alias: expv1alpha3
- pkg: sigs.k8s.io/cluster-api/exp/api/v1alpha4
alias: expv1alpha4
- pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1
alias: expv1
# CAPZ
- pkg: sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3
alias: infrav1alpha3
- pkg: sigs.k8s.io/cluster-api-provider-azure/api/v1alpha4
alias: infrav1alpha4
- pkg: sigs.k8s.io/cluster-api-provider-azure/api/v1beta1
alias: infrav1
# CAPZ exp
- pkg: sigs.k8s.io/cluster-api-provider-azure/exp/api/v1alpha3
alias: infrav1alpha3exp
- pkg: sigs.k8s.io/cluster-api-provider-azure/exp/api/v1alpha4
alias: infrav1alpha4exp
- pkg: sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1
alias: infrav1exp
godot:
# declarations - for top level declaration comments (default);
# toplevel - for top level comments;
Expand Down
12 changes: 6 additions & 6 deletions api/v1alpha3/azurecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha3
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"
)

const (
Expand All @@ -46,7 +46,7 @@ type AzureClusterSpec struct {

// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
// +optional
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
ControlPlaneEndpoint clusterv1alpha3.APIEndpoint `json:"controlPlaneEndpoint"`

// AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the
// ones added by default.
Expand All @@ -66,15 +66,15 @@ type AzureClusterStatus struct {
// the cluster is more resilient to failure.
// See: https://docs.microsoft.com/en-us/azure/availability-zones/az-overview
// This list will be used by Cluster API to try and spread the machines across the failure domains.
FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"`
FailureDomains clusterv1alpha3.FailureDomains `json:"failureDomains,omitempty"`

// Ready is true when the provider resource is ready.
// +optional
Ready bool `json:"ready"`

// Conditions defines current service state of the AzureCluster.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -106,12 +106,12 @@ type AzureClusterList struct {
}

// GetConditions returns the list of conditions for an AzureCluster API object.
func (c *AzureCluster) GetConditions() clusterv1.Conditions {
func (c *AzureCluster) GetConditions() clusterv1alpha3.Conditions {
return c.Status.Conditions
}

// SetConditions will set the given conditions on an AzureCluster object.
func (c *AzureCluster) SetConditions(conditions clusterv1.Conditions) {
func (c *AzureCluster) SetConditions(conditions clusterv1alpha3.Conditions) {
c.Status.Conditions = conditions
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha3/azureclusteridentity_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha3
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"
)

// AzureClusterIdentitySpec defines the parameters that are used to create an AzureIdentity.
Expand Down Expand Up @@ -50,7 +50,7 @@ type AzureClusterIdentitySpec struct {
type AzureClusterIdentityStatus struct {
// Conditions defines current service state of the AzureClusterIdentity.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
Expand All @@ -76,12 +76,12 @@ type AzureClusterIdentityList struct {
}

// GetConditions returns the list of conditions for an AzureClusterIdentity API object.
func (c *AzureClusterIdentity) GetConditions() clusterv1.Conditions {
func (c *AzureClusterIdentity) GetConditions() clusterv1alpha3.Conditions {
return c.Status.Conditions
}

// SetConditions will set the given conditions on an AzureClusterIdentity object.
func (c *AzureClusterIdentity) SetConditions(conditions clusterv1.Conditions) {
func (c *AzureClusterIdentity) SetConditions(conditions clusterv1alpha3.Conditions) {
c.Status.Conditions = conditions
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha3/azuremachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"
"sigs.k8s.io/cluster-api/errors"
)

Expand Down Expand Up @@ -176,7 +176,7 @@ type AzureMachineStatus struct {

// Conditions defines current service state of the AzureMachine.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -208,12 +208,12 @@ type AzureMachineList struct {
}

// GetConditions returns the list of conditions for an AzureMachine API object.
func (m *AzureMachine) GetConditions() clusterv1.Conditions {
func (m *AzureMachine) GetConditions() clusterv1alpha3.Conditions {
return m.Status.Conditions
}

// SetConditions will set the given conditions on an AzureMachine object.
func (m *AzureMachine) SetConditions(conditions clusterv1.Conditions) {
func (m *AzureMachine) SetConditions(conditions clusterv1alpha3.Conditions) {
m.Status.Conditions = conditions
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha3/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

package v1alpha3

import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
import clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"

// AzureCluster Conditions and Reasons.
const (
Expand All @@ -33,7 +33,7 @@ const (
// AzureMachine Conditions and Reasons.
const (
// VMRunningCondition reports on current status of the Azure VM.
VMRunningCondition clusterv1.ConditionType = "VMRunning"
VMRunningCondition clusterv1alpha3.ConditionType = "VMRunning"
// VMNCreatingReason used when the vm creation is in progress.
VMNCreatingReason = "VMCreating"
// VMNUpdatingReason used when the vm updating is in progress.
Expand Down
12 changes: 6 additions & 6 deletions api/v1alpha4/azurecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha4
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
)

const (
Expand All @@ -46,7 +46,7 @@ type AzureClusterSpec struct {

// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
// +optional
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
ControlPlaneEndpoint clusterv1alpha4.APIEndpoint `json:"controlPlaneEndpoint"`

// AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the
// ones added by default.
Expand Down Expand Up @@ -87,15 +87,15 @@ type AzureClusterStatus struct {
// the cluster is more resilient to failure.
// See: https://docs.microsoft.com/en-us/azure/availability-zones/az-overview
// This list will be used by Cluster API to try and spread the machines across the failure domains.
FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"`
FailureDomains clusterv1alpha4.FailureDomains `json:"failureDomains,omitempty"`

// Ready is true when the provider resource is ready.
// +optional
Ready bool `json:"ready"`

// Conditions defines current service state of the AzureCluster.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"`

// LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the
// next reconciliation loop.
Expand Down Expand Up @@ -134,12 +134,12 @@ type AzureClusterList struct {
}

// GetConditions returns the list of conditions for an AzureCluster API object.
func (c *AzureCluster) GetConditions() clusterv1.Conditions {
func (c *AzureCluster) GetConditions() clusterv1alpha4.Conditions {
return c.Status.Conditions
}

// SetConditions will set the given conditions on an AzureCluster object.
func (c *AzureCluster) SetConditions(conditions clusterv1.Conditions) {
func (c *AzureCluster) SetConditions(conditions clusterv1alpha4.Conditions) {
c.Status.Conditions = conditions
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha4/azureclusteridentity_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha4
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
)

// AllowedNamespaces defines the namespaces the clusters are allowed to use the identity from
Expand Down Expand Up @@ -70,7 +70,7 @@ type AzureClusterIdentitySpec struct {
type AzureClusterIdentityStatus struct {
// Conditions defines current service state of the AzureClusterIdentity.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
Expand All @@ -96,12 +96,12 @@ type AzureClusterIdentityList struct {
}

// GetConditions returns the list of conditions for an AzureClusterIdentity API object.
func (c *AzureClusterIdentity) GetConditions() clusterv1.Conditions {
func (c *AzureClusterIdentity) GetConditions() clusterv1alpha4.Conditions {
return c.Status.Conditions
}

// SetConditions will set the given conditions on an AzureClusterIdentity object.
func (c *AzureClusterIdentity) SetConditions(conditions clusterv1.Conditions) {
func (c *AzureClusterIdentity) SetConditions(conditions clusterv1alpha4.Conditions) {
c.Status.Conditions = conditions
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha4/azuremachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
"sigs.k8s.io/cluster-api/errors"
)

Expand Down Expand Up @@ -174,7 +174,7 @@ type AzureMachineStatus struct {

// Conditions defines current service state of the AzureMachine.
// +optional
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"`

// LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the
// next reconciliation loop.
Expand Down Expand Up @@ -211,12 +211,12 @@ type AzureMachineList struct {
}

// GetConditions returns the list of conditions for an AzureMachine API object.
func (m *AzureMachine) GetConditions() clusterv1.Conditions {
func (m *AzureMachine) GetConditions() clusterv1alpha4.Conditions {
return m.Status.Conditions
}

// SetConditions will set the given conditions on an AzureMachine object.
func (m *AzureMachine) SetConditions(conditions clusterv1.Conditions) {
func (m *AzureMachine) SetConditions(conditions clusterv1alpha4.Conditions) {
m.Status.Conditions = conditions
}

Expand Down
38 changes: 19 additions & 19 deletions api/v1alpha4/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ limitations under the License.

package v1alpha4

import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"

// AzureCluster Conditions and Reasons.
const (
// NetworkInfrastructureReadyCondition reports of current status of cluster infrastructure.
NetworkInfrastructureReadyCondition clusterv1.ConditionType = "NetworkInfrastructureReady"
NetworkInfrastructureReadyCondition clusterv1alpha4.ConditionType = "NetworkInfrastructureReady"
// NamespaceNotAllowedByIdentity used to indicate cluster in a namespace not allowed by identity.
NamespaceNotAllowedByIdentity = "NamespaceNotAllowedByIdentity"
)

// AzureMachine Conditions and Reasons.
const (
// VMRunningCondition reports on current status of the Azure VM.
VMRunningCondition clusterv1.ConditionType = "VMRunning"
VMRunningCondition clusterv1alpha4.ConditionType = "VMRunning"
// VMCreatingReason used when the vm creation is in progress.
VMCreatingReason = "VMCreating"
// VMUpdatingReason used when the vm updating is in progress.
Expand All @@ -53,7 +53,7 @@ const (
// AzureMachinePool Conditions and Reasons.
const (
// ScaleSetRunningCondition reports on current status of the Azure Scale Set.
ScaleSetRunningCondition clusterv1.ConditionType = "ScaleSetRunning"
ScaleSetRunningCondition clusterv1alpha4.ConditionType = "ScaleSetRunning"
// ScaleSetCreatingReason used when the scale set creation is in progress.
ScaleSetCreatingReason = "ScaleSetCreating"
// ScaleSetUpdatingReason used when the scale set updating is in progress.
Expand All @@ -64,46 +64,46 @@ const (
ScaleSetProvisionFailedReason = "ScaleSetProvisionFailed"

// ScaleSetDesiredReplicasCondition reports on the scaling state of the machine pool.
ScaleSetDesiredReplicasCondition clusterv1.ConditionType = "ScaleSetDesiredReplicas"
ScaleSetDesiredReplicasCondition clusterv1alpha4.ConditionType = "ScaleSetDesiredReplicas"
// ScaleSetScaleUpReason describes the machine pool scaling up.
ScaleSetScaleUpReason = "ScaleSetScalingUp"
// ScaleSetScaleDownReason describes the machine pool scaling down.
ScaleSetScaleDownReason = "ScaleSetScalingDown"

// ScaleSetModelUpdatedCondition reports on the model state of the pool.
ScaleSetModelUpdatedCondition clusterv1.ConditionType = "ScaleSetModelUpdated"
ScaleSetModelUpdatedCondition clusterv1alpha4.ConditionType = "ScaleSetModelUpdated"
// ScaleSetModelOutOfDateReason describes the machine pool model being out of date.
ScaleSetModelOutOfDateReason = "ScaleSetModelOutOfDate"
)

// Azure Services Conditions and Reasons.
const (
// ResourceGroupReadyCondition means the resource group exists and is ready to be used.
ResourceGroupReadyCondition clusterv1.ConditionType = "ResourceGroupReady"
ResourceGroupReadyCondition clusterv1alpha4.ConditionType = "ResourceGroupReady"
// VNetReadyCondition means the virtual network exists and is ready to be used.
VNetReadyCondition clusterv1.ConditionType = "VNetReady"
VNetReadyCondition clusterv1alpha4.ConditionType = "VNetReady"
// SecurityGroupsReadyCondition means the security groups exist and are ready to be used.
SecurityGroupsReadyCondition clusterv1.ConditionType = "SecurityGroupsReady"
SecurityGroupsReadyCondition clusterv1alpha4.ConditionType = "SecurityGroupsReady"
// RouteTablesReadyCondition means the route tables exist and are ready to be used.
RouteTablesReadyCondition clusterv1.ConditionType = "RouteTablesReady"
RouteTablesReadyCondition clusterv1alpha4.ConditionType = "RouteTablesReady"
// PublicIPsReadyCondition means the public IPs exist and are ready to be used.
PublicIPsReadyCondition clusterv1.ConditionType = "PublicIPsReady"
PublicIPsReadyCondition clusterv1alpha4.ConditionType = "PublicIPsReady"
// NATGatewaysReadyCondition means the NAT gateways exist and are ready to be used.
NATGatewaysReadyCondition clusterv1.ConditionType = "NATGatewaysReady"
NATGatewaysReadyCondition clusterv1alpha4.ConditionType = "NATGatewaysReady"
// SubnetsReadyCondition means the subnets exist and are ready to be used.
SubnetsReadyCondition clusterv1.ConditionType = "SubnetsReady"
SubnetsReadyCondition clusterv1alpha4.ConditionType = "SubnetsReady"
// LoadBalancersReadyCondition means the load balancers exist and are ready to be used.
LoadBalancersReadyCondition clusterv1.ConditionType = "LoadBalancersReady"
LoadBalancersReadyCondition clusterv1alpha4.ConditionType = "LoadBalancersReady"
// PrivateDNSReadyCondition means the private DNS exists and is ready to be used.
PrivateDNSReadyCondition clusterv1.ConditionType = "PrivateDNSReady"
PrivateDNSReadyCondition clusterv1alpha4.ConditionType = "PrivateDNSReady"
// BastionHostReadyCondition means the bastion host exists and is ready to be used.
BastionHostReadyCondition clusterv1.ConditionType = "BastionHostReady"
BastionHostReadyCondition clusterv1alpha4.ConditionType = "BastionHostReady"
// InboundNATRulesReadyCondition means the inbound NAT rules exist and are ready to be used.
InboundNATRulesReadyCondition clusterv1.ConditionType = "InboundNATRulesReady"
InboundNATRulesReadyCondition clusterv1alpha4.ConditionType = "InboundNATRulesReady"
// AvailabilitySetReadyCondition means the availability set exists and is ready to be used.
AvailabilitySetReadyCondition clusterv1.ConditionType = "AvailabilitySetReady"
AvailabilitySetReadyCondition clusterv1alpha4.ConditionType = "AvailabilitySetReady"
// RoleAssignmentReadyCondition means the role assignment exists and is ready to be used.
RoleAssignmentReadyCondition clusterv1.ConditionType = "RoleAssignmentReady"
RoleAssignmentReadyCondition clusterv1alpha4.ConditionType = "RoleAssignmentReady"

// CreatingReason means the resource is being created.
CreatingReason = "Creating"
Expand Down
Loading

0 comments on commit e5a03e7

Please sign in to comment.