-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make label validation optional for recipe functional tests #5530
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f8f37dc
adding skiplabelsvalidation flag to test step
vishwahiremat 72bda7c
adding kubernetes recipe for mongodb
vishwahiremat dd787ae
fixing nit
vishwahiremat 47db191
Trigger Build
vishwahiremat b9788dc
move skip_label_validation to pod level
vishwahiremat 0e149c0
Merge branch 'main' into vishwahiremat/skip_label_validation
vishwahiremat 1681ece
update acr to radiusacr
vishwahiremat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of skipping validation for whole steps, what if we skipped it for individual pods? That seems like a better fit for the scenario.
For example in this test we'd still validate the application container, but not the pod created by the recipe.