-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOSTEDCP-2033: Add ARO HCP environment vars to CSI deployment #517
Conversation
Skipping CI for Draft Pull Request. |
pkg/operator/csidriveroperator/hypershift_deployment_controller.go
Outdated
Show resolved
Hide resolved
ed2ec88
to
fa8c521
Compare
pkg/operator/csidriveroperator/hypershift_deployment_controller.go
Outdated
Show resolved
Hide resolved
fa8c521
to
dd4cefe
Compare
/retest |
This commit adds environment variables needed by a CSI deployment for ARO HCP. Signed-off-by: Bryan Cox <[email protected]>
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. In 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. In 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
Needs 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. 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. |
/test e2e-azure-csi |
3dfadbf
into
openshift:master
[ART PR BUILD NOTIFIER] Distgit: cluster-storage-operator |
This commit adds environment variables needed by a CSI deployment for ARO HCP.