Skip to content

Commit

Permalink
fix(datastore): tokens were not mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-pad committed Apr 24, 2024
1 parent 6cef16c commit def4927
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions deploy/charts/burrito/templates/controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
- name: burrito-config
mountPath: /etc/burrito
readOnly: true
- name: burrito-token
mountPath: /var/run/secrets/token
readOnly: true
{{- with .deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -76,6 +79,13 @@ spec:
- name: burrito-config
configMap:
name: burrito-config
- name: token-vol
projected:
sources:
- serviceAccountToken:
audience: burrito
expirationSeconds: 3600
path: burrito
{{- if .service.enabled }}
---
apiVersion: v1
Expand Down
10 changes: 10 additions & 0 deletions deploy/charts/burrito/templates/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
- name: burrito-config
mountPath: /etc/burrito
readOnly: true
- name: burrito-token
mountPath: /var/run/secrets/token
readOnly: true
{{- with .deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -75,6 +78,13 @@ spec:
- name: burrito-config
configMap:
name: burrito-config
- name: token-vol
projected:
sources:
- serviceAccountToken:
audience: burrito
expirationSeconds: 3600
path: burrito
{{- if .service.enabled }}
---
apiVersion: v1
Expand Down
20 changes: 20 additions & 0 deletions internal/controllers/terraformrun/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ func defaultPodSpec(config *config.Config, layer *configv1alpha1.TerraformLayer,
},
},
},
{
Name: "burrito-token",
VolumeSource: corev1.VolumeSource{
Projected: &corev1.ProjectedVolumeSource{
Sources: []corev1.VolumeProjection{
{
ServiceAccountToken: &corev1.ServiceAccountTokenProjection{
Audience: "burrito",
ExpirationSeconds: &[]int64{3600}[0],
Path: "burrito",
},
},
},
},
},
},
},
RestartPolicy: corev1.RestartPolicyNever,
ServiceAccountName: "burrito-runner",
Expand All @@ -254,6 +270,10 @@ func defaultPodSpec(config *config.Config, layer *configv1alpha1.TerraformLayer,
Name: "ssh-known-hosts",
SubPath: "known_hosts",
},
{
MountPath: "/var/run/secrets/token",
Name: "burrito-token",
},
},
Env: []corev1.EnvVar{
{
Expand Down

0 comments on commit def4927

Please sign in to comment.