Skip to content

Commit 498974d

Browse files
authored
Merge pull request #365 from kagenti/refactor/consolidate-spire-volume-mounts
refactor: consolidate redundant spireEnabled checks
2 parents 74a2479 + 88abeca commit 498974d

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

kagenti-operator/internal/webhook/injector/container_builder.go

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,21 @@ func (b *ContainerBuilder) BuildEnvoyProxyContainerWithSpireOption(spireEnabled
109109
},
110110
}
111111
if spireEnabled {
112-
volumeMounts = append(volumeMounts, corev1.VolumeMount{
113-
Name: "svid-output",
114-
MountPath: "/opt",
115-
ReadOnly: true,
116-
})
117-
}
118-
119-
if spireEnabled {
120-
// authbridge-envoy bundles spiffe-helper; the entrypoint reads
121-
// helper.conf from this mount. Without it, the bundled
122-
// spiffe-helper would fail to start on SPIRE_ENABLED=true.
123-
volumeMounts = append(volumeMounts, corev1.VolumeMount{
124-
Name: "spiffe-helper-config",
125-
MountPath: "/etc/spiffe-helper",
126-
ReadOnly: true,
127-
})
112+
volumeMounts = append(volumeMounts,
113+
corev1.VolumeMount{
114+
Name: "svid-output",
115+
MountPath: "/opt",
116+
ReadOnly: true,
117+
},
118+
// authbridge-envoy bundles spiffe-helper; the entrypoint reads
119+
// helper.conf from this mount. Without it, the bundled
120+
// spiffe-helper would fail to start on SPIRE_ENABLED=true.
121+
corev1.VolumeMount{
122+
Name: "spiffe-helper-config",
123+
MountPath: "/etc/spiffe-helper",
124+
ReadOnly: true,
125+
},
126+
)
128127
}
129128

130129
var env []corev1.EnvVar

0 commit comments

Comments
 (0)