Conversation
Fleet extension
update live test
file clean up
|
fleet |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/AzurePipelines help |
Supported commands
See additional documentation. |
| def get_rg_location(ctx, resource_group_name, subscription_id=None): | ||
| groups = get_resource_groups_client(ctx, subscription_id=subscription_id) | ||
| # Just do the get, we don't need the result, it will error out if the group doesn't exist. | ||
| rg = groups.get(resource_group_name) | ||
| if rg is None: | ||
| raise CLIError(f"Resource group {resource_group_name} not found.") | ||
| return rg.location |
There was a problem hiding this comment.
Usually, we will expose location argument. If you went to get the default location from resource group, please refer this implementation. https://github.com/Azure/azure-cli/blob/76c224121c05f77f6cf6f17130b6c8fde824e10a/src/azure-cli/azure/cli/command_modules/monitor/_params.py#L412
There was a problem hiding this comment.
borrowed aks-preview implementation
https://github.com/Azure/azure-cli-extensions/blob/main/src/aks-preview/azext_aks_preview/_resourcegroup.py#L10
| - name: --file -f | ||
| type: string | ||
| short-summary: Kubernetes configuration file to update. Use "-" to print YAML to stdout instead. |
There was a problem hiding this comment.
We already have --output -o argument to support yaml output in stdout.
There was a problem hiding this comment.
borrowed aks-preview implementation
https://github.com/Azure/azure-cli-extensions/blob/main/src/aks-preview/azext_aks_preview/_help.py#L1622
Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>
Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>
| c.argument('name', options_list=['--name', '-n'], help='Specify the fleet name.') | ||
|
|
||
| with self.argument_context('fleet create') as c: | ||
| c.argument('tags', tags_type) |
There was a problem hiding this comment.
I suppose tags is supported by CLI framework by default
There was a problem hiding this comment.
unsure, borrowed from aks-preview
https://github.com/Azure/azure-cli-extensions/blob/main/src/aks-preview/azext_aks_preview/_params.py#L186
| def load_arguments(self, _): | ||
|
|
||
| with self.argument_context('fleet') as c: | ||
| c.argument('name', options_list=['--name', '-n'], help='Specify the fleet name.') |
There was a problem hiding this comment.
name is also supported by default?
There was a problem hiding this comment.
I think it is, but we needed different contexts associated so followed how aks-preview does for nodepool https://github.com/Azure/azure-cli-extensions/blob/main/src/aks-preview/azext_aks_preview/_params.py#L432
| g.custom_show_command("show", "show_fleet") | ||
| g.custom_command("list", "list_fleet") | ||
| g.custom_command("delete", "delete_fleet", supports_no_wait=True) | ||
| g.custom_command("get-credentials", "get_credentials") |
There was a problem hiding this comment.
Since no_wait is supported, add g.wait_command('wait') and test case for it? Also need to update _param.py to align the option with operation parameters provided in SDK.
There was a problem hiding this comment.
will add as part of next PR!
| g.custom_command("create", "create_fleet_member", supports_no_wait=True) | ||
| g.custom_command("delete", "delete_fleet_member", supports_no_wait=True) | ||
| g.custom_command("list", "list_fleet_member") | ||
| g.custom_show_command("show", "show_fleet_member") |
There was a problem hiding this comment.
will add as part of next PR!
| context_name=None): | ||
| credentialResults = client.list_credentials(resource_group_name, name) | ||
| if not credentialResults: | ||
| raise CLIError("No Kubernetes credentials found.") |
There was a problem hiding this comment.
May replace CLIError with ResourceNotFoundError.
from azure.cli.core.azclierror import InvalidArgumentValueError
There was a problem hiding this comment.
| print_or_merge_credentials( | ||
| path, kubeconfig, overwrite_existing, context_name) | ||
| except (IndexError, ValueError): | ||
| raise CLIError("Fail to find kubeconfig file.") |
There was a problem hiding this comment.
borrowed from aks-preview, https://github.com/Azure/azure-cli-extensions/blob/main/src/aks-preview/azext_aks_preview/custom.py#L883
|
[Release] Update index.json for extension [ fleet ] : https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1799841&view=results |
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 azdevrequired)python scripts/ci/test_index.py -qlocally?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.jsonautomatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json.