Skip to content

Commit

Permalink
Apply first smaller nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ammujumdar-bcom committed Oct 21, 2024
1 parent 4e46542 commit 02d4772
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -50,7 +50,7 @@ func unitTestsReconcile() {
wcr *vmopv1a1.WebConsoleRequest
vm *vmopv1a1.VirtualMachine
proxySvc *corev1.Service
proxySvcDNS *vmw_v1alpha1.SupervisorProperties
proxySvcDNS *appv1a1.SupervisorProperties
)

BeforeEach(func() {
Expand Down Expand Up @@ -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,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -45,7 +45,7 @@ func unitTestsReconcile() {
wcr *vmopv1.VirtualMachineWebConsoleRequest
vm *vmopv1.VirtualMachine
proxySvc *corev1.Service
proxySvcDNS *vmw_v1alpha1.SupervisorProperties
proxySvcDNS *appv1a1.SupervisorProperties
)

BeforeEach(func() {
Expand Down Expand Up @@ -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,
},
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions test/builder/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -72,7 +72,7 @@ func KnownObjectTypes() []client.Object {
&vpcv1alpha1.SubnetPort{},
&byokv1.EncryptionClass{},
&capv1.Capabilities{},
&vmw_v1alpha1.SupervisorProperties{},
&appv1a1.SupervisorProperties{},
}
}

Expand All @@ -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)
Expand Down

0 comments on commit 02d4772

Please sign in to comment.