diff --git a/Makefile b/Makefile index 9fb6226f8..f7ceee32b 100644 --- a/Makefile +++ b/Makefile @@ -323,7 +323,7 @@ generate-go: ## Generate golang sources $(CONTROLLER_GEN) \ paths=github.com/vmware-tanzu/vm-operator/external/appplatform/... \ object:headerFile=./hack/boilerplate/boilerplate.generatego.txt -# $(MAKE) -C ./pkg/util/cloudinit/schema $@ + $(MAKE) -C ./pkg/util/cloudinit/schema $@ .PHONY: generate-manifests generate-manifests: $(CONTROLLER_GEN) diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go index ec547a163..cf7b4d345 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go @@ -232,7 +232,6 @@ func (r *Reconciler) ProxyAddress(ctx *pkgctx.WebConsoleRequestContext) (string, // Attempt to use the API Server DNS Names to get the proxy address. proxyAddress, err := webconsoleurl.ProxyServiceDNSName(ctx, r) - if err != nil { return "", fmt.Errorf("failed to get proxy service URL: %w", err) } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go index 6bc84b514..37f1fd82d 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go @@ -17,7 +17,7 @@ import ( vmopv1a1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1" - "github.com/vmware-tanzu/vm-operator/external/appplatform/api/vmw_v1alpha1" + appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1" pkgcfg "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" pkgctx "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -50,7 +50,7 @@ func unitTestsReconcile() { wcr *vmopv1a1.WebConsoleRequest vm *vmopv1a1.VirtualMachine proxySvc *corev1.Service - proxySvcDNS *vmw_v1alpha1.SupervisorProperties + proxySvcDNS *appv1a1.SupervisorProperties ) BeforeEach(func() { @@ -182,12 +182,12 @@ func unitTestsReconcile() { for _, scenario := range scenarios { When(scenario.name, func() { JustBeforeEach(func() { - proxySvcDNS = &vmw_v1alpha1.SupervisorProperties{ + proxySvcDNS = &appv1a1.SupervisorProperties{ ObjectMeta: metav1.ObjectMeta{ Name: webconsoleurl.SupervisorServiceObjName, Namespace: webconsoleurl.SupervisorServiceObjNamespace, }, - Spec: vmw_v1alpha1.SupervisorPropertiesSpec{ + Spec: appv1a1.SupervisorPropertiesSpec{ APIServerDNSNames: scenario.apiServerDNSName, }, } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go index 22c227b5a..4b21cdb96 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go @@ -224,7 +224,6 @@ func (r *Reconciler) ProxyAddress(ctx *pkgctx.WebConsoleRequestContextV1) (strin // Attempt to use the API Server DNS Names to get the proxy address. proxyAddress, err := webconsoleurl.ProxyServiceDNSName(ctx, r) - if err != nil { return "", fmt.Errorf("failed to get proxy service URL: %w", err) } diff --git a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go index 9eca700a9..a03e5dd53 100644 --- a/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go +++ b/controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_unit_test.go @@ -16,7 +16,7 @@ import ( vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3" webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2" - "github.com/vmware-tanzu/vm-operator/external/appplatform/api/vmw_v1alpha1" + appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1" pkgcfg "github.com/vmware-tanzu/vm-operator/pkg/config" "github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels" pkgctx "github.com/vmware-tanzu/vm-operator/pkg/context" @@ -45,7 +45,7 @@ func unitTestsReconcile() { wcr *vmopv1.VirtualMachineWebConsoleRequest vm *vmopv1.VirtualMachine proxySvc *corev1.Service - proxySvcDNS *vmw_v1alpha1.SupervisorProperties + proxySvcDNS *appv1a1.SupervisorProperties ) BeforeEach(func() { @@ -172,12 +172,12 @@ func unitTestsReconcile() { for _, scenario := range scenarios { When(scenario.name, func() { JustBeforeEach(func() { - proxySvcDNS = &vmw_v1alpha1.SupervisorProperties{ + proxySvcDNS = &appv1a1.SupervisorProperties{ ObjectMeta: metav1.ObjectMeta{ Name: webconsoleurl.SupervisorServiceObjName, Namespace: webconsoleurl.SupervisorServiceObjNamespace, }, - Spec: vmw_v1alpha1.SupervisorPropertiesSpec{ + Spec: appv1a1.SupervisorPropertiesSpec{ APIServerDNSNames: scenario.apiServerDNSName, }, } diff --git a/external/appplatform/api/vmw_v1alpha1/doc.go b/external/appplatform/api/v1alpha1/doc.go similarity index 100% rename from external/appplatform/api/vmw_v1alpha1/doc.go rename to external/appplatform/api/v1alpha1/doc.go diff --git a/external/appplatform/api/vmw_v1alpha1/register.go b/external/appplatform/api/v1alpha1/register.go similarity index 100% rename from external/appplatform/api/vmw_v1alpha1/register.go rename to external/appplatform/api/v1alpha1/register.go diff --git a/external/appplatform/api/vmw_v1alpha1/supervisorprops_types.go b/external/appplatform/api/v1alpha1/supervisorprops_types.go similarity index 100% rename from external/appplatform/api/vmw_v1alpha1/supervisorprops_types.go rename to external/appplatform/api/v1alpha1/supervisorprops_types.go diff --git a/external/appplatform/api/vmw_v1alpha1/zz_generated.deepcopy.go b/external/appplatform/api/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from external/appplatform/api/vmw_v1alpha1/zz_generated.deepcopy.go rename to external/appplatform/api/v1alpha1/zz_generated.deepcopy.go diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index a5eddd5d9..c720c9607 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -22,7 +22,7 @@ import ( vpcv1alpha1 "github.com/vmware-tanzu/nsx-operator/pkg/apis/vpc/v1alpha1" netopv1alpha1 "github.com/vmware-tanzu/net-operator-api/api/v1alpha1" - vmw_v1alpha1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/vmw_v1alpha1" + appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1" byokv1 "github.com/vmware-tanzu/vm-operator/external/byok/api/v1alpha1" capv1 "github.com/vmware-tanzu/vm-operator/external/capabilities/api/v1alpha1" ncpv1alpha1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" @@ -61,7 +61,7 @@ func New(ctx context.Context, opts Options) (Manager, error) { _ = spqv1.AddToScheme(opts.Scheme) _ = byokv1.AddToScheme(opts.Scheme) _ = capv1.AddToScheme(opts.Scheme) - _ = vmw_v1alpha1.AddToScheme(opts.Scheme) + _ = appv1a1.AddToScheme(opts.Scheme) _ = vmopv1a1.AddToScheme(opts.Scheme) _ = vmopv1a2.AddToScheme(opts.Scheme) diff --git a/pkg/webconsoleurl/lookup.go b/pkg/webconsoleurl/url_lookup.go similarity index 87% rename from pkg/webconsoleurl/lookup.go rename to pkg/webconsoleurl/url_lookup.go index 58a2f8a8f..771e86880 100644 --- a/pkg/webconsoleurl/lookup.go +++ b/pkg/webconsoleurl/url_lookup.go @@ -6,7 +6,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/vmware-tanzu/vm-operator/external/appplatform/api/vmw_v1alpha1" + appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1" ) const ( @@ -17,7 +17,7 @@ const ( // ProxyServiceDNSName retrieves the first API server DNS name using the provided client by // querying the appplatform CRD, if one exists. func ProxyServiceDNSName(ctx context.Context, r client.Client) (string, error) { - proxySvc := &vmw_v1alpha1.SupervisorProperties{} + proxySvc := &appv1a1.SupervisorProperties{} proxySvcObjectKey := client.ObjectKey{Name: SupervisorServiceObjName, Namespace: SupervisorServiceObjNamespace} err := r.Get(ctx, proxySvcObjectKey, proxySvc) diff --git a/test/builder/fake.go b/test/builder/fake.go index 2632ef5b4..d0e1b2f1e 100644 --- a/test/builder/fake.go +++ b/test/builder/fake.go @@ -15,7 +15,7 @@ import ( netopv1alpha1 "github.com/vmware-tanzu/net-operator-api/api/v1alpha1" vpcv1alpha1 "github.com/vmware-tanzu/nsx-operator/pkg/apis/vpc/v1alpha1" - "github.com/vmware-tanzu/vm-operator/external/appplatform/api/vmw_v1alpha1" + appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1" byokv1 "github.com/vmware-tanzu/vm-operator/external/byok/api/v1alpha1" capv1 "github.com/vmware-tanzu/vm-operator/external/capabilities/api/v1alpha1" ncpv1alpha1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" @@ -72,7 +72,7 @@ func KnownObjectTypes() []client.Object { &vpcv1alpha1.SubnetPort{}, &byokv1.EncryptionClass{}, &capv1.Capabilities{}, - &vmw_v1alpha1.SupervisorProperties{}, + &appv1a1.SupervisorProperties{}, } } @@ -90,7 +90,7 @@ func NewScheme() *runtime.Scheme { _ = vmopv1.AddToScheme(scheme) _ = capv1.AddToScheme(scheme) _ = byokv1.AddToScheme(scheme) - _ = vmw_v1alpha1.AddToScheme(scheme) + _ = appv1a1.AddToScheme(scheme) _ = ncpv1alpha1.AddToScheme(scheme) _ = cnsapis.AddToScheme(scheme) _ = spqv1.AddToScheme(scheme)