HOSTEDCP-2033: Add ARO HCP environment vars to CSI deployment#517
Conversation
|
Skipping CI for Draft Pull Request. |
ed2ec88 to
fa8c521
Compare
fa8c521 to
dd4cefe
Compare
|
/retest |
This commit adds environment variables needed by a CSI deployment for ARO HCP. Signed-off-by: Bryan Cox <brcox@redhat.com>
dd4cefe to
759166b
Compare
|
/test hypershift-aws-e2e-external |
|
@bryan-cox: This pull request references HOSTEDCP-2033 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target only the "4.18.0" version, but multiple target versions were set. DetailsIn response to this:
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. |
|
/retest |
| // The existence of the environment variable, ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE, means this is an ARO HCP | ||
| // deployment. We need to pass along additional environment variables for ARO HCP in order to mount the backing | ||
| // certificates, related to the client IDs, in a volume on the azure-disk-csi-controller and | ||
| // azure-file-csi-controller deployments. | ||
| if os.Getenv("ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE") != "" { | ||
| envVars := []corev1.EnvVar{ | ||
| {Name: "ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE", Value: os.Getenv("ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE")}, | ||
| {Name: "ARO_HCP_SECRET_PROVIDER_CLASS_FOR_DISK", Value: os.Getenv("ARO_HCP_SECRET_PROVIDER_CLASS_FOR_DISK")}, | ||
| } | ||
|
|
||
| required.Spec.Template.Spec.Containers[0].Env = append(required.Spec.Template.Spec.Containers[0].Env, envVars...) | ||
| } |
There was a problem hiding this comment.
I would prefer a new Azure specific hook in the operator config.
- When creating the operator config here, add a new DeploymentHook on HyperShift.
cfg.DeploymentHooks = append(cfg.DeploymentHooks, withAROSecretEnvVars())
- And then put the hook func somewhere
func withAROSecretEnvVars() dc.DeploymentHookFunc {
hook := func(_ *opv1.OperatorSpec, deployment *appsV1.Deployment) error {
if os.Getenv("ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE") != "" {
envVars := []corev1.EnvVar{
{Name: "ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE", Value: os.Getenv("ARO_HCP_SECRET_PROVIDER_CLASS_FOR_FILE")},
{Name: "ARO_HCP_SECRET_PROVIDER_CLASS_FOR_DISK", Value: os.Getenv("ARO_HCP_SECRET_PROVIDER_CLASS_FOR_DISK")},
}
deployment.Spec.Template.Spec.Containers[0].Env = append(deployment.Spec.Template.Spec.Containers[0].Env, envVars...)
}
return hook
}
And use the same hook in azure_file.go
There was a problem hiding this comment.
sorry, I thought it's CSI driver operator PR
This is OK for CSO
/lgtm
/approve
/label px-approved
/label docs-approved
/label qe-approved
There will be another PR in azure CSI driver operators to use these env. vars. We should test those.
There was a problem hiding this comment.
Discussed offline, this PR is just to pass the HyperShift environment variables on to the CSI operator. Updating the azure-file and azure-disk-csi-operators in the CSI operator repo will be done in a follow up PR.
|
@bryan-cox: This pull request references HOSTEDCP-2033 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target only the "4.18.0" version, but multiple target versions were set. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@bryan-cox: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/test e2e-azure-csi |
|
[ART PR BUILD NOTIFIER] Distgit: cluster-storage-operator |
|
/cherry-pick release-4.17 |
|
@bryan-cox: new pull request created: #540 DetailsIn response to this:
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. |
This commit adds environment variables needed by a CSI deployment for ARO HCP.