From d18246c2a9e0dc43f8370e167fc420c6b9599364 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Fri, 24 Jan 2025 13:50:26 -0800 Subject: [PATCH] refactor --- cmd/ucpd/ucp-dev.yaml | 2 +- pkg/cli/clients/clients.go | 2 +- pkg/cli/clients/management.go | 8 ++++---- test/functional-portable/corerp/noncloud/api_test.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/ucpd/ucp-dev.yaml b/cmd/ucpd/ucp-dev.yaml index 8435f96ff5..ae0da2ff5e 100644 --- a/cmd/ucpd/ucp-dev.yaml +++ b/cmd/ucpd/ucp-dev.yaml @@ -53,7 +53,7 @@ initialization: Microsoft.Resources: "http://localhost:5017" kind: "UCPNative" # This is the directory location which contains manifests to be registered. - manifestDirectory: "/Users/nithya/external/radius/radius/deploy/manifest/built-in-providers/dev" + manifestDirectory: "manifest/built-in-providers/" identity: authMethod: default diff --git a/pkg/cli/clients/clients.go b/pkg/cli/clients/clients.go index 4df9f35b5e..8b9d9661a6 100644 --- a/pkg/cli/clients/clients.go +++ b/pkg/cli/clients/clients.go @@ -240,7 +240,7 @@ type ApplicationsManagementClient interface { DeleteResourceType(ctx context.Context, planeName string, providerNamespace string, resourceTypeName string) (bool, error) // ListResourceTypesNames lists the names of all resource types in the configured scope. - ListAllResourceTypesNames(ctx context.Context) ([]string, error) + ListAllResourceTypesNames(ctx context.Context, planeName string) ([]string, error) // CreateOrUpdateAPIVersion creates or updates an API version in the configured scope. CreateOrUpdateAPIVersion(ctx context.Context, planeName string, providerNamespace string, resourceTypeName string, apiVersionName string, resource *ucp_v20231001preview.APIVersionResource) (ucp_v20231001preview.APIVersionResource, error) diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index d2e5a09733..4bc0937117 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -774,8 +774,8 @@ func (amc *UCPApplicationsManagementClient) GetResourceProviderSummary(ctx conte } // ListAllResourceTypes lists all resource types in all resource providers in the configured scope. -func (amc *UCPApplicationsManagementClient) ListAllResourceTypesNames(ctx context.Context) ([]string, error) { - resourceProviderSummaries, err := amc.ListResourceProviderSummaries(ctx, "local") +func (amc *UCPApplicationsManagementClient) ListAllResourceTypesNames(ctx context.Context, planeName string) ([]string, error) { + resourceProviderSummaries, err := amc.ListResourceProviderSummaries(ctx, planeName) if err != nil { return []string{}, err } @@ -801,7 +801,7 @@ func (amc *UCPApplicationsManagementClient) ListResourcesInApplication(ctx conte return nil, err } - ResourceTypesList, err := amc.ListAllResourceTypesNames(ctx) + ResourceTypesList, err := amc.ListAllResourceTypesNames(ctx, "local") if err != nil { return nil, err } @@ -827,7 +827,7 @@ func (amc *UCPApplicationsManagementClient) ListResourcesInEnvironment(ctx conte } results := []generated.GenericResource{} - ResourceTypesList, err := amc.ListAllResourceTypesNames(ctx) + ResourceTypesList, err := amc.ListAllResourceTypesNames(ctx, "local") for _, resourceType := range ResourceTypesList { resources, err := amc.ListResourcesOfTypeInEnvironment(ctx, environmentID, resourceType) if err != nil { diff --git a/test/functional-portable/corerp/noncloud/api_test.go b/test/functional-portable/corerp/noncloud/api_test.go index 426f61f799..5d027164b1 100644 --- a/test/functional-portable/corerp/noncloud/api_test.go +++ b/test/functional-portable/corerp/noncloud/api_test.go @@ -49,7 +49,7 @@ func Test_ResourceList(t *testing.T) { resourceGroupScope := parsed.String() - resourceTypesList, err := options.ManagementClient.(*clients.UCPApplicationsManagementClient).ListAllResourceTypesNames(context.Background()) + resourceTypesList, err := options.ManagementClient.(*clients.UCPApplicationsManagementClient).ListAllResourceTypesNames(context.Background(), "local") require.NoError(t, err) resourceTypes := []string{"Applications.Core/applications", "Applications.Core/environments"} resourceTypes = append(resourceTypes, resourceTypesList...)