Skip to content

Conversation

@DomAyre
Copy link
Owner

@DomAyre DomAyre commented Sep 20, 2025

Why

As part of Azure#9167 and our ambition to have more modular steps in the policy generation process, it makes sense to have a simple, well defined spec for the JSON which describes the policy to be generated.

I have opted to go with python data classes to define this, it's a python first approach which keeps the code simple, and also allow us to generate docs, json schemas from a single source of truth.

How

  • Define a series of data classes, rooted in AciPolicySpec which specifies the format of the json which we use to generate the policy
  • Add a couple of example parsers including one for ARM templates
  • Update load_policy_from_arm_template_str() to use this parser
  • Since instances of AciPolicySpec are complete including fields which were previously implicitly added at policy gen time, add some code to avoid duplication of these implicit fields.
  • Update interface of load_policy_from_arm_template_file()
    • The field fragment_contents is never given in the codebase so it is removed, and rego_imports is renamed to included_fragments
  • Checked all existing use cases, and ensured they are still supported

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

NOTE: Version is currently already bumped by #4 but if that's released before this, we need to bump the version again

@DomAyre DomAyre force-pushed the ordered-env-variables branch from f7a1073 to 4bda667 Compare September 23, 2025 15:48
@DomAyre DomAyre force-pushed the ordered-env-variables branch from 0cf006f to 34bc084 Compare September 24, 2025 18:40
@DomAyre DomAyre marked this pull request as ready for review September 24, 2025 19:29
@DomAyre DomAyre force-pushed the ordered-env-variables branch from 34bc084 to b2e2ecb Compare September 29, 2025 12:25
@DomAyre DomAyre changed the base branch from ordered-env-variables to main September 29, 2025 15:58
DomAyre pushed a commit that referenced this pull request Sep 30, 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 (Azure#12)

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

* [Azure RBAC] Deprecate 3P mode flags, fix Azure RBAC enablement bug, add E2E coverage and improve logging (Azure#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 (Azure#11)

* update errors

* format

* style

* update python version to 3.13 (Azure#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 (Azure#11)

* update errors

* format

* style

* update python version to 3.13 (Azure#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 redundant test files

---------

Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Atchut Kumar Barli <[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]>
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

Hi @DomAyre

Release Suggestions

Module: confcom

  • Please log updates into to src/confcom/HISTORY.rst
  • Update VERSION to 1.2.9 in src/confcom/setup.py

Notes

@DomAyre
Copy link
Owner Author

DomAyre commented Oct 1, 2025

Moved to Azure#9262

@DomAyre DomAyre closed this Oct 1, 2025
DomAyre pushed a commit that referenced this pull request Oct 16, 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 (Azure#12)

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

* [Azure RBAC] Deprecate 3P mode flags, fix Azure RBAC enablement bug, add E2E coverage and improve logging (Azure#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 (Azure#11)

* update errors

* format

* style

* update python version to 3.13 (Azure#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 (Azure#11)

* update errors

* format

* style

* update python version to 3.13 (Azure#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 (Azure#24)

* Bug Fix for FFX mcr url  (Azure#22)

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

* remove redundant test files

* remove change not relevant to connectedk8s release

---------

Co-authored-by: Bavneet Singh <[email protected]>
Co-authored-by: Atchut Kumar Barli <[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]>
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.

2 participants