-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[vme] Update vme list table format #8873
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
from knack.log import get_logger | ||
import time | ||
from azure.cli.core.commands.client_factory import get_subscription_id | ||
from datetime import datetime | ||
from ._client_factory import cf_deployments, cf_resources | ||
from azure.core.exceptions import ResourceNotFoundError | ||
|
||
|
@@ -35,7 +34,8 @@ def install_vme( | |
|
||
utils.check_and_add_cli_extension("connectedk8s") | ||
utils.check_and_add_cli_extension("k8s-extension") | ||
utils.check_and_enable_bundle_feature_flag(cluster, resource_group_name, cluster_name, kube_config, kube_context) | ||
utils.check_and_enable_bundle_feature_flag( | ||
cmd, subscription_id, cluster, resource_group_name, cluster_name, kube_config, kube_context) | ||
|
||
# Install the bundle extensions one by one | ||
for extension_type in include_extension_types: | ||
|
@@ -73,7 +73,8 @@ def install_vme( | |
print(f"Installed extension {extension_type} successfully.") | ||
print(result) | ||
|
||
print("All extensions installed successfully.") | ||
if len(include_extension_types) > 1: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider extracting the conditional summary logic into a helper function to eliminate duplicated code between install and uninstall flows. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
print("All extensions installed successfully.") | ||
|
||
|
||
def uninstall_vme( | ||
|
@@ -111,7 +112,8 @@ def uninstall_vme( | |
"--yes"] | ||
utils.call_subprocess_raise_output(command) | ||
print(f"Uninstalled extension {extension_type} successfully.") | ||
print("All extensions uninstalled successfully.") | ||
if len(include_extension_types) > 1: | ||
print("All extensions uninstalled successfully.") | ||
|
||
|
||
def upgrade_vme( | ||
|
@@ -136,7 +138,7 @@ def upgrade_vme( | |
|
||
utils.check_and_add_cli_extension("connectedk8s") | ||
utils.check_and_enable_bundle_feature_flag( | ||
cluster, resource_group_name, cluster_name, kube_config, kube_context) | ||
cmd, subscription_id, cluster, resource_group_name, cluster_name, kube_config, kube_context) | ||
deployment_name = (consts.ARC_UPDATE_PREFIX + cluster_name).lower() | ||
print(f"Checking arm template deployment '{deployment_name}' for '{cluster_resource_id}' " | ||
f"which has agent version '{agent_version}'") | ||
|
@@ -149,7 +151,7 @@ def upgrade_vme( | |
deployment = None | ||
while time.time() - start_time < wait_timeout: | ||
# Get current timestamp | ||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") | ||
timestamp = utils.get_utctimestring() | ||
try: | ||
deployment = client.get(resource_group_name, deployment_name) | ||
if (not deployment or not deployment.tags): | ||
|
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
To maintain compatibility with resources that use the old
version
property, consider falling back to it: e.g.,get('currentVersion', result.get('version', ''))
.Copilot uses AI. Check for mistakes.