Skip to content

ARO-6446 :: Create managed identities when not provided to az aro create#4789

Open
komidore64 wants to merge 2 commits intomasterfrom
adprice/aro-6446-identities-with-cluster
Open

ARO-6446 :: Create managed identities when not provided to az aro create#4789
komidore64 wants to merge 2 commits intomasterfrom
adprice/aro-6446-identities-with-cluster

Conversation

@komidore64
Copy link
Copy Markdown
Collaborator

@komidore64 komidore64 commented Apr 23, 2026

Which issue this PR addresses:

Fixes ARO-6446

What this PR does / why we need it:

Adds managed identity creation into az aro create for users that wish to have a managed-identity cluster create identities and role assignments for them.

BREAKING CHANGE (CLI): OpenShift version (--version X.Y.Z) is now a required flag when creating a cluster with az aro create.

OpenShift version is only required if --enable-managed-identity is passed while --assign-platform-workload-identity and --assign-cluster-identity are absent.

Test plan for issue:

I smoke tested the creation of a few clusters using az aro create --enable-managed-identity.

Is there any documentation that needs to be updated for this PR?

I included an example command for enabling managed identities in the example help output.

How do you know this will function as expected in production?

These changes use currently existing endpoints and functionality.


if enable_managed_identity is True:
if enable_managed_identity:
if not platform_workload_identities and not mi_user_assigned:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could a check be added here for to see if version is set to something other than None and allow --version to still be optional when not using managed identities?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

See comment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated to provide clearer validation for the user, and only require --version if --enable-managed-identity is passed when --assign-platform-workload-identity and --assign-cluster-identity are absent.


if enable_managed_identity is True:
if enable_managed_identity:
if not platform_workload_identities and not mi_user_assigned:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If only one of --mi-user-assigned or --assign-platform-wi is provided, this falls through the auto-create condition and hits dict(None) (TypeError) or {None: {}}. Should the and be or, or add validation for partial input?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

and is the correct logic in this instance.

We want to accept any and all user-provided identities -- correct or otherwise -- or auto-create identities if neither are provided.

Related to your question, I want to add additional output to _validators.py:317-325 for more descriptive user feedback than a python stacktrace.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated to provide clearer validatation.

@komidore64
Copy link
Copy Markdown
Collaborator Author

I received feedback/input from some folks in Slack that it's too much of a breaking change to require --version for the entirety of az aro create.

The desired flag combinations of --enable-managed-identity, --version, --assign-cluster-identity, and --assign-platform-workload-identity are as follows:

  1. provide --enable-managed-identity; result: Error! missing --version
  2. provide --enable-managed-identity and --version; result: Create managed identities and create the cluster
  3. provide --enable-managed-identity, --assign-cluster-identity, and --assign-platform-workload-identity; result: Accept user provided identities and create the cluster.
  4. does not provide --enable-managed-identity; result: Create cluster

@komidore64 komidore64 force-pushed the adprice/aro-6446-identities-with-cluster branch 2 times, most recently from 7eede32 to 0b07912 Compare April 24, 2026 20:22
.. if the user creates a managed identity cluster and does not provide
the necessary identities as command arguments.

Only require `--version` if `--enable-managed-identity` is given while
`--assign-platform-workload-identity` and `--assign-cluster-identity`
are absent.

Ref: https://redhat.atlassian.net/browse/ARO-6446
@komidore64 komidore64 force-pushed the adprice/aro-6446-identities-with-cluster branch from 0b07912 to 22c306a Compare April 24, 2026 20:24
@komidore64 komidore64 requested review from swiencki and yithian April 24, 2026 20:35
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