Skip to content

Commit

Permalink
ARO-11546 update AZURE_FEDERATED_TOKEN_FILE value to have /token (#3924)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeepc2792 authored Oct 24, 2024
1 parent d89a378 commit c0f3a92
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pkg/operator/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type deploymentData struct {
SupportsPodSecurityAdmission bool
UsesWorkloadIdentity bool
TokenVolumeMountPath string
FederatedTokenFilePath string
}

func (o *operator) SetForceReconcile(ctx context.Context, enable bool) error {
Expand Down Expand Up @@ -191,6 +192,7 @@ func (o *operator) createDeploymentData(ctx context.Context) (deploymentData, er
if o.oc.UsesWorkloadIdentity() {
data.UsesWorkloadIdentity = o.oc.UsesWorkloadIdentity()
data.TokenVolumeMountPath = filepath.Dir(pkgoperator.OperatorTokenFile)
data.FederatedTokenFilePath = pkgoperator.OperatorTokenFile
}

return data, nil
Expand Down
9 changes: 5 additions & 4 deletions pkg/operator/deploy/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ func TestCreateDeploymentData(t *testing.T) {
},
clusterVersion: "4.10.0",
expected: deploymentData{
Image: operatorImageWithTag,
Version: operatorImageTag,
UsesWorkloadIdentity: true,
TokenVolumeMountPath: filepath.Dir(pkgoperator.OperatorTokenFile),
Image: operatorImageWithTag,
Version: operatorImageTag,
UsesWorkloadIdentity: true,
TokenVolumeMountPath: filepath.Dir(pkgoperator.OperatorTokenFile),
FederatedTokenFilePath: pkgoperator.OperatorTokenFile,
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
key: azure_client_id
{{ if .UsesWorkloadIdentity }}
- name: AZURE_FEDERATED_TOKEN_FILE
value: "{{ .TokenVolumeMountPath }}"
value: "{{ .FederatedTokenFilePath }}"
{{ else }}
- name: AZURE_CLIENT_SECRET
valueFrom:
Expand Down

0 comments on commit c0f3a92

Please sign in to comment.