-
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] Support debug console #7945
base: main
Are you sure you want to change the base?
Conversation
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
containerapp debug | cmd containerapp debug added |
Hi @fangjian0423, |
Containerapp |
src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py
Outdated
Show resolved
Hide resolved
Recommend title: |
return "" | ||
|
||
def _get_url(self, cmd, resource_group_name, name, revision, replica, container, startup_command): | ||
containers = ContainerAppPreviewClient.get_replica(cmd, |
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.
is it possible to reuse the replica data we already loaded? seems like this will do another http call which is not that necessary
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.
the replica data we already loaded is in validation phase, seems it can't be reused here.
except Exception as e: | ||
stringErr = str(e) | ||
if "Handshake status 400 Bad Request" in stringErr: | ||
raise CLIInternalError("Debug Console feature is not allowed for the subscription.") |
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.
400 doesnt necessarily mean a feature flag issue. might be better to show detailed error messages or have an error code mapping
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.
the python websocket library didn't read response body if response code is not in (301, 302, 303 and 101). So we can't read the body and only can read 400 reponse code.
Given we will remove feature flag in the future, let me remove this logic.
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.
BTW, the newest websocket client support get response body: https://github.com/websocket-client/websocket-client/blob/master/websocket/_handshake.py#L146 . It is possible to upgrade websocket client in azure-cli-extension?
|
||
|
||
def _set_debug_defaults(cmd, namespace): | ||
app = ContainerAppPreviewClient.show(cmd, namespace.resource_group_name, namespace.name) |
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.
we can list revisions here and see: 1) if we got 404 error or None object then the container app doesnt exist 2) if we got an empty array then the container app exists but doesnt have any revisions
and the revision list data could be reused in checking user input parameter "targetContainer"
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.
IMO. List revisions will return all revision, this is not a good choice. If customer has lots of revisions, the payload will be big enough.
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.
normally the number of revisions in a single container app wont be too much. currently only 3.7% of container apps are in multiple active revision mode.
btw if you take a closer look at the container app payload and revision payload you will see container app is much larger than just a revision.
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.
It seems this API will return all the revisions, which are active or not active.
we have a discussion here: #7945 (comment) |
Feature doc: https://github.com/serverless-paas-balam/k4apps/discussions/4846
Some cases:
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
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
.