refactor: refactoring of code

This commit is contained in:
Jonas Kaninda
2024-12-02 07:54:51 +01:00
parent 00284095b0
commit 46c5ff9770

View File

@@ -41,7 +41,7 @@ func createUpdateDeployment(r GatewayReconciler, ctx context.Context, req ctrl.R
}) })
if len(gateway.Spec.Server.TlsSecretName) != 0 { if len(gateway.Spec.Server.TlsSecretName) != 0 {
volumes = append(volumes, corev1.Volume{ volumes = append(volumes, corev1.Volume{
Name: req.Name, Name: "certs",
VolumeSource: corev1.VolumeSource{ VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{ Secret: &corev1.SecretVolumeSource{
SecretName: gateway.Spec.Server.TlsSecretName, SecretName: gateway.Spec.Server.TlsSecretName,
@@ -49,7 +49,7 @@ func createUpdateDeployment(r GatewayReconciler, ctx context.Context, req ctrl.R
}, },
}) })
volumeMounts = append(volumeMounts, corev1.VolumeMount{ volumeMounts = append(volumeMounts, corev1.VolumeMount{
Name: req.Name, Name: "certs",
ReadOnly: true, ReadOnly: true,
MountPath: CertsPath, MountPath: CertsPath,
}) })