Skip to content

Commit fc4dacd

Browse files
authored
refactor(argus, csc): split docker image repo (#108)
1 parent 7820344 commit fc4dacd

File tree

11 files changed

+131
-26
lines changed

11 files changed

+131
-26
lines changed

charts/argus/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ maintainers:
66
77
name: LogicMonitor
88
name: argus
9-
version: 2.2.0-rt03
9+
version: 2.3.0-rc01
1010
home: https://logicmonitor.github.io/helm-charts-qa
1111
appVersion: v8.2.0-rc3

charts/argus/templates/_helpers.tpl

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,36 @@ app: collector
152152
{{ define "argus.imagePullSecrets" }}
153153
{{ $result := (concat .Values.imagePullSecrets .Values.global.imagePullSecrets | uniq)}}
154154
{{ toYaml $result | nindent 0 }}
155-
{{ end }}
155+
{{ end }}
156+
157+
158+
{{- define "argus-image" -}}
159+
{{- $registry := "" -}}
160+
{{- $repo := "logicmonitor" -}}
161+
{{- if .Values.image.registry -}}
162+
{{- $registry = .Values.image.registry -}}
163+
{{- else if .Values.global.image.registry -}}
164+
{{- $registry = .Values.global.image.registry -}}
165+
{{- end -}}
166+
{{- if .Values.image.repository -}}
167+
{{- $repo = .Values.image.repository -}}
168+
{{- else if .Values.global.image.repository -}}
169+
{{- $repo = .Values.global.image.repository -}}
170+
{{- end -}}
171+
{{- if ne $registry "" -}}
172+
"{{ $registry }}/{{ $repo }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
173+
{{- else -}}
174+
"{{ $repo }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
175+
{{- end -}}
176+
{{- end -}}
177+
178+
179+
{{- define "collector-image" -}}
180+
{{- $repo := "logicmonitor" -}}
181+
{{- if .Values.collector.image.repository -}}
182+
{{- $repo = .Values.collector.image.repository -}}
183+
{{- else if .Values.global.image.repository -}}
184+
{{- $repo = .Values.global.image.repository -}}
185+
{{- end -}}
186+
"{{ $repo }}/{{ .Values.collector.image.name }}"
187+
{{- end -}}

charts/argus/templates/collectorset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
spec:
1111
image:
1212
registry: {{ .Values.collector.image.registry | default .Values.global.image.registry }}
13-
repository: {{ required "A valid .Values.collector.imageRepository entry is required!" .Values.collector.image.repository }}
13+
repository: {{ include "collector-image" . }}
1414
tag: {{ required "A valid .Values.collector.imageTag entry is required!" .Values.collector.image.tag }}
1515
pullPolicy: {{ .Values.collector.image.pullPolicy | default (.Values.global.image.pullPolicy | default "Always") }}
1616
policy:

charts/argus/templates/deployment.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ spec:
3939
{{ end }}
4040
containers:
4141
- name: argus
42-
{{- if or .Values.image.registry }}
43-
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
44-
{{ else if .Values.global.image.registry }}
45-
image: "{{ .Values.global.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
46-
{{ else }}
47-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
48-
{{ end }}
42+
image: {{ include "argus-image" . }}
4943
imagePullPolicy: {{ .Values.image.pullPolicy | default (.Values.global.image.pullPolicy | default "Always") }}
5044
{{ with .Values.resources }}
5145
resources:

charts/argus/values.schema.json

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,22 @@
256256
"type": "string",
257257
"title": "Argus Image Repository Schema",
258258
"description": "The Docker Repository Name for Argus Image",
259-
"default": "logicmonitor/argus",
259+
"default": "logicmonitor",
260+
"minLength": 0,
261+
"examples": [
262+
"logicmonitor"
263+
]
264+
},
265+
"name": {
266+
"$id": "#/properties/image/properties/name",
267+
"$comment": "tf:optional",
268+
"type": "string",
269+
"title": "Argus Image Name Schema",
270+
"description": "The Docker Argus Image Name",
271+
"default": "argus",
260272
"minLength": 1,
261273
"examples": [
262-
"logicmonitor/argus"
274+
"argus"
263275
]
264276
},
265277
"pullPolicy": {
@@ -1415,7 +1427,18 @@
14151427
"description": "Describes the purpose of this instance.",
14161428
"default": "",
14171429
"examples": [
1418-
"logicmonitor/collector"
1430+
"logicmonitor"
1431+
]
1432+
},
1433+
"name": {
1434+
"$comment": "tf:optional",
1435+
"$id": "#/properties/collector/properties/image/properties/name",
1436+
"type": "string",
1437+
"title": "The collector image name schema",
1438+
"description": "Describes the purpose of this instance.",
1439+
"default": "",
1440+
"examples": [
1441+
"collector"
14191442
]
14201443
},
14211444
"tag": {
@@ -2097,6 +2120,18 @@
20972120
"382028353997.dkr.ecr.us-west-2.amazonaws.com"
20982121
]
20992122
},
2123+
"repository": {
2124+
"$comment": "tf:optional",
2125+
"$id": "#/properties/global/properties/image/properties/repository",
2126+
"type": "string",
2127+
"title": "The repository schema",
2128+
"description": "Container Image Repository.",
2129+
"default": "",
2130+
"minLength": 0,
2131+
"examples": [
2132+
"logicmonitor"
2133+
]
2134+
},
21002135
"pullPolicy": {
21012136
"$comment": "tf:optional",
21022137
"$id": "#/properties/global/properties/image/properties/pullpolicy",
@@ -2441,6 +2476,7 @@
24412476
}
24422477
},
24432478
"toleration": {
2479+
"$comment": "",
24442480
"oneOf": [
24452481
{
24462482
"properties": {

charts/argus/values.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ clusterTreeParentID: 1
2121
## OPTIONAL VALUES - used for Kubernetes Manifest files
2222
image:
2323
registry: ""
24-
repository: logicmonitor/argus
24+
repository: ""
25+
name: argus
2526
pullPolicy: ""
2627
# Overrides the image tag whose default is the chart appVersion.
2728
tag: ""
@@ -133,7 +134,8 @@ collector:
133134
# The image repository of the [Collector](https://hub.docker.com/r/logicmonitor/collector) container.
134135
image:
135136
registry: ""
136-
repository: logicmonitor/collector
137+
repository: ""
138+
name: collector
137139
tag: latest
138140
pullPolicy: ""
139141
## OPTIONAL VALUES
@@ -184,6 +186,7 @@ global:
184186
pass: ""
185187
image:
186188
registry: ""
189+
repository: ""
187190
pullPolicy: Always
188191
collectorsetServiceNameSuffix: ""
189192
imagePullSecrets: []

charts/collectorset-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ maintainers:
66
77
name: LogicMonitor
88
name: collectorset-controller
9-
version: 1.1.0-rt02
9+
version: 1.2.0-rc01
1010
home: https://logicmonitor.github.io/helm-charts-qa
1111
appVersion: v4.1.0-rc4

charts/collectorset-controller/templates/_helpers.tpl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,25 @@ Return the appropriate apiVersion for rbac.
108108
{{ define "collectorset-controller.imagePullSecrets" }}
109109
{{ $result := (concat .Values.imagePullSecrets .Values.global.imagePullSecrets | uniq)}}
110110
{{ toYaml $result | nindent 0 }}
111-
{{ end }}
111+
{{ end }}
112+
113+
114+
{{- define "csc-image" -}}
115+
{{- $registry := "" -}}
116+
{{- $repo := "logicmonitor" -}}
117+
{{- if .Values.image.registry -}}
118+
{{- $registry = .Values.image.registry -}}
119+
{{- else if .Values.global.image.registry -}}
120+
{{- $registry = .Values.global.image.registry -}}
121+
{{- end -}}
122+
{{- if .Values.image.repository -}}
123+
{{- $repo = .Values.image.repository -}}
124+
{{- else if .Values.global.image.repository -}}
125+
{{- $repo = .Values.global.image.repository -}}
126+
{{- end -}}
127+
{{- if ne $registry "" -}}
128+
"{{ $registry }}/{{ $repo }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
129+
{{- else -}}
130+
"{{ $repo }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
131+
{{- end -}}
132+
{{- end -}}

charts/collectorset-controller/templates/deployment.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ spec:
3838
{{- end }}
3939
containers:
4040
- name: collectorset-controller
41-
{{- if or .Values.image.registry }}
42-
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
43-
{{ else if .Values.global.image.registry }}
44-
image: "{{ .Values.global.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
45-
{{ else }}
46-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
47-
{{ end }}
41+
image: {{ include "csc-image" . }}
4842
imagePullPolicy: {{ .Values.image.pullPolicy | default (.Values.global.image.pullPolicy | default "Always") }}
4943
{{ if and ( .Values.probe.enabled) ( .Values.probe.grpcContainerProbeEnabled ) ( semverCompare ">=1.24.0-0" .Capabilities.KubeVersion.Version )}}
5044
startupProbe:

charts/collectorset-controller/values.schema.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,18 @@
261261
"description": "An explanation about the purpose of this instance.",
262262
"default": "",
263263
"examples": [
264-
"logicmonitor/collectorset-controller"
264+
"logicmonitor"
265+
]
266+
},
267+
"name": {
268+
"$comment": "tf:optional",
269+
"$id": "#/properties/image/properties/name",
270+
"type": "string",
271+
"title": "The name schema",
272+
"description": "An explanation about the purpose of this instance.",
273+
"default": "",
274+
"examples": [
275+
"collectorset-controller"
265276
]
266277
},
267278
"pullPolicy": {
@@ -488,6 +499,18 @@
488499
"382028353997.dkr.ecr.us-west-2.amazonaws.com"
489500
]
490501
},
502+
"repository": {
503+
"$comment": "tf:optional",
504+
"$id": "#/properties/global/properties/image/properties/repository",
505+
"type": "string",
506+
"title": "The repository schema",
507+
"description": "Container Image Repository.",
508+
"default": "",
509+
"minLength": 0,
510+
"examples": [
511+
"logicmonitor"
512+
]
513+
},
491514
"pullPolicy": {
492515
"$id": "#/properties/global/properties/image/properties/pullpolicy",
493516
"type": "string",

charts/collectorset-controller/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ rbac:
2121
# The public etcd discovery token used to add etcd hosts to the cluster device group.
2222
image:
2323
registry: ""
24-
repository: logicmonitor/collectorset-controller
24+
repository: ""
25+
name: collectorset-controller
2526
pullPolicy: ""
2627
# Overrides the image tag whose default is the chart appVersion.
2728
tag: ""
@@ -57,6 +58,7 @@ global:
5758
pass: ""
5859
image:
5960
registry: ""
61+
repository: ""
6062
pullPolicy: Always
6163
imagePullSecrets: []
6264

0 commit comments

Comments
 (0)