-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make label validation optional for recipe functional tests (#5530)
# Description Core RP adds "radius.dev/application", "radius.dev/resource" labels on Radius containers. These labels aren't required in customer recipes but test framework pod validation currently expects these to present. - Added SkipLabelsValidation flag to the test step, using that we can disable labels validation. ## Issue reference <!-- We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation. --> #5095 ## Checklist Please make sure you've completed the relevant tasks for this PR, out of the following list: * [x] Code compiles correctly * [ ] Adds necessary unit tests for change * [ ] Adds necessary E2E tests for change * [ ] Unit tests passing * [x] Extended the documentation / Created issue for it
- Loading branch information
1 parent
bb335a1
commit d1e2d4a
Showing
4 changed files
with
114 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
...functional/corerp/resources/testdata/recipes/test-recipes/mongodb-recipe-kubernetes.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import kubernetes as kubernetes { | ||
kubeConfig: '' | ||
namespace: context.runtime.kubernetes.namespace | ||
} | ||
|
||
param context object | ||
|
||
@description('Admin username for the Mongo database. Default is "admin"') | ||
param username string = 'admin' | ||
|
||
@description('Admin password for the Mongo database') | ||
@secure() | ||
param password string = newGuid() | ||
|
||
resource mongo 'apps/Deployment@v1' = { | ||
metadata: { | ||
name: 'mongo-recipe-resource' | ||
} | ||
spec: { | ||
selector: { | ||
matchLabels: { | ||
app: 'mongo' | ||
resource: context.resource.name | ||
} | ||
} | ||
template: { | ||
metadata: { | ||
labels: { | ||
app: 'mongo' | ||
resource: context.resource.name | ||
} | ||
} | ||
spec: { | ||
containers: [ | ||
{ | ||
name: 'mongo' | ||
image: 'mongo:4.2' | ||
ports: [ | ||
{ | ||
containerPort: 27017 | ||
} | ||
] | ||
env: [ | ||
{ | ||
name: 'MONGO_INITDB_ROOT_USERNAME' | ||
value: username | ||
} | ||
{ | ||
name: 'MONGO_INITDB_ROOT_PASSWORD' | ||
value: password | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource svc 'core/Service@v1' = { | ||
metadata: { | ||
name: 'mongo-recipe-svc' | ||
labels: { | ||
name: 'mongo-recipe-svc' | ||
} | ||
} | ||
spec: { | ||
type: 'ClusterIP' | ||
selector: { | ||
app: 'mongo' | ||
resource: context.resource.name | ||
} | ||
ports: [ | ||
{ | ||
port: 27017 | ||
} | ||
] | ||
} | ||
} | ||
|
||
output result object = { | ||
// This workaround is needed because the deployment engine omits Kubernetes resources from its output. | ||
// | ||
// Once this gap is addressed, users won't need to do this. | ||
resources: [ | ||
'/planes/kubernetes/local/namespaces/${svc.metadata.namespace}/providers/core/Service/${svc.metadata.name}' | ||
'/planes/kubernetes/local/namespaces/${mongo.metadata.namespace}/providers/apps/Deployment/${mongo.metadata.name}' | ||
] | ||
values: { | ||
host: '${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local' | ||
port: 27017 | ||
|
||
} | ||
secrets: { | ||
connectionString: 'mongodb://${username}:${password}@${svc.metadata.name}.${svc.metadata.namespace}.svc.cluster.local:27017' | ||
username: username | ||
password: password | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters