From c408ab923756126b08306b6ff0bcd92e3ccc4f94 Mon Sep 17 00:00:00 2001 From: lakshmimsft Date: Fri, 10 Jan 2025 00:35:28 -0800 Subject: [PATCH] enable register manifest Signed-off-by: lakshmimsft --- build/docker.mk | 18 +++++-- cmd/ucpd/ucp-dev.yaml | 2 +- deploy/Chart/templates/ucp/configmaps.yaml | 2 +- deploy/images/ucpd/Dockerfile | 3 ++ .../dev/applications_core.yaml | 4 +- .../dev/applications_dapr.yaml | 4 +- .../dev/applications_datastores.yaml | 4 +- .../dev/applications_messaging.yaml | 4 +- .../dev/microsoft_resources.yaml | 8 +-- .../self-hosted/applications_core.yaml | 6 +-- .../self-hosted/applications_dapr.yaml | 12 ++--- .../self-hosted/applications_datastores.yaml | 10 ++-- .../self-hosted/applications_messaging.yaml | 6 +-- .../self-hosted/microsoft_resources.yaml | 8 +-- .../create/testdata/valid.yaml | 3 ++ .../resourcetype/create/testdata/valid.yaml | 4 +- pkg/cli/manifest/manifest.go | 3 ++ pkg/cli/manifest/manifest_test.go | 3 ++ pkg/cli/manifest/registermanifest.go | 49 ++++++++++++++++--- .../testdata/missing-required-field.json | 2 +- .../resourceprovider-valid2.yaml | 3 ++ pkg/cli/manifest/testdata/valid.yaml | 3 ++ .../trackedresourceprocess_test.go | 1 - .../frontend/controller/radius/proxy_test.go | 1 - pkg/ucp/integrationtests/radius/proxy_test.go | 10 ++-- .../manifests/resourceprovider-valid1.yaml | 3 ++ .../ucp/noncloud/resourceprovider_test.go | 2 +- 27 files changed, 123 insertions(+), 55 deletions(-) diff --git a/build/docker.mk b/build/docker.mk index 7adcdcaa6b..0fe2268b30 100644 --- a/build/docker.mk +++ b/build/docker.mk @@ -17,6 +17,7 @@ DOCKER_REGISTRY?=$(shell whoami) DOCKER_TAG_VERSION?=latest IMAGE_SRC?=https://github.com/radius-project/radius +MANIFEST_DIR?=deploy/manifest/built-in-providers/self-hosted ##@ Docker Images @@ -106,6 +107,17 @@ APPS_MAP := ucpd:./deploy/images/ucpd \ testrp:./test/testrp \ magpiego:./test/magpiego +# copy_manifests copies the manifests to the output directory +.PHONY: copy-manifests +copy-manifests: + @if [ ! -d "$(MANIFEST_DIR)" ] || [ -z "$$(ls -A $(MANIFEST_DIR))" ]; then \ + echo "MANIFEST_DIR '$(MANIFEST_DIR)' does not exist or is empty"; \ + exit 1; \ + fi + @mkdir -p $(OUT_DIR)/manifest/built-in-providers/ + @echo "Copying manifests from $(MANIFEST_DIR) to $(OUT_DIR)/manifest/built-in-providers/" + @cp -v $(MANIFEST_DIR)/* $(OUT_DIR)/manifest/built-in-providers/ + # Function to extract the name and the directory of the Dockerfile from the app string define parseApp $(eval NAME := $(shell echo $(1) | cut -d: -f1)) @@ -132,7 +144,7 @@ DOCKER_PUSH_MULTI_TARGETS := $(foreach APP,$(APPS_MAP),$(eval $(call parseApp,$( # targets to build development images .PHONY: docker-build -docker-build: $(DOCKER_BUILD_TARGETS) ## Builds all Docker images. +docker-build: copy-manifests $(DOCKER_BUILD_TARGETS) ## Builds all Docker images. .PHONY: docker-push docker-push: $(DOCKER_PUSH_TARGETS) ## Pushes all Docker images (without building). @@ -140,7 +152,7 @@ docker-push: $(DOCKER_PUSH_TARGETS) ## Pushes all Docker images (without buildin # targets to build and push multi arch images. If you run this target in your machine, # ensure you have qemu and buildx installed by running make configure-buildx. .PHONY: docker-multi-arch-build -docker-multi-arch-build: $(DOCKER_BUILD_MULTI_TARGETS) ## Builds all docker images for multiple architectures. +docker-multi-arch-build: copy-manifests $(DOCKER_BUILD_MULTI_TARGETS) ## Builds all docker images for multiple architectures. .PHONY: docker-multi-arch-push -docker-multi-arch-push: $(DOCKER_PUSH_MULTI_TARGETS) ## Pushes all docker images for multiple architectures after building. +docker-multi-arch-push: copy-manifests $(DOCKER_PUSH_MULTI_TARGETS) ## Pushes all docker images for multiple architectures after building. diff --git a/cmd/ucpd/ucp-dev.yaml b/cmd/ucpd/ucp-dev.yaml index ddabe6bb0b..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: "" + manifestDirectory: "manifest/built-in-providers/" identity: authMethod: default diff --git a/deploy/Chart/templates/ucp/configmaps.yaml b/deploy/Chart/templates/ucp/configmaps.yaml index 2047e006a8..4b29bfdb47 100644 --- a/deploy/Chart/templates/ucp/configmaps.yaml +++ b/deploy/Chart/templates/ucp/configmaps.yaml @@ -50,7 +50,7 @@ data: - id: "/planes/aws/aws" properties: kind: "AWS" - manifestDirectory: "" + manifestDirectory: "/manifest/built-in-providers" identity: authMethod: UCPCredential diff --git a/deploy/images/ucpd/Dockerfile b/deploy/images/ucpd/Dockerfile index 44ff6e5be3..b2243c39ad 100644 --- a/deploy/images/ucpd/Dockerfile +++ b/deploy/images/ucpd/Dockerfile @@ -10,6 +10,9 @@ WORKDIR / # Copy the application binary for the specified architecture COPY ./linux_${TARGETARCH:-amd64}/release/ucpd / +# Copy the manifest files for the built-in providers +COPY ./manifest/built-in-providers/ /manifest/built-in-providers/ + # Set the user to non-root (65532:65532 is the default non-root user in distroless) USER 65532:65532 diff --git a/deploy/manifest/built-in-providers/dev/applications_core.yaml b/deploy/manifest/built-in-providers/dev/applications_core.yaml index 6e8d34f65e..48fa2c996c 100644 --- a/deploy/manifest/built-in-providers/dev/applications_core.yaml +++ b/deploy/manifest/built-in-providers/dev/applications_core.yaml @@ -1,7 +1,7 @@ name: Applications.Core -locations: +location: global: - address: "http://localhost:8080" + "http://localhost:8080" types: containers: apiVersions: diff --git a/deploy/manifest/built-in-providers/dev/applications_dapr.yaml b/deploy/manifest/built-in-providers/dev/applications_dapr.yaml index 11cd13567e..57b4c9d6dc 100644 --- a/deploy/manifest/built-in-providers/dev/applications_dapr.yaml +++ b/deploy/manifest/built-in-providers/dev/applications_dapr.yaml @@ -1,7 +1,7 @@ name: Applications.Dapr -locations: +location: global: - address: "http://localhost:8080" + "http://localhost:8080" types: configurationStores: apiVersions: diff --git a/deploy/manifest/built-in-providers/dev/applications_datastores.yaml b/deploy/manifest/built-in-providers/dev/applications_datastores.yaml index 767ed81ca1..30c78a5641 100644 --- a/deploy/manifest/built-in-providers/dev/applications_datastores.yaml +++ b/deploy/manifest/built-in-providers/dev/applications_datastores.yaml @@ -1,7 +1,7 @@ name: Applications.Datastores -locations: +location: global: - address: "http://localhost:8080" + "http://localhost:8080" types: mongoDatabases: apiVersions: diff --git a/deploy/manifest/built-in-providers/dev/applications_messaging.yaml b/deploy/manifest/built-in-providers/dev/applications_messaging.yaml index 10db9242da..ba41b3a11b 100644 --- a/deploy/manifest/built-in-providers/dev/applications_messaging.yaml +++ b/deploy/manifest/built-in-providers/dev/applications_messaging.yaml @@ -1,7 +1,7 @@ name: Applications.Messaging -locations: +location: global: - address: "http://localhost:8080" + "http://localhost:8080" types: rabbitMQQueues: apiVersions: diff --git a/deploy/manifest/built-in-providers/dev/microsoft_resources.yaml b/deploy/manifest/built-in-providers/dev/microsoft_resources.yaml index f5f13a7b9f..e780319a1c 100644 --- a/deploy/manifest/built-in-providers/dev/microsoft_resources.yaml +++ b/deploy/manifest/built-in-providers/dev/microsoft_resources.yaml @@ -1,10 +1,12 @@ name: Microsoft.Resources -locations: +location: global: - address: "http://localhost:5017" + "http://localhost:5017" types: deployments: apiVersions: - "2023-10-01-preview": + "2020-10-01": schema: {} + "2022-09-01": + schema: {} capabilities: [] diff --git a/deploy/manifest/built-in-providers/self-hosted/applications_core.yaml b/deploy/manifest/built-in-providers/self-hosted/applications_core.yaml index 8700134816..e7038d710d 100644 --- a/deploy/manifest/built-in-providers/self-hosted/applications_core.yaml +++ b/deploy/manifest/built-in-providers/self-hosted/applications_core.yaml @@ -1,7 +1,7 @@ name: Applications.Core -locations: +location: global: - address: "http://applications-rp.radius-system:5443" + "http://applications-rp.radius-system:5443" types: containers: apiVersions: @@ -32,7 +32,7 @@ types: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] volumes: apiVersions: "2023-10-01-preview": diff --git a/deploy/manifest/built-in-providers/self-hosted/applications_dapr.yaml b/deploy/manifest/built-in-providers/self-hosted/applications_dapr.yaml index daaa4fd33d..01e0400565 100644 --- a/deploy/manifest/built-in-providers/self-hosted/applications_dapr.yaml +++ b/deploy/manifest/built-in-providers/self-hosted/applications_dapr.yaml @@ -1,25 +1,25 @@ name: Applications.Dapr -locations: +location: global: - address: "http://applications-rp.radius-system:5443" + "http://applications-rp.radius-system:5443" types: configurationStores: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] pubSubBrokers: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] secretStores: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] stateStores: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] diff --git a/deploy/manifest/built-in-providers/self-hosted/applications_datastores.yaml b/deploy/manifest/built-in-providers/self-hosted/applications_datastores.yaml index 5d40939fe6..80a6b24a4b 100644 --- a/deploy/manifest/built-in-providers/self-hosted/applications_datastores.yaml +++ b/deploy/manifest/built-in-providers/self-hosted/applications_datastores.yaml @@ -1,20 +1,20 @@ name: Applications.Datastores -locations: +location: global: - address: "http://applications-rp.radius-system:5443" + "http://applications-rp.radius-system:5443" types: mongoDatabases: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] sqlDatabases: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] redisCaches: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] diff --git a/deploy/manifest/built-in-providers/self-hosted/applications_messaging.yaml b/deploy/manifest/built-in-providers/self-hosted/applications_messaging.yaml index 8cb7c16206..b00483559f 100644 --- a/deploy/manifest/built-in-providers/self-hosted/applications_messaging.yaml +++ b/deploy/manifest/built-in-providers/self-hosted/applications_messaging.yaml @@ -1,10 +1,10 @@ name: Applications.Messaging -locations: +location: global: - address: "http://applications-rp.radius-system:5443" + "http://applications-rp.radius-system:5443" types: rabbitMQQueues: apiVersions: "2023-10-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] diff --git a/deploy/manifest/built-in-providers/self-hosted/microsoft_resources.yaml b/deploy/manifest/built-in-providers/self-hosted/microsoft_resources.yaml index f041b89f90..969a2e491e 100644 --- a/deploy/manifest/built-in-providers/self-hosted/microsoft_resources.yaml +++ b/deploy/manifest/built-in-providers/self-hosted/microsoft_resources.yaml @@ -1,10 +1,12 @@ name: Microsoft.Resources -locations: +location: global: - address: "http://bicep-de.radius-system:6443" + "http://bicep-de.radius-system:6443" types: deployments: apiVersions: - "2023-10-01-preview": + "2020-10-01": schema: {} + "2022-09-01": + schema: {} capabilities: [] diff --git a/pkg/cli/cmd/resourceprovider/create/testdata/valid.yaml b/pkg/cli/cmd/resourceprovider/create/testdata/valid.yaml index a6f26f7fb4..f2eee239d6 100644 --- a/pkg/cli/cmd/resourceprovider/create/testdata/valid.yaml +++ b/pkg/cli/cmd/resourceprovider/create/testdata/valid.yaml @@ -1,4 +1,7 @@ name: MyCompany.Resources +location: + global: + 'http://localhost:8080' types: testResources: apiVersions: diff --git a/pkg/cli/cmd/resourcetype/create/testdata/valid.yaml b/pkg/cli/cmd/resourcetype/create/testdata/valid.yaml index 220799cc23..8cc818fd7f 100644 --- a/pkg/cli/cmd/resourcetype/create/testdata/valid.yaml +++ b/pkg/cli/cmd/resourcetype/create/testdata/valid.yaml @@ -4,9 +4,9 @@ types: apiVersions: '2023-10-01-preview': schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] coolResources: apiVersions: '2023-10-01-preview': schema: {} - capabilities: ["Recipes"] \ No newline at end of file + capabilities: ["SupportsRecipes"] \ No newline at end of file diff --git a/pkg/cli/manifest/manifest.go b/pkg/cli/manifest/manifest.go index d7a8a5855e..9e112f0cf4 100644 --- a/pkg/cli/manifest/manifest.go +++ b/pkg/cli/manifest/manifest.go @@ -21,6 +21,9 @@ type ResourceProvider struct { // Name is the resource provider name. This is also the namespace of the types defined by the resource provider. Name string `yaml:"name" validate:"required,resourceProviderNamespace"` + // Location is a map of location name to address in the resource provider. + Location map[string]string `yaml:"location,omitempty"` + // Types is a map of resource types in the resource provider. Types map[string]*ResourceType `yaml:"types" validate:"dive,keys,resourceType,endkeys,required"` } diff --git a/pkg/cli/manifest/manifest_test.go b/pkg/cli/manifest/manifest_test.go index 23c11de187..431ed1fc40 100644 --- a/pkg/cli/manifest/manifest_test.go +++ b/pkg/cli/manifest/manifest_test.go @@ -25,6 +25,9 @@ import ( func TestReadFileYAML(t *testing.T) { expected := &ResourceProvider{ Name: "MyCompany.Resources", + Location: map[string]string{ + "global": "http://localhost:8080", + }, Types: map[string]*ResourceType{ "testResources": { APIVersions: map[string]*ResourceTypeAPIVersion{ diff --git a/pkg/cli/manifest/registermanifest.go b/pkg/cli/manifest/registermanifest.go index 2c2a54fb72..12f35aeb01 100644 --- a/pkg/cli/manifest/registermanifest.go +++ b/pkg/cli/manifest/registermanifest.go @@ -38,9 +38,21 @@ func RegisterFile(ctx context.Context, clientFactory *v20231001preview.ClientFac return err } - logIfEnabled(logger, "Creating resource provider %s", resourceProvider.Name) + var locationName string + var address string + + if resourceProvider.Location == nil { + locationName = v1.LocationGlobal + } else { + for locationName, address = range resourceProvider.Location { + // We support one location per resourceProvider + break + } + } + + logIfEnabled(logger, "Creating resource provider %s at location %s", resourceProvider.Name, locationName) resourceProviderPoller, err := clientFactory.NewResourceProvidersClient().BeginCreateOrUpdate(ctx, planeName, resourceProvider.Name, v20231001preview.ResourceProviderResource{ - Location: to.Ptr(v1.LocationGlobal), + Location: to.Ptr(locationName), Properties: &v20231001preview.ResourceProviderProperties{}, }, nil) if err != nil { @@ -101,8 +113,12 @@ func RegisterFile(ctx context.Context, clientFactory *v20231001preview.ClientFac locationResource.Properties.ResourceTypes[resourceTypeName] = locationResourceType } - logIfEnabled(logger, "Creating location %s/%s", resourceProvider.Name, v1.LocationGlobal) - locationPoller, err := clientFactory.NewLocationsClient().BeginCreateOrUpdate(ctx, planeName, resourceProvider.Name, v1.LocationGlobal, locationResource, nil) + if address != "" { + locationResource.Properties.Address = to.Ptr(address) + } + + logIfEnabled(logger, "Creating location %s/%s/%s", resourceProvider.Name, locationName, address) + locationPoller, err := clientFactory.NewLocationsClient().BeginCreateOrUpdate(ctx, planeName, resourceProvider.Name, locationName, locationResource, nil) if err != nil { return err } @@ -167,9 +183,21 @@ func RegisterType(ctx context.Context, clientFactory *v20231001preview.ClientFac return err } + var locationName string + var address string + + if resourceProvider.Location == nil { + locationName = v1.LocationGlobal + } else { + for locationName, address = range resourceProvider.Location { + // We support one location per resourceProvider + break + } + } + resourceType, ok := resourceProvider.Types[typeName] if !ok { - return fmt.Errorf("Type %s not found in manifest file %s", typeName, filePath) + return fmt.Errorf("type %s not found in manifest file %s", typeName, filePath) } logIfEnabled(logger, "Creating resource type %s/%s", resourceProvider.Name, typeName) @@ -188,7 +216,7 @@ func RegisterType(ctx context.Context, clientFactory *v20231001preview.ClientFac } // get the existing location resource and update it with new resource type. We have to revisit this code once schema is finalized and validated. - locationResourceGetResponse, err := clientFactory.NewLocationsClient().Get(ctx, planeName, resourceProvider.Name, v1.LocationGlobal, nil) + locationResourceGetResponse, err := clientFactory.NewLocationsClient().Get(ctx, planeName, resourceProvider.Name, locationName, nil) if err != nil { return err } @@ -199,15 +227,20 @@ func RegisterType(ctx context.Context, clientFactory *v20231001preview.ClientFac } else { defaultAPIVersion = *resourceType.DefaultAPIVersion } + locationResource := locationResourceGetResponse.LocationResource + if address != "" { + locationResource.Properties.Address = to.Ptr(address) + } + locationResource.Properties.ResourceTypes[typeName] = &v20231001preview.LocationResourceType{ APIVersions: map[string]map[string]any{ defaultAPIVersion: {}, }, } - logIfEnabled(logger, "Updating location %s/%s with new resource type", resourceProvider.Name, v1.LocationGlobal) - locationPoller, err := clientFactory.NewLocationsClient().BeginCreateOrUpdate(ctx, planeName, resourceProvider.Name, v1.LocationGlobal, locationResource, nil) + logIfEnabled(logger, "Updating location %s/%s with new resource type", resourceProvider.Name, locationName) + locationPoller, err := clientFactory.NewLocationsClient().BeginCreateOrUpdate(ctx, planeName, resourceProvider.Name, locationName, locationResource, nil) if err != nil { return err } diff --git a/pkg/cli/manifest/testdata/missing-required-field.json b/pkg/cli/manifest/testdata/missing-required-field.json index c6ef38a2f2..8a200cbec9 100644 --- a/pkg/cli/manifest/testdata/missing-required-field.json +++ b/pkg/cli/manifest/testdata/missing-required-field.json @@ -4,7 +4,7 @@ "apiVersions": { "2025-01-01-preview": { "schema": {}, - "capabilities": ["Recipes"] + "capabilities": ["SupportsRecipes"] } } } diff --git a/pkg/cli/manifest/testdata/registerdirectory/resourceprovider-valid2.yaml b/pkg/cli/manifest/testdata/registerdirectory/resourceprovider-valid2.yaml index a2ffd310e7..0b70586ad3 100644 --- a/pkg/cli/manifest/testdata/registerdirectory/resourceprovider-valid2.yaml +++ b/pkg/cli/manifest/testdata/registerdirectory/resourceprovider-valid2.yaml @@ -1,4 +1,7 @@ name: MyCompany2.CompanyName2 +location: + global: + 'http://localhost:8080' types: testResource3: apiVersions: diff --git a/pkg/cli/manifest/testdata/valid.yaml b/pkg/cli/manifest/testdata/valid.yaml index a6f26f7fb4..f2eee239d6 100644 --- a/pkg/cli/manifest/testdata/valid.yaml +++ b/pkg/cli/manifest/testdata/valid.yaml @@ -1,4 +1,7 @@ name: MyCompany.Resources +location: + global: + 'http://localhost:8080' types: testResources: apiVersions: diff --git a/pkg/ucp/backend/controller/resourcegroups/trackedresourceprocess_test.go b/pkg/ucp/backend/controller/resourcegroups/trackedresourceprocess_test.go index b36c7471fb..2d9deeeb14 100644 --- a/pkg/ucp/backend/controller/resourcegroups/trackedresourceprocess_test.go +++ b/pkg/ucp/backend/controller/resourcegroups/trackedresourceprocess_test.go @@ -203,7 +203,6 @@ func Test_Run(t *testing.T) { require.Equal(t, expected, result) require.NoError(t, err) }) - } type mockUpdater struct { diff --git a/pkg/ucp/frontend/controller/radius/proxy_test.go b/pkg/ucp/frontend/controller/radius/proxy_test.go index 4629db95fd..108f543731 100644 --- a/pkg/ucp/frontend/controller/radius/proxy_test.go +++ b/pkg/ucp/frontend/controller/radius/proxy_test.go @@ -396,7 +396,6 @@ func Test_ProxyController_PrepareProxyRequest(t *testing.T) { require.Equal(t, "failed to parse downstream URL: parse \"\\ninvalid\": net/url: invalid control character in URL", err.Error()) require.Nil(t, proxyReq) }) - } type mockUpdater struct { diff --git a/pkg/ucp/integrationtests/radius/proxy_test.go b/pkg/ucp/integrationtests/radius/proxy_test.go index b98dec935f..5c93754d61 100644 --- a/pkg/ucp/integrationtests/radius/proxy_test.go +++ b/pkg/ucp/integrationtests/radius/proxy_test.go @@ -36,14 +36,14 @@ import ( const ( apiVersionParameter = "api-version=2023-10-01-preview" - testRadiusPlaneID = "/planes/radius/local" + testRadiusPlaneID = "/planes/radius/test" testResourceNamespace = "System.Test" testResourceGroupID = testRadiusPlaneID + "/resourceGroups/test-rg" - testResourceProviderID = "/planes/radius/local/providers/System.Resources/resourceproviders/System.Test" + testResourceProviderID = testRadiusPlaneID + "/providers/System.Resources/resourceproviders/System.Test" testResourceCollectionID = testResourceGroupID + "/providers/System.Test/testResources" testResourceID = testResourceCollectionID + "/test-resource" - resourceTypeURL = "/planes/radius/local/providers/System.Resources/resourceproviders/System.Test/resourcetypes/testResources" - locationID = "/planes/radius/local/providers/System.Resources/resourceproviders/System.Test/locations/global" + resourceTypeURL = testResourceProviderID + "/resourcetypes/testResources" + locationID = testResourceProviderID + "/locations/global" assertTimeout = time.Second * 10 assertRetry = time.Second * 2 @@ -60,7 +60,7 @@ func Test_RadiusPlane_Proxy_ResourceGroupDoesNotExist(t *testing.T) { response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) response.EqualsErrorCode(http.StatusNotFound, "NotFound") - require.Equal(t, "the resource with id '/planes/radius/local/resourceGroups/test-rg/providers/System.Test/testResources/test-resource' was not found: resource group \"/planes/radius/local/resourceGroups/test-rg\" not found", response.Error.Error.Message) + require.Equal(t, "the resource with id '/planes/radius/test/resourceGroups/test-rg/providers/System.Test/testResources/test-resource' was not found: resource group \"/planes/radius/test/resourceGroups/test-rg\" not found", response.Error.Error.Message) } func Test_RadiusPlane_ResourceSync(t *testing.T) { diff --git a/pkg/ucp/integrationtests/resourceproviders/testdata/manifests/resourceprovider-valid1.yaml b/pkg/ucp/integrationtests/resourceproviders/testdata/manifests/resourceprovider-valid1.yaml index 4523f045df..02118b74c2 100644 --- a/pkg/ucp/integrationtests/resourceproviders/testdata/manifests/resourceprovider-valid1.yaml +++ b/pkg/ucp/integrationtests/resourceproviders/testdata/manifests/resourceprovider-valid1.yaml @@ -1,4 +1,7 @@ name: TestProvider.TestCompany +location: + global: + 'http://localhost:8080' types: testResourcesAbc: apiVersions: diff --git a/test/functional-portable/ucp/noncloud/resourceprovider_test.go b/test/functional-portable/ucp/noncloud/resourceprovider_test.go index ba70e34263..95f46fb63b 100644 --- a/test/functional-portable/ucp/noncloud/resourceprovider_test.go +++ b/test/functional-portable/ucp/noncloud/resourceprovider_test.go @@ -38,7 +38,7 @@ func Test_ResourceProviderRegistration(t *testing.T) { manifestPath = "testdata/resourceprovider.yaml" resourceProviderName = "MyCompany.Resources" expectedResourceTypeName = "testResources" - expectedApiVersion = "2025-01-01-preview" + expectedApiVersion = "2023-10-01-preview" ) expectedData := map[string]any{