Skip to content

Conversation

@bryan-cox
Copy link
Member

@bryan-cox bryan-cox commented Nov 4, 2025

Summary

Adds conditional logic to pass HYPERSHIFT_IMAGE environment variable to Azure Disk and Azure File CSI driver operator deployments in HyperShift mode for self-managed Azure clusters only. This enables the CSI driver operators to inject token-minter sidecars for Azure workload identity authentication.

Problem

Azure Disk and File CSI drivers fail on Azure self-managed hosted clusters because the token-minter container image is not specified. The CSI driver operators use the WithTokenMinter() deployment hook, but the HYPERSHIFT_IMAGE environment variable was never passed from cluster-storage-operator to the CSI driver operator pods.

Solution

This PR adds runtime conditional logic in hypershift_deployment_controller.go that:

  • Detects ARO HCP mode by checking for ARO_HCP_SECRET_PROVIDER_CLASS_FOR_* environment variables
  • Passes HYPERSHIFT_IMAGE to Azure CSI driver operators only when ARO HCP env vars are absent (self-managed Azure)
  • Skips passing HYPERSHIFT_IMAGE for ARO HCP deployments (which use Secret Provider Class instead)

The flow for self-managed Azure:

  1. HyperShift sets HYPERSHIFT_IMAGE on cluster-storage-operator deployment
  2. cluster-storage-operator conditionally passes it to CSI driver operator deployments (this PR)
  3. CSI driver operators read it from env var in WithTokenMinter() hook to inject token-minter containers
  4. Token-minter creates guest cluster service account tokens
  5. Azure CSI drivers authenticate with Azure using workload identity

This matches the existing pattern used by AWS EBS CSI driver operator.

Changes

  • Added conditional logic in pkg/operator/csidriveroperator/hypershift_deployment_controller.go (lines 159-170)
  • Passes HYPERSHIFT_IMAGE to Azure Disk CSI driver operator only when ARO_HCP_SECRET_PROVIDER_CLASS_FOR_DISK is not set
  • Passes HYPERSHIFT_IMAGE to Azure File CSI driver operator only when ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE is not set

Related PRs

References

@openshift-ci openshift-ci bot requested review from gnufied and jsafrane November 4, 2025 17:23
@bryan-cox bryan-cox marked this pull request as draft November 4, 2025 17:24
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2025
@bryan-cox
Copy link
Member Author

/uncc @jsafrane

@openshift-ci openshift-ci bot removed the request for review from jsafrane November 4, 2025 17:24
@bryan-cox
Copy link
Member Author

/uncc @gnufied

@openshift-ci openshift-ci bot removed the request for review from gnufied November 4, 2025 17:25
@bryan-cox bryan-cox changed the title feat(azure): add HYPERSHIFT_IMAGE env var for token-minter OCPBUGS-63698: feat(azure): add HYPERSHIFT_IMAGE env var for token-minter Nov 4, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 4, 2025
@openshift-ci-robot
Copy link
Contributor

@bryan-cox: This pull request references Jira Issue OCPBUGS-63698, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Adds HYPERSHIFT_IMAGE environment variable to Azure Disk and Azure File CSI driver operator deployments in HyperShift mode. This enables the CSI driver operators to inject token-minter sidecars for Azure workload identity authentication on self-managed clusters.

Problem

Azure Disk and File CSI drivers fail on Azure self-managed hosted clusters because the token-minter container image is not specified. The CSI driver operators use ${HYPERSHIFT_IMAGE} as a placeholder, but the environment variable was never passed from cluster-storage-operator to the CSI driver operator pods.

Solution

This PR adds the HYPERSHIFT_IMAGE environment variable to the deployment patches for:

  • assets/csidriveroperators/azure-disk/hypershift/mgmt/deployment.patch.yaml
  • assets/csidriveroperators/azure-file/hypershift/mgmt/deployment.patch.yaml

The flow is:

  1. HyperShift sets HYPERSHIFT_IMAGE on cluster-storage-operator deployment
  2. cluster-storage-operator reads it and passes it to CSI driver operator deployments (this PR)
  3. CSI driver operators use it to replace ${HYPERSHIFT_IMAGE} placeholders in token-minter containers
  4. Token-minter creates guest cluster service account tokens
  5. Azure CSI drivers authenticate with Azure using workload identity

This matches the existing pattern used by AWS EBS CSI driver operator.

Changes

  • Added HYPERSHIFT_IMAGE env var to Azure Disk deployment patch
  • Added HYPERSHIFT_IMAGE env var to Azure File deployment patch
  • Regenerated kustomize manifests for both drivers

Related PRs

References

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Add conditional logic to pass HYPERSHIFT_IMAGE environment variable
to Azure Disk and Azure File CSI driver operators only when running
on self-managed Azure HyperShift clusters.

For ARO HCP deployments, the Secret Provider Class pattern is used
instead of token-minter, so HYPERSHIFT_IMAGE is not needed. This
change detects ARO HCP mode by checking for the presence of
ARO_HCP_SECRET_PROVIDER_CLASS_FOR_* environment variables.

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
@bryan-cox
Copy link
Member Author

/test all

@bryan-cox
Copy link
Member Author

/test hypershift-e2e-aks

@bryan-cox
Copy link
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 9, 2025
@openshift-ci-robot
Copy link
Contributor

@bryan-cox: This pull request references Jira Issue OCPBUGS-63698, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (wduan@redhat.com), skipping review request.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bryan-cox bryan-cox marked this pull request as ready for review December 10, 2025 13:53
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 10, 2025
@openshift-ci openshift-ci bot requested review from dfajmon and jsafrane December 10, 2025 13:55
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 10, 2025

@bryan-cox: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@duanwei33
Copy link

/payload-job-with-prs periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-ipi-ovn-hypershift-guest-f7 #643,openshift/csi-operator#461,openshift/hypershift#7157

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 12, 2025

@duanwei33: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

@duanwei33
Copy link

/payload-job-with-prs periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-ipi-ovn-hypershift-guest-f7 openshift/csi-operator#461,openshift/hypershift#7157

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 12, 2025

@duanwei33: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

@duanwei33
Copy link

/payload-job-with-prs help

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 12, 2025

@duanwei33: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

@duanwei33
Copy link

/payload-job-with-prs periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-ipi-ovn-hypershift-guest-f7 openshift/csi-operator#461 openshift/hypershift#7157

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 12, 2025

@duanwei33: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-openshift-tests-private-release-4.21-amd64-nightly-azure-ipi-ovn-hypershift-guest-f7

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/7142dd10-d6fe-11f0-8d59-3afbbfee03e5-0

@dfajmon
Copy link
Contributor

dfajmon commented Dec 16, 2025

/lgtm
/approve
cc @jsafrane for /acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, dfajmon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants