Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
{{- define "nexus-iq-server-ha.busyboxImage" -}}
{{- if ((.Values.global).busybox).imageRegistry }}{{ ((.Values.global).busybox).imageRegistry }}/{{ ((.Values.global).busybox).image }}:{{ ((.Values.global).busybox).tag }}{{- else }}{{ ((.Values.global).busybox).image }}:{{ ((.Values.global).busybox).tag }}{{- end }}
{{- end -}}

{{- define "nexus-iq-server-ha.fluentdImage" -}}
{{- if (.Values.fluentd.image).registry }}{{ (.Values.fluentd.image).registry }}/{{ (.Values.fluentd.image).repository }}:{{ (.Values.fluentd.image).tag }}{{- else }}{{ (.Values.fluentd.image).repository }}:{{ (.Values.fluentd.image).tag }}{{- end }}
{{- end -}}
2 changes: 1 addition & 1 deletion chart/templates/iq-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ spec:
{{- end }}
{{- if and (.Values.fluentd.enabled) (.Values.fluentd.sidecar_forwarder.enabled) }}
- name: {{ .Release.Name }}-fluentd-container
image: {{ .Values.fluentd.image.repository }}:{{ .Values.fluentd.image.tag }}
image: {{ include "nexus-iq-server-ha.fluentdImage" . }}
imagePullPolicy: {{ .Values.fluentd.image.pullPolicy }}
resources:
requests:
Expand Down
43 changes: 41 additions & 2 deletions chart/tests/iq-server-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ tests:
- env:
- name: FLUENTD_CONF
value: fluentd.yaml
image: bitnami/fluentd:1.18.0-debian-12-r0
image: docker.io/bitnami/fluentd:1.18.0-debian-12-r0
imagePullPolicy: IfNotPresent
name: RELEASE-NAME-fluentd-container
resources:
Expand Down Expand Up @@ -431,7 +431,7 @@ tests:
value: fluentd
- name: FLUENTD_DAEMON_GROUP
value: fluentd
image: bitnami/fluentd:1.18.0-debian-12-r0
image: docker.io/bitnami/fluentd:1.18.0-debian-12-r0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the registry should be included here, if not registry is defined, docker.io is not added by default according to the helper function.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests work as expected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is because the helper changes it to default to the full name, instead of an implied default registry, and thats what is defined in the default values for the subchart https://artifacthub.io/packages/helm/bitnami/fluentd?modal=values

imagePullPolicy: IfNotPresent
name: RELEASE-NAME-fluentd-container
securityContext:
Expand Down Expand Up @@ -848,3 +848,42 @@ tests:
path: spec.template.spec.containers[0].args
value: ["--debug", "--verbose"]
documentIndex: 0

- it: renders fluentd sidecar with custom registry
set:
iq_server:
tag: "1.148.0"
fluentd:
enabled: true
sidecar_forwarder:
enabled: true
image:
registry: "private-registry.example.com"
repository: "bitnami/fluentd"
tag: "1.18.0"
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.template.spec.containers[1].image
value: "private-registry.example.com/bitnami/fluentd:1.18.0"
documentIndex: 0

- it: renders fluentd sidecar without custom registry
set:
iq_server:
tag: "1.148.0"
fluentd:
enabled: true
sidecar_forwarder:
enabled: true
image:
repository: "bitnami/fluentd"
tag: "1.18.0"
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.template.spec.containers[1].image
value: "docker.io/bitnami/fluentd:1.18.0"
documentIndex: 0