Skip to content

Commit 60757c9

Browse files
authored
Fix map: map[] does not contain declared merge key: name (#48)
* fix `map: map[] does not contain declared merge key: name` * fix the test that expected a null imagePullSecrets item
1 parent 57fd95b commit 60757c9

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

operator/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ quarkus:
9090
- null
9191
paths:
9292
- (kind == Deployment).spec.template.spec.imagePullSecrets
93-
expression: "{{- toYaml .Values.app.imagePullSecrets | nindent 8 }}"
93+
expression: "{{- if eq (toYaml .Values.app.imagePullSecrets | trim) \"- {}\" }} null{{- else }}{{- toYaml .Values.app.imagePullSecrets | nindent 8 }}{{- end }}"
9494
description: Kubernetes image pull secrets to use if the OCI image is hosted on a private registry
9595
resource-requests-cpu:
9696
property: resources.requests.cpu

operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package it.aboutbits.postgresql.helm;
22

33
import io.fabric8.kubernetes.api.model.ConfigBuilder;
4-
import io.fabric8.kubernetes.api.model.LocalObjectReference;
54
import io.fabric8.kubernetes.client.KubernetesClient;
65
import io.fabric8.kubernetes.client.utils.Serialization;
76
import io.quarkus.test.junit.QuarkusTest;
@@ -173,11 +172,8 @@ void helmInstall_createsDeployment() throws IOException {
173172

174173
assertThat(deployment.getSpec())
175174
.isNotNull()
176-
.satisfies(spec -> assertThat(spec.getTemplate().getSpec().getImagePullSecrets())
177-
.isNotEmpty()
178-
.element(0)
179-
.isNotNull()
180-
.isEqualTo(new LocalObjectReference(null))
175+
.satisfies(spec ->
176+
assertThat(spec.getTemplate().getSpec().getImagePullSecrets()).isEmpty()
181177
);
182178

183179
var selector = deployment.getSpec().getSelector();

0 commit comments

Comments
 (0)