Skip to content

Commit

Permalink
Merge pull request #1167 from Fryguy/fix_pass_by_ref
Browse files Browse the repository at this point in the history
Fix issue with pass-by-reference

(cherry picked from commit ead47ee)
  • Loading branch information
agrare authored and Fryguy committed Sep 13, 2024
1 parent 9ae96e8 commit 52ec1ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func OrchestratorDeployment(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme, cl

certSecret := InternalCertificatesSecret(cr, client)
if certSecret.Data["root_crt"] != nil {
AddLabel("ssl-certificate-resource-version", certSecret.ObjectMeta.ResourceVersion, deployment.Spec.Template.ObjectMeta)
AddLabel("ssl-certificate-resource-version", certSecret.ObjectMeta.ResourceVersion, &deployment.Spec.Template.ObjectMeta)
}
if certSecret.Data["api_crt"] != nil && certSecret.Data["api_key"] != nil {
deployment.Spec.Template.Spec.Containers[0].Env = addOrUpdateEnvVar(deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{Name: "API_SSL_SECRET_NAME", Value: cr.Spec.InternalCertificatesSecret})
Expand Down
8 changes: 4 additions & 4 deletions manageiq-operator/api/v1alpha1/helpers/miq-components/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ func addResourceReqs(memLimit, memReq, cpuLimit, cpuReq string, c *corev1.Contai
}

func addAppLabel(appName string, meta *metav1.ObjectMeta) {
AddLabel("app", appName, *meta)
AddLabel("app", appName, meta)
}

func addBackupLabel(backupLabel string, meta *metav1.ObjectMeta) {
AddLabel(backupLabel, "t", *meta)
AddLabel(backupLabel, "t", meta)
}

func AddLabel(key string, value string, meta metav1.ObjectMeta) {
func AddLabel(key string, value string, meta *metav1.ObjectMeta) {
if meta.Labels == nil {
meta.Labels = make(map[string]string)
}
Expand Down Expand Up @@ -127,7 +127,7 @@ func addInternalCertificate(cr *miqv1alpha1.ManageIQ, d *appsv1.Deployment, clie
secretVolumeSource := corev1.SecretVolumeSource{SecretName: secret.Name, Items: []corev1.KeyToPath{corev1.KeyToPath{Key: fmt.Sprintf("%s_crt", name), Path: "server.crt"}, corev1.KeyToPath{Key: fmt.Sprintf("%s_key", name), Path: "server.key"}}}
d.Spec.Template.Spec.Volumes = addOrUpdateVolume(d.Spec.Template.Spec.Volumes, corev1.Volume{Name: volumeName, VolumeSource: corev1.VolumeSource{Secret: &secretVolumeSource}})

AddLabel("ssl-certificate-resource-version", secret.ObjectMeta.ResourceVersion, d.Spec.Template.ObjectMeta)
AddLabel("ssl-certificate-resource-version", secret.ObjectMeta.ResourceVersion, &d.Spec.Template.ObjectMeta)
}
}

Expand Down

0 comments on commit 52ec1ae

Please sign in to comment.