-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ContainerApp] Bug fix update container name #7623
[ContainerApp] Bug fix update container name #7623
Conversation
|
Hi @snehapar9 |
Thank you for catching that @Greedygre! Removed it |
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.
Okay
Please modify |
please resolve the code conflict |
please add test for this change to verify if it can meet your expectations |
Thanks, added test for this scenario and resolved conflicts. |
app = test_cls.cmd(f'containerapp show -g {resource_group} -n {name}').get_output_in_json() | ||
|
||
# Verify that the Container App has the correct environment variables | ||
test_cls.assertEqual(app["properties"]["template"]["containers"][0]["env"], [{"name": "testkey1", "value": "value1"}, {"name": "testkey2", "value": "value2"}]) |
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.
You can use checks=[]
to check the properties
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.
self.cmd('containerapp show -g {} -n {}'.format(resource_group, ca_name), checks=[
JMESPathCheck('length(properties.template.containers[0].env[?name==`testkey1`])', "value1")
])
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.
Updated.
app = test_cls.cmd(f'containerapp show -g {resource_group} -n {name}').get_output_in_json() | ||
|
||
# Verify that the Container App has the correct environment variables | ||
test_cls.assertEqual(app["properties"]["template"]["containers"][0]["env"], [{"name": "testkey1", "value": "value1"}, {"name": "testkey2", "value": "value2"}]) |
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.
Same as above
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.
Updated.
# Create and verify Container App using cloud build | ||
test_cls.cmd(f'containerapp create -g {resource_group} -n {name} --environment {env_name} --source \"{source_path}\" --env-vars "testkey1=value1" "testkey2=value2"') | ||
test_cls.cmd(f'containerapp show -g {resource_group} -n {name}', checks=[ | ||
JMESPathCheck('properties.template.containers[0].env', [{'name': 'testkey1', 'value': 'value1'}, {'name': 'testkey2', 'value': 'value2'}]) | ||
]) | ||
|
||
# Update and verify Container App using cloud build | ||
test_cls.cmd(f'containerapp update -g {resource_group} -n {name} --source \"{source_path}\"') | ||
test_cls.cmd(f'containerapp show -g {resource_group} -n {name}', checks=[ | ||
JMESPathCheck('properties.template.containers[0].env', [{'name': 'testkey1', 'value': 'value1'}, {'name': 'testkey2', 'value': 'value2'}]) | ||
]) |
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.
Seems you didn't check the container name? I think the container name is the what you want to check, right?
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
This PR ensures the container name is updated after running
update
in source to cloud flow.General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally? (pip install wheel==0.30.0
required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json
.