Skip to content

Conversation

@renshao
Copy link

@renshao renshao commented Mar 7, 2025

In az cli 2.70 we introduced an improvement for az acr cache create,
where this command does not need to issue a GET registry request first.

This change is needed for users with cache rule permission only. If a user
only has access to cache rule resource, the GET registry request would
fail with 503.

This commit ported this change in arccache extension, so that even
after this extension is installed, user can still run acr acr cache create command.

In az cli 2.70 we introduced an improvement for `az acr cache create`,
where this command does not need to issue a GET registry request first.

This change is needed for users with cache rule permission only. If a user
only has access to cache rule resource, the GET registry request would
fail with 503.

This commit ported this change in `arccache` extension, so that even
after this extension is installed, user can still run `acr acr cache
create` command.
@renshao renshao force-pushed the shaoren/built-in-role-fix branch from a897098 to 6e985de Compare March 10, 2025 23:54
@cegraybl cegraybl requested a review from Copilot March 18, 2025 17:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ports the latest cache create behavior so that users with cache rule permission no longer need to perform a GET registry request before creating a cache.

  • Removed the retrieval of the full registry object using get_registry_by_name.
  • Introduced a new credential set ID formatting using a constant template and subscription, resource group, registry name, and credential set name.
Comments suppressed due to low confidence (2)

src/acrcache/azext_acrcache/cache.py:106

  • The previous code retrieved the full registry object to get the registry ID, which is no longer available. Please confirm that get_resource_group_name_by_registry_name returns the correct value needed for constructing the credential set ID.
rg = get_resource_group_name_by_registry_name(cmd.cli_ctx, registry_name, resource_group_name)

src/acrcache/azext_acrcache/cache.py:106

  • [nitpick] Consider renaming the variable 'rg' to 'resource_group' for improved clarity.
rg = get_resource_group_name_by_registry_name(cmd.cli_ctx, registry_name, resource_group_name)

@mabelegba
Copy link

update # HISTORY.rst entry to VERSION = '1.0.0c1'
@cegraybl @huanwu

mabelegba pushed a commit that referenced this pull request Nov 25, 2025
)

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* fix CI testcases for nodepool image issues (#8)

* update python version to 3.13 (#12)

* changes to support gateway association/disassociation for api version '2025-08-01-preview' (#17)

* [Azure RBAC] Deprecate 3P mode flags, fix Azure RBAC enablement bug, add E2E coverage and improve logging (#20)

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* Parameterize for airgapped clouds (#5)

* Add parameterization for the airgapped clouds

* Fix azdev style

* MCR path function

* azdev, ruff, and mypy

---------

Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>

* Oras client fix to work with different MCRs (#6)

Co-authored-by: mmcneal <[email protected]>

* fix CI testcases for nodepool image issues (#8)

* update errors for the config and connectivity issues (#11)

* update errors

* format

* style

* update python version to 3.13 (#12)

* Update cluster diagnostics image to 1.29.3 (#7)

* Update cluster diagnostics helm chart to 1.29.3

* Fix lint issues

---------

Co-authored-by: bgriddaluru <[email protected]>

* RBAC deprecation & fix the issue

* typo

* fix comments

* update tests

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* fix CI testcases for nodepool image issues (#8)

* update errors for the config and connectivity issues (#11)

* update errors

* format

* style

* update python version to 3.13 (#12)

* rebase

* fix tests

* fix version

* fix mypy, lint

* fix test

* fix test

* fix test

* fix test

* fix test

* rename test

* deprecate flags

* rebase

* rebase

* bump version for release

---------

Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Atchut Kumar Barli <[email protected]>
Co-authored-by: mcnealm13 <[email protected]>
Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>
Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: vithumma <[email protected]>

* remove hardcoded public ARM endpoint url for fairfax and mooncake (#24)

* Bug Fix for FFX mcr url  (#22)

* [connectedk8s] update release notes and version (#26)

* Add Helm Overrides for AGC (#23)

* add agc overrides

* update gns endpoint

* add indentation

* fix linter error

* fix ruff formatting

* move overrides to it's own method

* update method

* update ruff formatting

* [Azure RBAC] Remove deprecated flags (#16)

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* Parameterize for airgapped clouds (#5)

* Add parameterization for the airgapped clouds

* Fix azdev style

* MCR path function

* azdev, ruff, and mypy

---------

Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>

* Oras client fix to work with different MCRs (#6)

Co-authored-by: mmcneal <[email protected]>

* fix CI testcases for nodepool image issues (#8)

* update errors for the config and connectivity issues (#11)

* update errors

* format

* style

* update python version to 3.13 (#12)

* Update cluster diagnostics image to 1.29.3 (#7)

* Update cluster diagnostics helm chart to 1.29.3

* Fix lint issues

---------

Co-authored-by: bgriddaluru <[email protected]>

* RBAC deprecation & fix the issue

* typo

* fix comments

* update tests

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* fix CI testcases for nodepool image issues (#8)

* update errors for the config and connectivity issues (#11)

* update errors

* format

* style

* update python version to 3.13 (#12)

* rebase

* fix tests

* fix version

* fix mypy, lint

* fix test

* fix test

* fix test

* fix test

* fix test

* rename test

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* fix CI testcases for nodepool image issues (#8)

* update python version to 3.13 (#12)

* changes to support gateway association/disassociation for api version '2025-08-01-preview' (#17)

* [Azure RBAC] Deprecate 3P mode flags, fix Azure RBAC enablement bug, add E2E coverage and improve logging (#20)

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* Parameterize for airgapped clouds (#5)

* Add parameterization for the airgapped clouds

* Fix azdev style

* MCR path function

* azdev, ruff, and mypy

---------

Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>

* Oras client fix to work with different MCRs (#6)

Co-authored-by: mmcneal <[email protected]>

* fix CI testcases for nodepool image issues (#8)

* update errors for the config and connectivity issues (#11)

* update errors

* format

* style

* update python version to 3.13 (#12)

* Update cluster diagnostics image to 1.29.3 (#7)

* Update cluster diagnostics helm chart to 1.29.3

* Fix lint issues

---------

Co-authored-by: bgriddaluru <[email protected]>

* RBAC deprecation & fix the issue

* typo

* fix comments

* update tests

* add pester tests for connectedk8s cli extension

* Pass the force delete param to the API call (#4)

* forcedelete

* format

* add code owner

* mypy

* fix CI testcases for nodepool image issues (#8)

* update errors for the config and connectivity issues (#11)

* update errors

* format

* style

* update python version to 3.13 (#12)

* rebase

* fix tests

* fix version

* fix mypy, lint

* fix test

* fix test

* fix test

* fix test

* fix test

* rename test

* deprecate flags

* rebase

* rebase

* bump version for release

---------

Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Atchut Kumar Barli <[email protected]>
Co-authored-by: mcnealm13 <[email protected]>
Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>
Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: vithumma <[email protected]>

* remove breaking change announcement for removed flags

---------

Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Atchut Kumar Barli <[email protected]>
Co-authored-by: mcnealm13 <[email protected]>
Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>
Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: vithumma <[email protected]>

* update prediag version (#27)

* Updating the proxy version constant (#28)

* Update relesae notes

* dropping 3.9

* dropping testing folder

* fixed code review comments

* updateversion

* Update src/connectedk8s/HISTORY.rst

Co-authored-by: Xing Zhou <[email protected]>

---------

Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Vineeth Thumma <[email protected]>
Co-authored-by: mcnealm13 <[email protected]>
Co-authored-by: Matthew McNeal (from Dev Box) <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: bgriddaluru <[email protected]>
Co-authored-by: vithumma <[email protected]>
Co-authored-by: hapate <[email protected]>
Co-authored-by: junw98 <[email protected]>
Co-authored-by: gabemousa <[email protected]>
Co-authored-by: Xing Zhou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants