From c8c6e00ca4f658c0f5743f54b1548945ef5640dc Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Sun, 21 May 2023 01:24:13 -0700 Subject: [PATCH] Removing useDevRecipes property and skip-dev-recipes flag (#5528) # Description This PR: 1. Removal of `useDevRecipes` property from the environment resource 2. Removal of `skip-dev-recipes` flag from `rad init` and a few other commands This is the follow-up PR after https://github.com/project-radius/radius/pull/5526. ## Issue reference Fixes: #5460 ## Checklist Please make sure you've completed the relevant tasks for this PR, out of the following list: * [x] Code compiles correctly * [x] Adds necessary unit tests for change * [ ] Adds necessary E2E tests for change * [x] Unit tests passing * [x] Extended the documentation / Created issue for it --- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 1 - pkg/cli/cmd/env/create/create.go | 2 - pkg/cli/cmd/env/create/create_test.go | 73 +++- pkg/cli/cmd/env/update/update.go | 1 + pkg/cli/cmd/env/update/update_test.go | 358 ++++++++++++++-- pkg/cli/cmd/radinit/init.go | 11 +- pkg/cli/cmd/radinit/init_test.go | 6 +- pkg/cli/cmd/recipe/register/register.go | 4 +- pkg/cli/cmd/recipe/register/register_test.go | 140 +++++- .../cmd/recipe/unregister/unregister_test.go | 110 ++++- .../environment_conversion.go | 5 +- .../zz_generated_models.go | 3 - .../zz_generated_models_serde.go | 4 - pkg/corerp/datamodel/environment.go | 9 +- .../environments/createorupdateenvironment.go | 132 ------ .../createorupdateenvironment_test.go | 400 ------------------ ...nment20220315privatepreview_datamodel.json | 1 - ...vironment20220315privatepreview_input.json | 1 - ...ironment20220315privatepreview_output.json | 1 - ...cipes20220315privatepreview_datamodel.json | 53 --- ...evrecipes20220315privatepreview_input.json | 24 -- ...vrecipes20220315privatepreview_output.json | 47 -- ...sting20220315privatepreview_datamodel.json | 59 --- ...oexisting20220315privatepreview_input.json | 30 -- ...existing20220315privatepreview_output.json | 53 --- ...ginal20220315privatepreview_datamodel.json | 43 -- ...adata20220315privatepreview_datamodel.json | 1 - ...cipes20220315privatepreview_datamodel.json | 49 --- ...evrecipes20220315privatepreview_input.json | 24 -- ...vrecipes20220315privatepreview_output.json | 43 -- ...cipes20220315privatepreview_datamodel.json | 49 --- ...evrecipes20220315privatepreview_input.json | 16 - ...vrecipes20220315privatepreview_output.json | 43 -- .../frontend/controller/environments/types.go | 11 +- .../v20220315privatepreview_test.go | 68 --- .../environments.json | 4 - .../corerp-resources-recipe-env.bicep | 1 - 38 files changed, 632 insertions(+), 1250 deletions(-) delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_datamodel.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_input.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_output.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_datamodel.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_input.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_output.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexistingoriginal20220315privatepreview_datamodel.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_datamodel.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_input.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_output.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_datamodel.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_input.json delete mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_output.json diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index 99c8b152db..ac17c33e70 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":22,"Flags":1,"Description":"Application environment properties"},"tags":{"Type":50,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":16,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":21,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[12,13,14,15]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[17,18,19,20]}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":30,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"compute":{"Type":31,"Flags":1,"Description":"Compute resource used by application environment resource."},"providers":{"Type":38,"Flags":0,"Description":"Cloud providers configuration"},"useDevRecipes":{"Type":2,"Flags":0,"Description":"Flag to use radius owned recipes."},"recipes":{"Type":43,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":49,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[23,24,25,26,27,28,29]}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":32,"Flags":0}},"Elements":{"kubernetes":36}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":35,"Flags":1,"Description":"Configuration for supported external identity providers"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[33,34]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":37,"Flags":1,"Description":"Type of compute resource."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":39,"Flags":0,"Description":"Azure cloud provider configuration"},"aws":{"Type":40,"Flags":0,"Description":"AWS cloud provider configuration"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":0,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":0,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"2":{"Name":"EnvironmentRecipeProperties","Properties":{"templateKind":{"Type":4,"Flags":0,"Description":"Format of the template provided by the recipe. Allowed values: bicep"},"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"DictionaryOfEnvironmentRecipeProperties","Properties":{},"AdditionalProperties":41}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":42}},{"7":{"Name":"EnvironmentExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"kubernetesMetadata":45}}},{"2":{"Name":"EnvironmentKubernetesMetadataExtension","Properties":{"annotations":{"Type":46,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":47,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":48,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"EnvironmentKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"EnvironmentKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"3":{"ItemType":44}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":52,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":53,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":55,"Flags":1,"Description":"Application properties"},"tags":{"Type":74,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":63,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"environment":{"Type":4,"Flags":1,"Description":"The resource id of the environment linked to application."},"extensions":{"Type":71,"Flags":0,"Description":"Extensions spec of the resource"},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[56,57,58,59,60,61,62]}},{"7":{"Name":"ApplicationExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"kubernetesMetadata":65,"kubernetesNamespace":69}}},{"2":{"Name":"ApplicationKubernetesMetadataExtension","Properties":{"annotations":{"Type":66,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":67,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":68,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"ApplicationKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ApplicationKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"ApplicationKubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The Kubernetes namespace to use for this application."},"kind":{"Type":70,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"kubernetesNamespace"}},{"3":{"ItemType":64}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":31,"Flags":0,"Description":"Compute resource used by application environment resource."},"outputResources":{"Type":73,"Flags":0,"Description":"Array of AnyObject"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":54}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":76,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":77,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":79,"Flags":1,"Description":"HTTP Route properties"},"tags":{"Type":88,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"provisioningState":{"Type":87,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":0,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":0,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[80,81,82,83,84,85,86]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":78}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":90,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":91,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":93,"Flags":1,"Description":"Gateway properties"},"tags":{"Type":109,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"GatewayProperties","Properties":{"provisioningState":{"Type":101,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":102,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"tls":{"Type":103,"Flags":0,"Description":"TLS configuration for the Gateway."},"routes":{"Type":108,"Flags":1,"Description":"Routes attached to this Gateway"},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[94,95,96,97,98,99,100]}},{"2":{"Name":"GatewayPropertiesHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayPropertiesTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"hostname":{"Type":4,"Flags":0,"Description":"Hostname"},"minimumProtocolVersion":{"Type":106,"Flags":0,"Description":"TLS minimum protocol version (defaults to 1.2)."},"certificateFrom":{"Type":4,"Flags":0,"Description":"Declares which Kubernetes TLS secret will be used."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[104,105]}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":107}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":92}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":111,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":112,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":114,"Flags":1,"Description":"Container properties"},"tags":{"Type":174,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ContainerProperties","Properties":{"provisioningState":{"Type":122,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"connections":{"Type":127,"Flags":0,"Description":"Dictionary of "},"container":{"Type":128,"Flags":1,"Description":"Definition of a container."},"identity":{"Type":32,"Flags":0},"extensions":{"Type":173,"Flags":0,"Description":"Extensions spec of the resource"},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[115,116,117,118,119,120,121]}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0},"iam":{"Type":124,"Flags":0,"Description":"The properties of IAM"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":125,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":126,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":123}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":129,"Flags":0,"Description":"Dictionary of "},"ports":{"Type":136,"Flags":0,"Description":"Dictionary of "},"readinessProbe":{"Type":137,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":137,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":156,"Flags":0,"Description":"Dictionary of "},"command":{"Type":157,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":158,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPort","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":135,"Flags":0,"Description":"Protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[131,132,133,134]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":130}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":138,"httpGet":140,"tcp":143}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":139,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":141,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":142,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":144,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":146,"persistent":151}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":149,"Flags":1,"Description":"Backing store for the ephemeral volume"},"kind":{"Type":150,"Flags":1,"Description":"The Volume kind"}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[147,148]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":154,"Flags":0,"Description":"Container read/write access to the volume"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":155,"Flags":1,"Description":"The Volume kind"}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[152,153]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":145}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"7":{"Name":"ContainerExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":160,"kubernetesMetadata":167,"manualScaling":171}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":165,"Flags":0,"Description":"Protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies the resource id of a dapr.io.InvokeHttpRoute that can route traffic to this resource."},"kind":{"Type":166,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[161,162,163,164]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"ContainerKubernetesMetadataExtension","Properties":{"annotations":{"Type":168,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":169,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":170,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"ContainerKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":0,"Description":"Replica count."},"kind":{"Type":172,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":159}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":113}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":176,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":177,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":179,"Flags":1},"tags":{"Type":211,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"provisioningState":{"Type":187,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}},"Elements":{"azure.com.keyvault":188}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[180,181,182,183,184,185,186]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":201,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":203,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":209,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":210,"Flags":1,"Description":"The volume kind"}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"encoding":{"Type":193,"Flags":0,"Description":"Encoding format. Default utf-8"},"format":{"Type":196,"Flags":0,"Description":"Certificate format. Default pem"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":200,"Flags":0,"Description":"Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[190,191,192]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[194,195]}},{"6":{"Value":"certificate"}},{"6":{"Value":"publickey"}},{"6":{"Value":"privatekey"}},{"5":{"Elements":[197,198,199]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":189}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":202}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"encoding":{"Type":208,"Flags":0,"Description":"Encoding format. Default utf-8"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"Secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[205,206,207]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":204}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":178}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":213,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":214,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":216,"Flags":1},"tags":{"Type":234,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"provisioningState":{"Type":224,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"type":{"Type":227,"Flags":0,"Description":"The type of secret store data"},"data":{"Type":233,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[217,218,219,220,221,222,223]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[225,226]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":231,"Flags":0,"Description":"The encoding of value"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":232,"Flags":0}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[229,230]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":228}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":215}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":236,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":237,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":6,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":239,"Flags":1,"Description":"Extender link properties"},"tags":{"Type":249,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ExtenderProperties","Properties":{"secrets":{"Type":240,"Flags":4,"Description":"The secret values for the given Extender resource"},"provisioningState":{"Type":248,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}},"AdditionalProperties":0}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[241,242,243,244,245,246,247]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":238}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":254,"Flags":2,"Description":"The type of secret store data"},"data":{"Type":255,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[252,253]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":228}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":251}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":257}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":22,"Flags":1,"Description":"Application environment properties"},"tags":{"Type":50,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":16,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":21,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[12,13,14,15]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[17,18,19,20]}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":30,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"compute":{"Type":31,"Flags":1,"Description":"Compute resource used by application environment resource."},"providers":{"Type":38,"Flags":0,"Description":"Cloud providers configuration"},"recipes":{"Type":43,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":49,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[23,24,25,26,27,28,29]}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":32,"Flags":0}},"Elements":{"kubernetes":36}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":35,"Flags":1,"Description":"Configuration for supported external identity providers"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[33,34]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":37,"Flags":1,"Description":"Type of compute resource."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":39,"Flags":0,"Description":"Azure cloud provider configuration"},"aws":{"Type":40,"Flags":0,"Description":"AWS cloud provider configuration"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":0,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":0,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"2":{"Name":"EnvironmentRecipeProperties","Properties":{"templateKind":{"Type":4,"Flags":0,"Description":"Format of the template provided by the recipe. Allowed values: bicep"},"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"DictionaryOfEnvironmentRecipeProperties","Properties":{},"AdditionalProperties":41}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":42}},{"7":{"Name":"EnvironmentExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"kubernetesMetadata":45}}},{"2":{"Name":"EnvironmentKubernetesMetadataExtension","Properties":{"annotations":{"Type":46,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":47,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":48,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"EnvironmentKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"EnvironmentKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"3":{"ItemType":44}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":52,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":53,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":55,"Flags":1,"Description":"Application properties"},"tags":{"Type":74,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":63,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"environment":{"Type":4,"Flags":1,"Description":"The resource id of the environment linked to application."},"extensions":{"Type":71,"Flags":0,"Description":"Extensions spec of the resource"},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[56,57,58,59,60,61,62]}},{"7":{"Name":"ApplicationExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"kubernetesMetadata":65,"kubernetesNamespace":69}}},{"2":{"Name":"ApplicationKubernetesMetadataExtension","Properties":{"annotations":{"Type":66,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":67,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":68,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"ApplicationKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ApplicationKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"ApplicationKubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The Kubernetes namespace to use for this application."},"kind":{"Type":70,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"kubernetesNamespace"}},{"3":{"ItemType":64}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":31,"Flags":0,"Description":"Compute resource used by application environment resource."},"outputResources":{"Type":73,"Flags":0,"Description":"Array of AnyObject"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":54}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":76,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":77,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":79,"Flags":1,"Description":"HTTP Route properties"},"tags":{"Type":88,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"provisioningState":{"Type":87,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":0,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":0,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[80,81,82,83,84,85,86]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":78}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":90,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":91,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":93,"Flags":1,"Description":"Gateway properties"},"tags":{"Type":109,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"GatewayProperties","Properties":{"provisioningState":{"Type":101,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":102,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"tls":{"Type":103,"Flags":0,"Description":"TLS configuration for the Gateway."},"routes":{"Type":108,"Flags":1,"Description":"Routes attached to this Gateway"},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[94,95,96,97,98,99,100]}},{"2":{"Name":"GatewayPropertiesHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayPropertiesTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"hostname":{"Type":4,"Flags":0,"Description":"Hostname"},"minimumProtocolVersion":{"Type":106,"Flags":0,"Description":"TLS minimum protocol version (defaults to 1.2)."},"certificateFrom":{"Type":4,"Flags":0,"Description":"Declares which Kubernetes TLS secret will be used."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[104,105]}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":107}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":92}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":111,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":112,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":114,"Flags":1,"Description":"Container properties"},"tags":{"Type":174,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ContainerProperties","Properties":{"provisioningState":{"Type":122,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"connections":{"Type":127,"Flags":0,"Description":"Dictionary of "},"container":{"Type":128,"Flags":1,"Description":"Definition of a container."},"identity":{"Type":32,"Flags":0},"extensions":{"Type":173,"Flags":0,"Description":"Extensions spec of the resource"},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[115,116,117,118,119,120,121]}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0},"iam":{"Type":124,"Flags":0,"Description":"The properties of IAM"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":125,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":126,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":123}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":129,"Flags":0,"Description":"Dictionary of "},"ports":{"Type":136,"Flags":0,"Description":"Dictionary of "},"readinessProbe":{"Type":137,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":137,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":156,"Flags":0,"Description":"Dictionary of "},"command":{"Type":157,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":158,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPort","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":135,"Flags":0,"Description":"Protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[131,132,133,134]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":130}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":138,"httpGet":140,"tcp":143}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":139,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":141,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":142,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":144,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":146,"persistent":151}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":149,"Flags":1,"Description":"Backing store for the ephemeral volume"},"kind":{"Type":150,"Flags":1,"Description":"The Volume kind"}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[147,148]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":154,"Flags":0,"Description":"Container read/write access to the volume"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":155,"Flags":1,"Description":"The Volume kind"}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[152,153]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":145}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"7":{"Name":"ContainerExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":160,"kubernetesMetadata":167,"manualScaling":171}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":165,"Flags":0,"Description":"Protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies the resource id of a dapr.io.InvokeHttpRoute that can route traffic to this resource."},"kind":{"Type":166,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[161,162,163,164]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"ContainerKubernetesMetadataExtension","Properties":{"annotations":{"Type":168,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":169,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":170,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"ContainerKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":0,"Description":"Replica count."},"kind":{"Type":172,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":159}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":113}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":176,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":177,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":179,"Flags":1},"tags":{"Type":211,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"provisioningState":{"Type":187,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}},"Elements":{"azure.com.keyvault":188}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[180,181,182,183,184,185,186]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":201,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":203,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":209,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":210,"Flags":1,"Description":"The volume kind"}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"encoding":{"Type":193,"Flags":0,"Description":"Encoding format. Default utf-8"},"format":{"Type":196,"Flags":0,"Description":"Certificate format. Default pem"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":200,"Flags":0,"Description":"Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[190,191,192]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[194,195]}},{"6":{"Value":"certificate"}},{"6":{"Value":"publickey"}},{"6":{"Value":"privatekey"}},{"5":{"Elements":[197,198,199]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":189}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":202}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"encoding":{"Type":208,"Flags":0,"Description":"Encoding format. Default utf-8"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"Secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[205,206,207]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":204}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":178}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":213,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":214,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":216,"Flags":1},"tags":{"Type":234,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"provisioningState":{"Type":224,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"type":{"Type":227,"Flags":0,"Description":"The type of secret store data"},"data":{"Type":233,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[217,218,219,220,221,222,223]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[225,226]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":231,"Flags":0,"Description":"The encoding of value"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":232,"Flags":0}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[229,230]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":228}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":215}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":236,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":237,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":6,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":239,"Flags":1,"Description":"Extender link properties"},"tags":{"Type":249,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ExtenderProperties","Properties":{"secrets":{"Type":240,"Flags":4,"Description":"The secret values for the given Extender resource"},"provisioningState":{"Type":248,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"status":{"Type":72,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}},"AdditionalProperties":0}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[241,242,243,244,245,246,247]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":238}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":254,"Flags":2,"Description":"The type of secret store data"},"data":{"Type":255,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[252,253]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":228}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":251}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":257}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index b6bf2d3ea1..c10daade22 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -331,7 +331,6 @@ * **providers**: [Providers](#providers): Cloud providers configuration * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. * **recipes**: [EnvironmentPropertiesRecipes](#environmentpropertiesrecipes): Specifies Recipes linked to the Environment. -* **useDevRecipes**: bool: Flag to use radius owned recipes. ## EnvironmentExtension * **Discriminator**: kind diff --git a/pkg/cli/cmd/env/create/create.go b/pkg/cli/cmd/env/create/create.go index c0e3e5a92d..e588ce4bf7 100644 --- a/pkg/cli/cmd/env/create/create.go +++ b/pkg/cli/cmd/env/create/create.go @@ -148,8 +148,6 @@ func (r *Runner) Run(ctx context.Context) error { } envProperties := &corerp.EnvironmentProperties{ - // Setting this to false to make sure that we only install the recipes with rad init --dev flag. - UseDevRecipes: to.Ptr(false), Compute: &corerp.KubernetesCompute{ Namespace: to.Ptr(r.Namespace), }, diff --git a/pkg/cli/cmd/env/create/create_test.go b/pkg/cli/cmd/env/create/create_test.go index a3f85e8f2d..43ea429c09 100644 --- a/pkg/cli/cmd/env/create/create_test.go +++ b/pkg/cli/cmd/env/create/create_test.go @@ -1,12 +1,13 @@ -// // ------------------------------------------------------------ -// // Copyright (c) Microsoft Corporation. -// // Licensed under the MIT License. -// // ------------------------------------------------------------ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +// ------------------------------------------------------------ package create import ( "context" + "errors" "fmt" "testing" @@ -120,14 +121,13 @@ func Test_Validate(t *testing.T) { radcli.SharedValidateValidation(t, NewCommand, testcases) } -func Test_Run_Success(t *testing.T) { - t.Run("Run env create tests", func(t *testing.T) { +func Test_Run(t *testing.T) { + t.Run("Success", func(t *testing.T) { ctrl := gomock.NewController(t) appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) namespaceClient := namespace.NewMockInterface(ctrl) testEnvProperties := &corerp.EnvironmentProperties{ - UseDevRecipes: to.Ptr(false), Compute: &corerp.KubernetesCompute{ Namespace: to.Ptr("default"), }, @@ -158,8 +158,67 @@ func Test_Run_Success(t *testing.T) { ConfigFileInterface: configFileInterface, } + expectedOutput := []any{ + output.LogOutput{ + Format: "Creating Environment...", + }, + output.LogOutput{ + Format: "Successfully created environment %q in resource group %q", + Params: []interface{}{ + "default", + "default", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) + }) + + t.Run("Failure", func(t *testing.T) { + ctrl := gomock.NewController(t) + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) + + namespaceClient := namespace.NewMockInterface(ctrl) + testEnvProperties := &corerp.EnvironmentProperties{ + Compute: &corerp.KubernetesCompute{ + Namespace: to.Ptr("default"), + }, + } + + expectedError := errors.New("failed to create the environment") + + appManagementClient.EXPECT(). + CreateEnvironment(context.Background(), "default", v1.LocationGlobal, testEnvProperties). + Return(false, expectedError). + Times(1) + + configFileInterface := framework.NewMockConfigFileInterface(ctrl) + outputSink := &output.MockOutput{} + workspace := &workspaces.Workspace{ + Connection: map[string]any{ + "kind": "kubernetes", + "context": "kind-kind", + }, + Name: "defaultWorkspace", + } + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + ConfigHolder: &framework.ConfigHolder{ConfigFilePath: "filePath"}, + Output: outputSink, + Workspace: workspace, + EnvironmentName: "default", + UCPResourceGroup: "default", + Namespace: "default", + NamespaceInterface: namespaceClient, + ConfigFileInterface: configFileInterface, + } + + err := runner.Run(context.Background()) + require.Error(t, err) + require.Equal(t, expectedError, err) }) } diff --git a/pkg/cli/cmd/env/update/update.go b/pkg/cli/cmd/env/update/update.go index babcfbc47c..d14aa8da78 100644 --- a/pkg/cli/cmd/env/update/update.go +++ b/pkg/cli/cmd/env/update/update.go @@ -171,6 +171,7 @@ func (r *Runner) Run(ctx context.Context) error { if r.noFlagsSet { return nil } + client, err := r.ConnectionFactory.CreateApplicationsManagementClient(ctx, *r.Workspace) if err != nil { return err diff --git a/pkg/cli/cmd/env/update/update_test.go b/pkg/cli/cmd/env/update/update_test.go index d54528c7d8..8c8b3f8715 100644 --- a/pkg/cli/cmd/env/update/update_test.go +++ b/pkg/cli/cmd/env/update/update_test.go @@ -7,8 +7,11 @@ package update import ( "context" + "errors" + "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/golang/mock/gomock" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/cli/clients" @@ -74,21 +77,31 @@ func Test_Validate(t *testing.T) { } func Test_Update(t *testing.T) { - t.Run("Success: Update Environment With Providers", func(t *testing.T) { + t.Run("Failure: No Flags Set", func(t *testing.T) { + runner := &Runner{ + noFlagsSet: true, + } + + err := runner.Run(context.Background()) + require.NoError(t, err) + require.Equal(t, nil, err) + }) + + t.Run("Failure: Get Environment Details Error", func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() environment := corerp.EnvironmentResource{ - Name: to.Ptr("test-env"), - Properties: &corerp.EnvironmentProperties{ - UseDevRecipes: to.Ptr(false), - }, + Name: to.Ptr("test-env"), + Properties: &corerp.EnvironmentProperties{}, } + expectedError := errors.New("failed to update the environment") + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) appManagementClient.EXPECT(). GetEnvDetails(gomock.Any(), "test-env"). - Return(environment, nil). + Return(environment, expectedError). Times(1) testProviders := &corerp.Providers{ @@ -100,15 +113,58 @@ func Test_Update(t *testing.T) { }, } - testEnvProperties := &corerp.EnvironmentProperties{ - UseDevRecipes: to.Ptr(false), - Providers: testProviders, + workspace := &workspaces.Workspace{ + Connection: map[string]any{ + "kind": "kubernetes", + "context": "kind-kind", + }, + Name: "kind-kind", + Scope: "/planes/radius/local/resourceGroups/test-group", } + + outputSink := &output.MockOutput{} + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + Workspace: workspace, + Output: outputSink, + EnvName: "test-env", + providers: testProviders, + } + + err := runner.Run(context.Background()) + require.Error(t, expectedError) + require.Equal(t, expectedError.Error(), err.Error()) + }) + + t.Run("Failure: Environment Doesn't Exist", func(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + environment := corerp.EnvironmentResource{ + Name: to.Ptr("test-env"), + Properties: &corerp.EnvironmentProperties{}, + } + + expectedError := &azcore.ResponseError{ + ErrorCode: v1.CodeNotFound, + } + + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) appManagementClient.EXPECT(). - CreateEnvironment(gomock.Any(), "test-env", v1.LocationGlobal, testEnvProperties). - Return(true, nil). + GetEnvDetails(gomock.Any(), "test-env"). + Return(environment, expectedError). Times(1) + testProviders := &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + } + workspace := &workspaces.Workspace{ Connection: map[string]any{ "kind": "kubernetes", @@ -117,7 +173,9 @@ func Test_Update(t *testing.T) { Name: "kind-kind", Scope: "/planes/radius/local/resourceGroups/test-group", } + outputSink := &output.MockOutput{} + runner := &Runner{ ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, Workspace: workspace, @@ -127,45 +185,83 @@ func Test_Update(t *testing.T) { } err := runner.Run(context.Background()) - require.NoError(t, err) + require.Error(t, expectedError) + require.Equal(t, envNotFoundErrMessage, err.Error()) + }) - environment.Properties.Providers = testProviders - obj := objectformats.OutputEnvObject{ - EnvName: "test-env", - Recipes: 0, - Providers: 2, + t.Run("Failure: Update Environment Error", func(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + environment := corerp.EnvironmentResource{ + Name: to.Ptr("test-env"), + Properties: &corerp.EnvironmentProperties{}, } - expected := []any{ - output.LogOutput{ - Format: "Updating Environment...", + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) + appManagementClient.EXPECT(). + GetEnvDetails(gomock.Any(), "test-env"). + Return(environment, nil). + Times(1) + + testProviders := &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), }, - output.FormattedOutput{ - Format: "table", - Obj: obj, - Options: objectformats.GetUpdateEnvironmentTableFormat(), + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), }, - output.LogOutput{ - Format: "Successfully updated environment %q.", - Params: []any{"test-env"}, + } + + testEnvProperties := &corerp.EnvironmentProperties{ + Providers: testProviders, + } + + expectedError := errors.New("failed to update the environment") + expectedErrorMessage := fmt.Sprintf("failed to configure cloud provider scope to the environment %s: %s", "test-env", expectedError.Error()) + + appManagementClient.EXPECT(). + CreateEnvironment(gomock.Any(), "test-env", v1.LocationGlobal, testEnvProperties). + Return(false, expectedError). + Times(1) + + workspace := &workspaces.Workspace{ + Connection: map[string]any{ + "kind": "kubernetes", + "context": "kind-kind", }, + Name: "kind-kind", + Scope: "/planes/radius/local/resourceGroups/test-group", } - require.Equal(t, expected, outputSink.Writes) + outputSink := &output.MockOutput{} + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + Workspace: workspace, + Output: outputSink, + EnvName: "test-env", + providers: testProviders, + } + + err := runner.Run(context.Background()) + require.Error(t, expectedError) + require.Equal(t, expectedErrorMessage, err.Error()) }) - t.Run("Success: Update Environment With Existing Providers", func(t *testing.T) { + + t.Run("Success: Update Environment With Providers", func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() environment := corerp.EnvironmentResource{ Name: to.Ptr("test-env"), Properties: &corerp.EnvironmentProperties{ - Providers: &corerp.Providers{ - Azure: &corerp.ProvidersAzure{ - Scope: to.Ptr("/subscriptions/testSubId-1/resourceGroups/test-group-1"), - }, + Recipes: map[string]map[string]*corerp.EnvironmentRecipeProperties{}, + Compute: &corerp.KubernetesCompute{ + Namespace: to.Ptr("default"), + Kind: to.Ptr("kubernetes"), + ResourceID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind/compute/kubernetes"), }, - UseDevRecipes: to.Ptr(false), }, } @@ -185,8 +281,13 @@ func Test_Update(t *testing.T) { } testEnvProperties := &corerp.EnvironmentProperties{ - UseDevRecipes: to.Ptr(false), - Providers: testProviders, + Providers: testProviders, + Recipes: map[string]map[string]*corerp.EnvironmentRecipeProperties{}, + Compute: &corerp.KubernetesCompute{ + Namespace: to.Ptr("default"), + Kind: to.Ptr("kubernetes"), + ResourceID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind/compute/kubernetes"), + }, } appManagementClient.EXPECT(). CreateEnvironment(gomock.Any(), "test-env", v1.LocationGlobal, testEnvProperties). @@ -215,9 +316,10 @@ func Test_Update(t *testing.T) { environment.Properties.Providers = testProviders obj := objectformats.OutputEnvObject{ - EnvName: "test-env", - Recipes: 0, - Providers: 2, + EnvName: "test-env", + Recipes: 0, + Providers: 2, + ComputeKind: "kubernetes", } expected := []any{ @@ -237,4 +339,182 @@ func Test_Update(t *testing.T) { require.Equal(t, expected, outputSink.Writes) }) + + t.Run("Update Environment With Existing Providers", func(t *testing.T) { + testCases := []struct { + name string + existingProviders *corerp.Providers + expectedProviders *corerp.Providers + clearEnvAzure bool // only applies to Azure + clearEnvAws bool // only applies to AWS + expectedError error + }{ + { + name: "Update Environment With Existing Azure Provider", + existingProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId-1/resourceGroups/test-group-1"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + }, + expectedProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + }, + clearEnvAzure: false, + clearEnvAws: false, + expectedError: nil, + }, + { + name: "Update Environment With Existing Azure Provider and Clear Azure Provider", + existingProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId-1/resourceGroups/test-group-1"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + }, + expectedProviders: &corerp.Providers{ + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + }, + clearEnvAzure: true, + clearEnvAws: false, + expectedError: nil, + }, + { + name: "Update Environment With Existing AWS Provider", + existingProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + }, + expectedProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount-1/regions/us-west-2"), + }, + }, + clearEnvAzure: false, + clearEnvAws: false, + expectedError: nil, + }, + { + name: "Update Environment With Existing AWS Provider and Clear AWS Provider", + existingProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), + }, + Aws: &corerp.ProvidersAws{ + Scope: to.Ptr("/planes/aws/aws/accounts/testAwsAccount/regions/us-west-2"), + }, + }, + expectedProviders: &corerp.Providers{ + Azure: &corerp.ProvidersAzure{ + Scope: to.Ptr("/subscriptions/testSubId/resourceGroups/test-group"), + }, + }, + clearEnvAzure: false, + clearEnvAws: true, + expectedError: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + existingEnvironment := corerp.EnvironmentResource{ + Name: to.Ptr("test-env"), + Properties: &corerp.EnvironmentProperties{ + Providers: tc.existingProviders, + }, + } + + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) + appManagementClient.EXPECT(). + GetEnvDetails(gomock.Any(), "test-env"). + Return(existingEnvironment, nil). + Times(1) + + existingEnvironment.Properties.Providers = tc.expectedProviders + + appManagementClient.EXPECT(). + CreateEnvironment(gomock.Any(), "test-env", v1.LocationGlobal, existingEnvironment.Properties). + Return(true, nil). + Times(1) + + workspace := &workspaces.Workspace{ + Connection: map[string]any{ + "kind": "kubernetes", + "context": "kind-kind", + }, + Name: "kind-kind", + Scope: "/planes/radius/local/resourceGroups/test-group", + } + + outputSink := &output.MockOutput{} + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + Workspace: workspace, + Output: outputSink, + EnvName: "test-env", + providers: tc.expectedProviders, + clearEnvAzure: tc.clearEnvAzure, + } + + err := runner.Run(context.Background()) + require.NoError(t, err) + + numberOfProviders := func() int { + numberOfProviders := 0 + if tc.expectedProviders.Azure != nil { + numberOfProviders++ + } + if tc.expectedProviders.Aws != nil { + numberOfProviders++ + } + return numberOfProviders + } + + obj := objectformats.OutputEnvObject{ + EnvName: "test-env", + Recipes: 0, + Providers: numberOfProviders(), + } + + expected := []any{ + output.LogOutput{ + Format: "Updating Environment...", + }, + output.FormattedOutput{ + Format: "table", + Obj: obj, + Options: objectformats.GetUpdateEnvironmentTableFormat(), + }, + output.LogOutput{ + Format: "Successfully updated environment %q.", + Params: []any{"test-env"}, + }, + } + + require.Equal(t, expected, outputSink.Writes) + }) + } + }) } diff --git a/pkg/cli/cmd/radinit/init.go b/pkg/cli/cmd/radinit/init.go index 6c41a93d5f..527d89f5d1 100644 --- a/pkg/cli/cmd/radinit/init.go +++ b/pkg/cli/cmd/radinit/init.go @@ -65,7 +65,6 @@ func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) { // Define your flags here commonflags.AddOutputFlag(cmd) cmd.Flags().Bool("dev", false, "Setup Radius for development") - cmd.Flags().Bool("skip-dev-recipes", false, "Use this flag to not use radius built in recipes") return cmd, runner } @@ -93,7 +92,6 @@ type Runner struct { ScaffoldApplication bool ScaffoldApplicationName string ServicePrincipal *azure.ServicePrincipal - SkipDevRecipes bool Workspace *workspaces.Workspace Dev bool } @@ -142,11 +140,6 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { return &cli.FriendlyError{Message: "KubeContext not specified"} } - r.SkipDevRecipes, err = cmd.Flags().GetBool("skip-dev-recipes") - if err != nil { - return err - } - r.RadiusInstalled, err = r.HelmInterface.CheckRadiusInstall(r.KubeContext) if err != nil { return &cli.FriendlyError{Message: "Unable to verify radius installation on cluster"} @@ -430,9 +423,7 @@ func (r *Runner) Run(ctx context.Context) error { Namespace: to.Ptr(r.Namespace), }, Providers: &providers, - // Setting this to false to make sure that we only install the recipes with --dev flag. - UseDevRecipes: to.Ptr(false), - Recipes: recipes, + Recipes: recipes, } isEnvCreated, err := client.CreateEnvironment(ctx, r.EnvName, v1.LocationGlobal, &envProperties) diff --git a/pkg/cli/cmd/radinit/init_test.go b/pkg/cli/cmd/radinit/init_test.go index 3b184f2449..6a34c51778 100644 --- a/pkg/cli/cmd/radinit/init_test.go +++ b/pkg/cli/cmd/radinit/init_test.go @@ -644,10 +644,8 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { Compute: &corerp.KubernetesCompute{ Namespace: to.Ptr("defaultNamespace"), }, - // This flag will be removed in the upcoming PR. - UseDevRecipes: to.Ptr(false), - Providers: buildProviders(tc.azureProvider, tc.awsProvider), - Recipes: tc.recipes, + Providers: buildProviders(tc.azureProvider, tc.awsProvider), + Recipes: tc.recipes, } appManagementClient.EXPECT(). CreateEnvironment(context.Background(), "default", v1.LocationGlobal, testEnvProperties). diff --git a/pkg/cli/cmd/recipe/register/register.go b/pkg/cli/cmd/recipe/register/register.go index 78c884d13f..93d4087481 100644 --- a/pkg/cli/cmd/recipe/register/register.go +++ b/pkg/cli/cmd/recipe/register/register.go @@ -125,6 +125,7 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { if err != nil { return err } + return nil } @@ -134,6 +135,7 @@ func (r *Runner) Run(ctx context.Context) error { if err != nil { return err } + envResource, err := client.GetEnvDetails(ctx, r.Workspace.Environment) if err != nil { return err @@ -171,6 +173,6 @@ func requireTemplatePath(cmd *cobra.Command) (string, error) { if err != nil { return templatePath, err } - return templatePath, nil + return templatePath, nil } diff --git a/pkg/cli/cmd/recipe/register/register_test.go b/pkg/cli/cmd/recipe/register/register_test.go index 9b1d28dbb5..3a42c2c6fc 100644 --- a/pkg/cli/cmd/recipe/register/register_test.go +++ b/pkg/cli/cmd/recipe/register/register_test.go @@ -7,6 +7,8 @@ package register import ( "context" + "errors" + "fmt" "testing" "github.com/golang/mock/gomock" @@ -111,8 +113,7 @@ func Test_Run(t *testing.T) { } testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), - Recipes: testRecipes, + Recipes: testRecipes, Compute: &v20220315privatepreview.KubernetesCompute{ Namespace: to.Ptr("default"), }, @@ -145,14 +146,108 @@ func Test_Run(t *testing.T) { RecipeName: "cosmosDB_new", } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully linked recipe %q to environment %q ", + Params: []interface{}{ + "cosmosDB_new", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) + + t.Run("Register recipe Failure", func(t *testing.T) { + ctrl := gomock.NewController(t) + + testRecipes := map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ + linkrp.MongoDatabasesResourceType: { + "cosmosDB": { + TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), + }, + }, + } + + testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ + Recipes: testRecipes, + Compute: &v20220315privatepreview.KubernetesCompute{ + Namespace: to.Ptr("default"), + }, + } + + envResource := v20220315privatepreview.EnvironmentResource{ + ID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind"), + Name: to.Ptr("kind-kind"), + Type: to.Ptr("applications.core/environments"), + Location: to.Ptr(v1.LocationGlobal), + Properties: testEnvProperties, + } + + expectedError := errors.New("failed to register recipe to the environment") + expectedErrorMessage := fmt.Sprintf("failed to register the recipe %s to the environment %s: %s", "cosmosDB_new", + "/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind", expectedError.Error()) + + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) + appManagementClient.EXPECT(). + GetEnvDetails(gomock.Any(), gomock.Any()). + Return(envResource, nil). + Times(1) + appManagementClient.EXPECT(). + CreateEnvironment(context.Background(), "kind-kind", v1.LocationGlobal, testEnvProperties). + Return(false, expectedError). + Times(1) + + outputSink := &output.MockOutput{} + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + Output: outputSink, + Workspace: &workspaces.Workspace{Environment: "kind-kind"}, + TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", + LinkType: linkrp.MongoDatabasesResourceType, + RecipeName: "cosmosDB_new", + } + + err := runner.Run(context.Background()) + require.Error(t, err) + require.Equal(t, expectedErrorMessage, err.Error()) + }) + + t.Run("Failure Getting Environment Details", func(t *testing.T) { + ctrl := gomock.NewController(t) + + expectedError := errors.New("failed to get environment details") + + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) + appManagementClient.EXPECT(). + GetEnvDetails(gomock.Any(), gomock.Any()). + Return(v20220315privatepreview.EnvironmentResource{}, expectedError). + Times(1) + + outputSink := &output.MockOutput{} + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + Output: outputSink, + Workspace: &workspaces.Workspace{Environment: "kind-kind"}, + TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", + LinkType: linkrp.MongoDatabasesResourceType, + RecipeName: "cosmosDB_new", + } + + err := runner.Run(context.Background()) + require.Error(t, err) + require.Equal(t, expectedError, err) + }) + t.Run("Register recipe with parameters", func(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "cosmosDB": { @@ -162,7 +257,9 @@ func Test_Run(t *testing.T) { }, }, Compute: &v20220315privatepreview.KubernetesCompute{ - Namespace: to.Ptr("default"), + Kind: to.Ptr("kubernetes"), + Namespace: to.Ptr("default"), + ResourceID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind/compute/kubernetes"), }, } @@ -194,14 +291,24 @@ func Test_Run(t *testing.T) { Parameters: map[string]map[string]any{}, } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully linked recipe %q to environment %q ", + Params: []interface{}{ + "redis", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) t.Run("Register recipe with no namespace", func(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "cosmosDB": { @@ -237,9 +344,21 @@ func Test_Run(t *testing.T) { RecipeName: "cosmosDB_no_namespace", } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully linked recipe %q to environment %q ", + Params: []interface{}{ + "cosmosDB_no_namespace", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) + t.Run("Register the first recipe", func(t *testing.T) { ctrl := gomock.NewController(t) @@ -276,7 +395,18 @@ func Test_Run(t *testing.T) { RecipeName: "redis", } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully linked recipe %q to environment %q ", + Params: []interface{}{ + "redis", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) } diff --git a/pkg/cli/cmd/recipe/unregister/unregister_test.go b/pkg/cli/cmd/recipe/unregister/unregister_test.go index c2eeb1df2f..6bc1cc9dce 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister_test.go +++ b/pkg/cli/cmd/recipe/unregister/unregister_test.go @@ -7,6 +7,8 @@ package unregister import ( "context" + "errors" + "fmt" "testing" "github.com/golang/mock/gomock" @@ -86,7 +88,6 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "cosmosDB": { @@ -125,14 +126,78 @@ func Test_Run(t *testing.T) { LinkType: "Applications.Link/mongoDatabases", } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully unregistered recipe %q from environment %q ", + Params: []interface{}{ + "cosmosDB", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) + + t.Run("Failure", func(t *testing.T) { + ctrl := gomock.NewController(t) + + testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ + Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ + linkrp.MongoDatabasesResourceType: { + "cosmosDB": { + TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), + }, + }, + }, + Compute: &v20220315privatepreview.KubernetesCompute{ + Namespace: to.Ptr("default"), + }, + } + + envResource := v20220315privatepreview.EnvironmentResource{ + ID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind"), + Name: to.Ptr("kind-kind"), + Type: to.Ptr("applications.core/environments"), + Location: to.Ptr(v1.LocationGlobal), + Properties: testEnvProperties, + } + + expectedError := errors.New("failed to unregister recipe from the environment") + expectedErrorMessage := fmt.Sprintf("failed to unregister the recipe %s from the environment %s: %s", "cosmosDB", + "/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind", expectedError.Error()) + + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) + appManagementClient.EXPECT(). + GetEnvDetails(gomock.Any(), gomock.Any()). + Return(envResource, nil). + Times(1) + appManagementClient.EXPECT(). + CreateEnvironment(context.Background(), "kind-kind", v1.LocationGlobal, testEnvProperties). + Return(false, expectedError). + Times(1) + + outputSink := &output.MockOutput{} + + runner := &Runner{ + ConnectionFactory: &connections.MockFactory{ApplicationsManagementClient: appManagementClient}, + Output: outputSink, + Workspace: &workspaces.Workspace{Environment: "kind-kind"}, + RecipeName: "cosmosDB", + LinkType: "Applications.Link/mongoDatabases", + } + + err := runner.Run(context.Background()) + require.Error(t, err) + require.Equal(t, expectedErrorMessage, err.Error()) + }) + t.Run("No Namespace", func(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "cosmosDB": { @@ -168,9 +233,21 @@ func Test_Run(t *testing.T) { LinkType: "Applications.Link/mongoDatabases", } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully unregistered recipe %q from environment %q ", + Params: []interface{}{ + "cosmosDB", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) + t.Run("Unregister recipe that doesn't exist in the environment", func(t *testing.T) { ctrl := gomock.NewController(t) @@ -180,7 +257,6 @@ func Test_Run(t *testing.T) { Type: to.Ptr("applications.core/environments"), Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "cosmosDB": { @@ -209,6 +285,7 @@ func Test_Run(t *testing.T) { err := runner.Run(context.Background()) require.Error(t, err) }) + t.Run("Unregister recipe with linkType doesn't exist in the environment", func(t *testing.T) { ctrl := gomock.NewController(t) envResource := v20220315privatepreview.EnvironmentResource{ @@ -217,7 +294,6 @@ func Test_Run(t *testing.T) { Type: to.Ptr("applications.core/environments"), Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "testResource": { @@ -246,17 +322,16 @@ func Test_Run(t *testing.T) { err := runner.Run(context.Background()) require.Error(t, err) }) + t.Run("Unregister recipe with no recipes added to the environment", func(t *testing.T) { ctrl := gomock.NewController(t) envResource := v20220315privatepreview.EnvironmentResource{ - ID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind"), - Name: to.Ptr("kind-kind"), - Type: to.Ptr("applications.core/environments"), - Location: to.Ptr(v1.LocationGlobal), - Properties: &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), - }, + ID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind"), + Name: to.Ptr("kind-kind"), + Type: to.Ptr("applications.core/environments"), + Location: to.Ptr(v1.LocationGlobal), + Properties: &v20220315privatepreview.EnvironmentProperties{}, } appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) @@ -277,11 +352,11 @@ func Test_Run(t *testing.T) { err := runner.Run(context.Background()) require.Error(t, err) }) + t.Run("Unregister recipe with same name for different resource types.", func(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - UseDevRecipes: to.Ptr(true), Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ linkrp.MongoDatabasesResourceType: { "testResource": { @@ -325,8 +400,19 @@ func Test_Run(t *testing.T) { LinkType: "Applications.Link/mongoDatabases", } + expectedOutput := []any{ + output.LogOutput{ + Format: "Successfully unregistered recipe %q from environment %q ", + Params: []interface{}{ + "testResource", + "kind-kind", + }, + }, + } + err := runner.Run(context.Background()) require.NoError(t, err) + require.Equal(t, expectedOutput, outputSink.Writes) }) }) } diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go index becbc83878..51ced4eb13 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go @@ -38,9 +38,7 @@ func (src *EnvironmentResource) ConvertTo() (v1.DataModelInterface, error) { AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), }, }, - Properties: datamodel.EnvironmentProperties{ - UseDevRecipes: to.Bool(src.Properties.UseDevRecipes), - }, + Properties: datamodel.EnvironmentProperties{}, } envCompute, err := toEnvironmentComputeDataModel(src.Properties.Compute) @@ -119,7 +117,6 @@ func (dst *EnvironmentResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(env.Tags) dst.Properties = &EnvironmentProperties{ ProvisioningState: fromProvisioningStateDataModel(env.InternalMetadata.AsyncProvisioningState), - UseDevRecipes: to.Ptr(env.Properties.UseDevRecipes), } dst.Properties.Compute = fromEnvironmentComputeDataModel(&env.Properties.Compute) diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index 0d5392e746..8409b9ce8f 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -544,9 +544,6 @@ type EnvironmentProperties struct { // Specifies Recipes linked to the Environment. Recipes map[string]map[string]*EnvironmentRecipeProperties `json:"recipes,omitempty"` - // Flag to use radius owned recipes. - UseDevRecipes *bool `json:"useDevRecipes,omitempty"` - // READ-ONLY; Provisioning state of the environment at the time the operation was called. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index d58bbc25de..1b1e120d5c 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -851,7 +851,6 @@ func (e EnvironmentProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "providers", e.Providers) populate(objectMap, "provisioningState", e.ProvisioningState) populate(objectMap, "recipes", e.Recipes) - populate(objectMap, "useDevRecipes", e.UseDevRecipes) return json.Marshal(objectMap) } @@ -879,9 +878,6 @@ func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error { case "recipes": err = unpopulate(val, "Recipes", &e.Recipes) delete(rawMsg, key) - case "useDevRecipes": - err = unpopulate(val, "UseDevRecipes", &e.UseDevRecipes) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) diff --git a/pkg/corerp/datamodel/environment.go b/pkg/corerp/datamodel/environment.go index 6592f4f0cd..1896150747 100644 --- a/pkg/corerp/datamodel/environment.go +++ b/pkg/corerp/datamodel/environment.go @@ -26,11 +26,10 @@ func (e *Environment) ResourceTypeName() string { // EnvironmentProperties represents the properties of Environment. type EnvironmentProperties struct { - Compute rpv1.EnvironmentCompute `json:"compute,omitempty"` - Recipes map[string]map[string]EnvironmentRecipeProperties `json:"recipes,omitempty"` - Providers Providers `json:"providers,omitempty"` - UseDevRecipes bool `json:"useDevRecipes,omitempty"` - Extensions []Extension `json:"extensions,omitempty"` + Compute rpv1.EnvironmentCompute `json:"compute,omitempty"` + Recipes map[string]map[string]EnvironmentRecipeProperties `json:"recipes,omitempty"` + Providers Providers `json:"providers,omitempty"` + Extensions []Extension `json:"extensions,omitempty"` } // EnvironmentRecipeProperties represents the properties of environment's recipe. diff --git a/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go b/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go index f855e5d78a..329bdf0550 100644 --- a/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go +++ b/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go @@ -9,8 +9,6 @@ import ( "context" "fmt" "net/http" - "strconv" - "strings" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" @@ -18,11 +16,6 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/datamodel/converter" "github.com/project-radius/radius/pkg/corerp/frontend/controller/util" - "github.com/project-radius/radius/pkg/linkrp" - recipe "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "golang.org/x/exp/slices" - "oras.land/oras-go/v2/registry/remote" ) var _ ctrl.Controller = (*CreateOrUpdateEnvironment)(nil) @@ -64,33 +57,6 @@ func (e *CreateOrUpdateEnvironment) Run(ctx context.Context, w http.ResponseWrit return rest.NewBadRequestResponse(err.Error()), nil } - // Update Recipes mapping with dev recipes. - if newResource.Properties.UseDevRecipes { - devRecipes, err := getDevRecipes(ctx) - if err != nil { - return nil, err - } - newResourceRecipes := newResource.Properties.Recipes - if newResourceRecipes != nil { - // validate that if the input recipe name is present in dev recipes and overwrite it with the new recipe details if present else add it to the recipe list. - for resourceType, recipes := range devRecipes { - if devRecipes[resourceType] != nil { - for recipeName, recipeDetails := range recipes { - if newResourceRecipes[resourceType] != nil { - if _, ok := newResourceRecipes[resourceType][recipeName]; !ok { - newResourceRecipes[resourceType][recipeName] = recipeDetails - } - } else { - newResourceRecipes[resourceType] = recipes - } - } - } - } - } else { - newResource.Properties.Recipes = devRecipes - } - } - // Create Query filter to query kubernetes namespace used by the other environment resources. namespace := newResource.Properties.Compute.KubernetesCompute.Namespace result, err := util.FindResources(ctx, serviceCtx.ResourceID.RootScope(), serviceCtx.ResourceID.Type(), "properties.compute.kubernetes.namespace", namespace, e.StorageClient()) @@ -119,101 +85,3 @@ func (e *CreateOrUpdateEnvironment) Run(ctx context.Context, w http.ResponseWrit return e.ConstructSyncResponse(ctx, req.Method, newEtag, newResource) } - -var getDevRecipes = func(ctx context.Context) (map[string]map[string]datamodel.EnvironmentRecipeProperties, error) { - recipes := map[string]map[string]datamodel.EnvironmentRecipeProperties{} - - logger := ucplog.FromContextOrDiscard(ctx) - reg, err := remote.NewRegistry(DevRecipesACRPath) - if err != nil { - return nil, fmt.Errorf("failed to create client to registry %s - %s", DevRecipesACRPath, err.Error()) - } - - // if repository has the correct path it should look like: /recipes// - err = reg.Repositories(ctx, "", func(repos []string) error { - for _, repo := range repos { - link, provider := parseRepoPathForMetadata(repo) - if link != "" && provider != "" { - if slices.Contains(supportedProviders(), provider) { - var name string - var linkType string - // TODO: this needs to metadata driven per-recipe so we don't have to maintain a lookup - // table. - switch link { - case "mongodatabases": - name = "mongo" + "-" + provider - linkType = linkrp.MongoDatabasesResourceType - case "rediscaches": - name = "redis" + "-" + provider - linkType = linkrp.RedisCachesResourceType - default: - continue - } - repoPath := DevRecipesACRPath + "/" + repo - repoClient, err := remote.NewRepository(repoPath) - if err != nil { - return fmt.Errorf("failed to create client to repository %s - %s", repoPath, err.Error()) - } - - // for a given repository, list the tags and identify what the latest version of the repo is - // for now, only the latest verision of the repo is linked to the environment - err = repoClient.Tags(ctx, "", func(tags []string) error { - version, err := findHighestVersion(tags) - if err != nil { - return fmt.Errorf("error occurred while finding highest version for repo %s - %s", repoPath, err.Error()) - } - recipes[linkType] = map[string]datamodel.EnvironmentRecipeProperties{ - name: { - TemplateKind: recipe.TemplateKindBicep, // TODO revisit how do we plan to support dev recipes for multiple formats - TemplatePath: repoPath + ":" + fmt.Sprintf("%.1f", version), - }, - } - return nil - }) - if err != nil { - return fmt.Errorf("failed to list tags for repository %s - %s", repoPath, err.Error()) - } - } - } - } - - logger.Info(fmt.Sprintf("pulled %d dev recipes", len(recipes))) - - // This function never returns an error as we currently silently continue on any repositories that don't have the path pattern specified. - // It has a definition that specifies an error is returned to match the definition defined by reg.Repositories. - return nil - }) - - if err != nil { - return nil, fmt.Errorf("failed to list recipes available in registry at path %s - %s", DevRecipesACRPath, err.Error()) - } - - return recipes, nil -} - -func parseRepoPathForMetadata(repo string) (link, provider string) { - if strings.HasPrefix(repo, "recipes/") { - recipePath := strings.Split(repo, "recipes/")[1] - if strings.Count(recipePath, "/") == 1 { - link, provider := strings.Split(recipePath, "/")[0], strings.Split(recipePath, "/")[1] - return link, provider - } - } - - return link, provider -} - -func findHighestVersion(versions []string) (latest float64, err error) { - for _, version := range versions { - f, err := strconv.ParseFloat(version, 32) - if err != nil { - return 0.0, fmt.Errorf("unable to convert tag %s into valid version.", version) - } - - if f > latest { - latest = f - } - } - - return latest, nil -} diff --git a/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go b/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go index 841b133865..f8b9b0ab65 100644 --- a/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go +++ b/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go @@ -15,10 +15,6 @@ import ( ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/store" "github.com/project-radius/radius/test/testutil" @@ -396,400 +392,4 @@ func TestCreateOrUpdateEnvironmentRun_20220315PrivatePreview(t *testing.T) { require.Equal(t, tt.expectedStatusCode, w.Result().StatusCode) }) } - -} - -var mockgetDevRecipes = func(ctx context.Context) (map[string]map[string]datamodel.EnvironmentRecipeProperties, error) { - - recipes := map[string]map[string]datamodel.EnvironmentRecipeProperties{ - linkrp.RedisCachesResourceType: { - "redis-kubernetes": { - TemplateKind: recipes.TemplateKindBicep, - TemplatePath: "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0", - }, - }, - linkrp.MongoDatabasesResourceType: { - "mongo-azure": { - TemplateKind: recipes.TemplateKindBicep, - TemplatePath: "radius.azurecr.io/recipes/mongodatabases/azure:1.0", - }, - }, - } - return recipes, nil -} - -func TestCreateOrUpdateRunDevRecipes(t *testing.T) { - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mStorageClient := store.NewMockStorageClient(mctrl) - ctx := context.Background() - - t.Run("Add dev recipes successfully", func(t *testing.T) { - getDevRecipes = mockgetDevRecipes - envInput, envDataModel, expectedOutput := getTestModelsWithDevRecipes20220315privatepreview() - w := httptest.NewRecorder() - req, _ := testutil.GetARMTestHTTPRequest(ctx, http.MethodGet, testHeaderfile, envInput) - ctx := testutil.ARMTestContextFromRequest(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{} - }) - mStorageClient. - EXPECT(). - Query(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, query store.Query, options ...store.QueryOptions) (*store.ObjectQueryResult, error) { - return &store.ObjectQueryResult{ - Items: []store.Object{}, - }, nil - }) - - expectedOutput.SystemData.CreatedAt = expectedOutput.SystemData.LastModifiedAt - expectedOutput.SystemData.CreatedBy = expectedOutput.SystemData.LastModifiedBy - expectedOutput.SystemData.CreatedByType = expectedOutput.SystemData.LastModifiedByType - - mStorageClient. - EXPECT(). - Save(gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, obj *store.Object, opts ...store.SaveOptions) error { - obj.ETag = "new-resource-etag" - obj.Data = envDataModel - return nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewCreateOrUpdateEnvironment(opts) - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - actualOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - require.Equal(t, expectedOutput, actualOutput) - }) - - t.Run("Append dev recipes to user recipes successfully", func(t *testing.T) { - envInput, envDataModel, expectedOutput := getTestModelsAppendDevRecipes20220315privatepreview() - w := httptest.NewRecorder() - req, _ := testutil.GetARMTestHTTPRequest(ctx, http.MethodGet, testHeaderfile, envInput) - ctx := testutil.ARMTestContextFromRequest(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{} - }) - mStorageClient. - EXPECT(). - Query(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, query store.Query, options ...store.QueryOptions) (*store.ObjectQueryResult, error) { - return &store.ObjectQueryResult{ - Items: []store.Object{}, - }, nil - }) - - expectedOutput.SystemData.CreatedAt = expectedOutput.SystemData.LastModifiedAt - expectedOutput.SystemData.CreatedBy = expectedOutput.SystemData.LastModifiedBy - expectedOutput.SystemData.CreatedByType = expectedOutput.SystemData.LastModifiedByType - - mStorageClient. - EXPECT(). - Save(gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, obj *store.Object, opts ...store.SaveOptions) error { - obj.ETag = "new-resource-etag" - obj.Data = envDataModel - return nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewCreateOrUpdateEnvironment(opts) - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - actualOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - require.Equal(t, expectedOutput, actualOutput) - }) - - t.Run("Append dev recipes and user recipes to existing user recipes successfully", func(t *testing.T) { - envExistingDataModel, envInput, envDataModel, expectedOutput := getTestModelsAppendDevRecipesToExisting20220315privatepreview() - w := httptest.NewRecorder() - req, _ := testutil.GetARMTestHTTPRequest(ctx, http.MethodGet, testHeaderfile, envInput) - ctx := testutil.ARMTestContextFromRequest(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (res *store.Object, err error) { - return &store.Object{ - Metadata: store.Metadata{ID: id, ETag: "existing-data-model"}, - Data: envExistingDataModel, - }, nil - }) - mStorageClient. - EXPECT(). - Query(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, query store.Query, options ...store.QueryOptions) (*store.ObjectQueryResult, error) { - return &store.ObjectQueryResult{ - Items: []store.Object{}, - }, nil - }) - - mStorageClient. - EXPECT(). - Save(gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, obj *store.Object, opts ...store.SaveOptions) error { - obj.ETag = "new-resource-etag" - obj.Data = envDataModel - return nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewCreateOrUpdateEnvironment(opts) - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - actualOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - require.Equal(t, expectedOutput, actualOutput) - }) - - t.Run("User recipes conflict with dev recipe names", func(t *testing.T) { - envInput, envDataModel, expectedOutput := getTestModelsUserRecipesConflictWithDevRecipes20220315privatepreview() - w := httptest.NewRecorder() - req, _ := testutil.GetARMTestHTTPRequest(ctx, http.MethodGet, testHeaderfile, envInput) - ctx := testutil.ARMTestContextFromRequest(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{} - }) - mStorageClient. - EXPECT(). - Query(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, query store.Query, options ...store.QueryOptions) (*store.ObjectQueryResult, error) { - return &store.ObjectQueryResult{ - Items: []store.Object{}, - }, nil - }) - mStorageClient. - EXPECT(). - Save(gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, obj *store.Object, opts ...store.SaveOptions) error { - obj.ETag = "new-resource-etag" - obj.Data = envDataModel - return nil - }) - - expectedOutput.SystemData.CreatedAt = expectedOutput.SystemData.LastModifiedAt - expectedOutput.SystemData.CreatedBy = expectedOutput.SystemData.LastModifiedBy - expectedOutput.SystemData.CreatedByType = expectedOutput.SystemData.LastModifiedByType - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewCreateOrUpdateEnvironment(opts) - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - actualOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - require.Equal(t, expectedOutput, actualOutput) - }) - t.Run("test input recipes that has dev recipes", func(t *testing.T) { - envInput := &v20220315privatepreview.EnvironmentResource{ - Location: to.Ptr("West US"), - Properties: &v20220315privatepreview.EnvironmentProperties{ - Compute: &v20220315privatepreview.KubernetesCompute{ - Kind: to.Ptr("kubernetes"), - ResourceID: to.Ptr("fakeid"), - Namespace: to.Ptr("default"), - }, - UseDevRecipes: to.Ptr(true), - Providers: &v20220315privatepreview.Providers{ - Azure: &v20220315privatepreview.ProvidersAzure{ - Scope: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg"), - }, - }, - Recipes: map[string]map[string]*v20220315privatepreview.EnvironmentRecipeProperties{ - linkrp.RedisCachesResourceType: { - "redis": { - TemplateKind: to.Ptr(recipes.TemplateKindBicep), - TemplatePath: to.Ptr("radiusdev.azurecr.io/redis:1.0"), - }, - "redis-kubernetes": { - TemplateKind: to.Ptr(recipes.TemplateKindBicep), - TemplatePath: to.Ptr("radius.azurecr.io/recipes/rediscaches/kubernetes:1.0"), - }, - }, - linkrp.MongoDatabasesResourceType: { - "mongo-azure": { - TemplateKind: to.Ptr(recipes.TemplateKindBicep), - TemplatePath: to.Ptr("radius.azurecr.io/recipes/mongodatabases/azure:1.0"), - }, - }, - }, - }, - } - rawExpectedOutput := testutil.ReadFixture("environmentappenddevrecipes20220315privatepreview_output.json") - expectedOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawExpectedOutput, expectedOutput) - - rawDataModel := testutil.ReadFixture("environmentappenddevrecipes20220315privatepreview_datamodel.json") - envDataModel := &datamodel.Environment{} - _ = json.Unmarshal(rawDataModel, envDataModel) - - w := httptest.NewRecorder() - req, _ := testutil.GetARMTestHTTPRequest(ctx, http.MethodGet, testHeaderfile, envInput) - ctx := testutil.ARMTestContextFromRequest(req) - - expectedOutput.SystemData.CreatedAt = expectedOutput.SystemData.LastModifiedAt - expectedOutput.SystemData.CreatedBy = expectedOutput.SystemData.LastModifiedBy - expectedOutput.SystemData.CreatedByType = expectedOutput.SystemData.LastModifiedByType - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{} - }) - mStorageClient. - EXPECT(). - Query(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, query store.Query, options ...store.QueryOptions) (*store.ObjectQueryResult, error) { - return &store.ObjectQueryResult{ - Items: []store.Object{}, - }, nil - }) - mStorageClient. - EXPECT(). - Save(gomock.Any(), gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, obj *store.Object, opts ...store.SaveOptions) error { - obj.ETag = "new-resource-etag" - obj.Data = envDataModel - return nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewCreateOrUpdateEnvironment(opts) - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - actualOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - require.Equal(t, expectedOutput, actualOutput) - }) - -} - -// Commenting the test as getDevRecipes fetches the recipes from the acr and compares it to the expectedRecipes. -// If a new recipe is added to the acr the test will fail. -/*func TestGetDevRecipes(t *testing.T) { - t.Run("Successfully returns dev recipes", func(t *testing.T) { - ctx := context.Background() - devRecipes, err := getDevRecipes(ctx) - require.NoError(t, err) - expectedRecipes := map[string]datamodel.EnvironmentRecipeProperties{ - "mongo-azure": { - LinkType: linkrp.MongoDatabasesResourceType, - TemplatePath: "radius.azurecr.io/recipes/mongodatabases/azure:1.0", - }, - "redis-kubernetes": { - LinkType: linkrp.RedisCachesResourceType, - TemplatePath: "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0", - }, - } - require.Equal(t, devRecipes, expectedRecipes) - }) -}*/ - -func TestParseRepoPathForMetadata(t *testing.T) { - t.Run("Successfully returns metadata", func(t *testing.T) { - link, provider := parseRepoPathForMetadata("recipes/linkName/providerName") - require.Equal(t, "linkName", link) - require.Equal(t, "providerName", provider) - }) - - tests := []struct { - name string - repo string - expectedLink string - expectedProvider string - }{ - { - "Repo isn't related to recipes", - "randomRepo", - "", - "", - }, - { - "Repo for recipes doesn't have link and provider names", - "recipes/noLinkAndProvider", - "", - "", - }, - { - "Repo for recipes has extra path component", - "recipes/link/provider/randomValue", - "", - "", - }, - { - "Repo name has a link and no provider", - "recipes/linkName/", - "linkName", - "", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - link, provider := parseRepoPathForMetadata(tt.repo) - require.Equal(t, tt.expectedLink, link) - require.Equal(t, tt.expectedProvider, provider) - }) - } -} - -func TestFindHighestVersion(t *testing.T) { - t.Run("Max version is returned when tags are int/float values with float max", func(t *testing.T) { - versions := []string{"1", "2", "3", "4.0"} - max, err := findHighestVersion(versions) - require.NoError(t, err) - require.Equal(t, max, 4.0) - }) - t.Run("Max version is returned when tags are int/float values with int max", func(t *testing.T) { - versions := []string{"1.0", "2.0", "3.0", "4"} - max, err := findHighestVersion(versions) - require.NoError(t, err) - require.Equal(t, max, 4.0) - }) - t.Run("Version tags are not all float values", func(t *testing.T) { - versions := []string{"1.0", "otherTag", "3.0", "4.0"} - _, err := findHighestVersion(versions) - require.ErrorContains(t, err, "unable to convert tag otherTag into valid version.") - }) } diff --git a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json index 8d7fc01d38..01b02372ea 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json @@ -20,7 +20,6 @@ "namespace": "default" } }, - "useDevRecipes": false, "recipes": { "Applications.Link/mongoDatabases":{ "mongo-azure": { diff --git a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json index c369963d24..ce5e238e83 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json @@ -6,7 +6,6 @@ "resourceId": "fakeid", "namespace": "default" }, - "useDevRecipes": false, "recipes": { "Applications.Link/mongoDatabases":{ "mongo-azure": { diff --git a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json index 93cee838f3..7fda8a0eea 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json @@ -24,7 +24,6 @@ } } }, - "useDevRecipes": false, "provisioningState": "Succeeded" }, "systemData": { diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_datamodel.json deleted file mode 100644 index 1c5577914e..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_datamodel.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "name": "env0", - "type": "applications.core/environments", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "provisioningState": "Succeeded", - "properties": { - "compute": { - "kind": "kubernetes", - "kubernetes": { - "resourceId": "fakeid", - "namespace": "default" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/mongodatabases/azure:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/redis:1.0" - }, - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_input.json deleted file mode 100644 index 45cc691720..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_input.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "location": "West US", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "recipes": { - "Applications.Link/redisCaches":{ - "redis": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/redis:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - } -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_output.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_output.json deleted file mode 100644 index 2ea90f0521..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipes20220315privatepreview_output.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "location": "West US", - "name": "env0", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/mongodatabases/azure:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/redis:1.0" - }, - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - } - }, - "useDevRecipes": true, - "provisioningState": "Succeeded" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/environments" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_datamodel.json deleted file mode 100644 index 8fa5a3b97e..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_datamodel.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "name": "env0", - "type": "applications.core/environments", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "provisioningState": "Succeeded", - "properties": { - "compute": { - "kind": "kubernetes", - "kubernetes": { - "resourceId": "fakeid", - "namespace": "default" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/mongodatabases/azure:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/redis:1.0" - }, - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - }, - "Applications.Link/sqlDatabases":{ - "sql": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/sql:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_input.json deleted file mode 100644 index 0399d0996a..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_input.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "location": "West US", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "recipes": { - "Applications.Link/redisCaches":{ - "redis": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/redis:1.0" - } - }, - "Applications.Link/sqlDatabases":{ - "sql": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/sql:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - } -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_output.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_output.json deleted file mode 100644 index 8f4870b901..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexisting20220315privatepreview_output.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "location": "West US", - "name": "env0", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/mongodatabases/azure:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/redis:1.0" - }, - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - }, - "Applications.Link/sqlDatabases":{ - "sql": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/sql:1.0" - } - } - }, - "useDevRecipes": true, - "provisioningState": "Succeeded" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/environments" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexistingoriginal20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexistingoriginal20220315privatepreview_datamodel.json deleted file mode 100644 index 863ca75afe..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentappenddevrecipestoexistingoriginal20220315privatepreview_datamodel.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "name": "env0", - "type": "applications.core/environments", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "provisioningState": "Succeeded", - "properties": { - "compute": { - "kind": "kubernetes", - "kubernetes": { - "resourceId": "fakeid", - "namespace": "default" - } - }, - "recipes": { - "Applications.Link/sqlDatabases":{ - "sql": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/sql:1.0" - } - } - }, - "useDevRecipes": false, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json index 08e72d200f..e0d41dc1c6 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json @@ -20,7 +20,6 @@ "namespace": "default" } }, - "useDevRecipes": false, "recipes": { "Applications.Link/mongoDatabases":{ "mongo-parameters": { diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_datamodel.json deleted file mode 100644 index 0c6e19a36f..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_datamodel.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "name": "env0", - "type": "applications.core/environments", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "provisioningState": "Succeeded", - "properties": { - "compute": { - "kind": "kubernetes", - "kubernetes": { - "resourceId": "fakeid", - "namespace": "default" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/test/mongo:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_input.json deleted file mode 100644 index 5d1edce952..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_input.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "location": "West US", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/test/mongo:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - } -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_output.json b/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_output.json deleted file mode 100644 index 2092d7cef3..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentuserrecipesconflictwithdevrecipes20220315privatepreview_output.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "location": "West US", - "name": "env0", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radiusdev.azurecr.io/test/mongo:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - } - }, - "useDevRecipes": true, - "provisioningState": "Succeeded" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/environments" - } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_datamodel.json deleted file mode 100644 index a03b53980e..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_datamodel.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "name": "env0", - "type": "applications.core/environments", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "provisioningState": "Succeeded", - "properties": { - "compute": { - "kind": "kubernetes", - "kubernetes": { - "resourceId": "fakeid", - "namespace": "default" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/mongodatabases/azure:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - } - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_input.json deleted file mode 100644 index 58a7efecf5..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_input.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "location": "West US", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "useDevRecipes": true, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - } - } -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_output.json b/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_output.json deleted file mode 100644 index 3388ddb4f4..0000000000 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentwithdevrecipes20220315privatepreview_output.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/environments/env0", - "location": "West US", - "name": "env0", - "properties": { - "compute": { - "kind": "kubernetes", - "resourceId": "fakeid", - "namespace": "default" - }, - "providers": { - "azure": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg" - } - }, - "recipes": { - "Applications.Link/mongoDatabases":{ - "mongo-azure": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/mongodatabases/azure:1.0" - } - }, - "Applications.Link/redisCaches":{ - "redis-kubernetes": { - "templateKind": "bicep", - "templatePath": "radius.azurecr.io/recipes/rediscaches/kubernetes:1.0" - } - } - }, - "useDevRecipes": true, - "provisioningState": "Succeeded" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/environments" -} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/types.go b/pkg/corerp/frontend/controller/environments/types.go index 867a50b646..8b3f2777bd 100644 --- a/pkg/corerp/frontend/controller/environments/types.go +++ b/pkg/corerp/frontend/controller/environments/types.go @@ -6,16 +6,7 @@ package environments const ( - ResourceTypeName = "Applications.Core/environments" - DevRecipesACRPath = "radius.azurecr.io" + ResourceTypeName = "Applications.Core/environments" // User defined operation names OperationGetRecipeMetadata = "GETRECIPEMETADATA" ) - -// supportedProviders returns the list of "known" providers we understand for dev recipes. -// this is used as a filter to exclude non-matching repositories from the dev recipes registry. -// -// There is no effect on the execution of the recipe. -func supportedProviders() []string { - return []string{"aws", "azure", "kubernetes"} -} diff --git a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go index 0fc83e7a3c..2e77efd7dc 100644 --- a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go +++ b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go @@ -33,74 +33,6 @@ func getTestModels20220315privatepreview() (*v20220315privatepreview.Environment return envInput, envDataModel, expectedOutput } -func getTestModelsWithDevRecipes20220315privatepreview() (*v20220315privatepreview.EnvironmentResource, *datamodel.Environment, *v20220315privatepreview.EnvironmentResource) { - rawInput := testutil.ReadFixture("environmentwithdevrecipes20220315privatepreview_input.json") - envInput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawInput, envInput) - - rawDataModel := testutil.ReadFixture("environmentwithdevrecipes20220315privatepreview_datamodel.json") - envDataModel := &datamodel.Environment{} - _ = json.Unmarshal(rawDataModel, envDataModel) - - rawExpectedOutput := testutil.ReadFixture("environmentwithdevrecipes20220315privatepreview_output.json") - expectedOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawExpectedOutput, expectedOutput) - - return envInput, envDataModel, expectedOutput -} - -func getTestModelsAppendDevRecipes20220315privatepreview() (*v20220315privatepreview.EnvironmentResource, *datamodel.Environment, *v20220315privatepreview.EnvironmentResource) { - rawInput := testutil.ReadFixture("environmentappenddevrecipes20220315privatepreview_input.json") - envInput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawInput, envInput) - - rawDataModel := testutil.ReadFixture("environmentappenddevrecipes20220315privatepreview_datamodel.json") - envDataModel := &datamodel.Environment{} - _ = json.Unmarshal(rawDataModel, envDataModel) - - rawExpectedOutput := testutil.ReadFixture("environmentappenddevrecipes20220315privatepreview_output.json") - expectedOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawExpectedOutput, expectedOutput) - - return envInput, envDataModel, expectedOutput -} - -func getTestModelsAppendDevRecipesToExisting20220315privatepreview() (*datamodel.Environment, *v20220315privatepreview.EnvironmentResource, *datamodel.Environment, *v20220315privatepreview.EnvironmentResource) { - - rawExistingDataModel := testutil.ReadFixture("environmentappenddevrecipestoexistingoriginal20220315privatepreview_datamodel.json") - envExistingDataModel := &datamodel.Environment{} - _ = json.Unmarshal(rawExistingDataModel, envExistingDataModel) - - rawInput := testutil.ReadFixture("environmentappenddevrecipestoexisting20220315privatepreview_input.json") - envInput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawInput, envInput) - - rawDataModel := testutil.ReadFixture("environmentappenddevrecipestoexisting20220315privatepreview_datamodel.json") - envDataModel := &datamodel.Environment{} - _ = json.Unmarshal(rawDataModel, envDataModel) - - rawExpectedOutput := testutil.ReadFixture("environmentappenddevrecipestoexisting20220315privatepreview_output.json") - expectedOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawExpectedOutput, expectedOutput) - - return envExistingDataModel, envInput, envDataModel, expectedOutput -} - -func getTestModelsUserRecipesConflictWithDevRecipes20220315privatepreview() (*v20220315privatepreview.EnvironmentResource, *datamodel.Environment, *v20220315privatepreview.EnvironmentResource) { - rawInput := testutil.ReadFixture("environmentuserrecipesconflictwithdevrecipes20220315privatepreview_input.json") - envInput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawInput, envInput) - - rawDataModel := testutil.ReadFixture("environmentuserrecipesconflictwithdevrecipes20220315privatepreview_datamodel.json") - envDataModel := &datamodel.Environment{} - _ = json.Unmarshal(rawDataModel, envDataModel) - - rawExpectedOutput := testutil.ReadFixture("environmentuserrecipesconflictwithdevrecipes20220315privatepreview_output.json") - expectedOutput := &v20220315privatepreview.EnvironmentResource{} - _ = json.Unmarshal(rawExpectedOutput, expectedOutput) - return envInput, envDataModel, expectedOutput -} - func getTestModelsGetRecipeMetadata20220315privatepreview() (*v20220315privatepreview.Recipe, *datamodel.Environment, *v20220315privatepreview.EnvironmentRecipeProperties) { rawInput := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_input.json") envInput := &v20220315privatepreview.Recipe{} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json index 37d66815f5..a0f1b603a0 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json @@ -417,10 +417,6 @@ "$ref": "#/definitions/Providers", "description": "Cloud providers configuration for the environment." }, - "useDevRecipes": { - "type": "boolean", - "description": "Flag to use radius owned recipes." - }, "recipes": { "description": "Specifies Recipes linked to the Environment.", "additionalProperties": { diff --git a/test/functional/corerp/cli/testdata/corerp-resources-recipe-env.bicep b/test/functional/corerp/cli/testdata/corerp-resources-recipe-env.bicep index 8abca034d2..cd8cc25f7b 100644 --- a/test/functional/corerp/cli/testdata/corerp-resources-recipe-env.bicep +++ b/test/functional/corerp/cli/testdata/corerp-resources-recipe-env.bicep @@ -19,6 +19,5 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { } } } - useDevRecipes: true } }