Skip to content

Commit 9bc6c12

Browse files
authored
fix(csc): add tf comments (#103)
1 parent 17d1635 commit 9bc6c12

File tree

7 files changed

+58
-1
lines changed

7 files changed

+58
-1
lines changed

.github/workflows/add-release-assets.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ jobs:
9595
asset_path: ./lm-container-ui-jsonpaths.json
9696
asset_name: lm-container-ui-jsonpaths.json
9797
asset_content_type: text/plain
98+
- uses: hashicorp/setup-terraform@v2
99+
if: ${{ steps.get_chart.outputs.chartname == 'lm-container' }}
100+
- name: Terraform fmt
101+
if: ${{ steps.get_chart.outputs.chartname == 'lm-container' }}
102+
id: fmt
103+
run: cd terraform-lm-lmc && terraform fmt && cd ..
104+
continue-on-error: true
98105
- name: Push Terraform Scripts
99106
if: ${{ steps.get_chart.outputs.chartname == 'lm-container' }}
100107
uses: stefanzweifel/git-auto-commit-action@v4

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-rt01
9+
version: 1.1.0-rt02
1010
home: https://logicmonitor.github.io/helm-charts-qa
1111
appVersion: v4.1.0-rc4

charts/collectorset-controller/values.schema.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,17 @@
5959
"accessKey",
6060
"account"
6161
],
62+
"$comment": "tf:optional",
6263
"properties": {
6364
"enabled": {
65+
"$comment": "tf:optional",
6466
"$id": "#/properties/enabled",
6567
"description": "Defined for umbrella chart but unused here.",
6668
"type": "boolean",
6769
"default": true
6870
},
6971
"accessID": {
72+
"$comment": "tf:optional",
7073
"$id": "#/properties/accessID",
7174
"type": "string",
7275
"title": "The accessID schema",
@@ -77,6 +80,7 @@
7780
]
7881
},
7982
"accessKey": {
83+
"$comment": "tf:optional",
8084
"$id": "#/properties/accessKey",
8185
"type": "string",
8286
"title": "The accessKey schema",
@@ -87,6 +91,7 @@
8791
]
8892
},
8993
"account": {
94+
"$comment": "tf:optional",
9095
"$id": "#/properties/account",
9196
"type": "string",
9297
"title": "The account schema",
@@ -98,6 +103,7 @@
98103
},
99104
"log": {
100105
"$id": "#/properties/log",
106+
"$comment": "tf:optional",
101107
"type": "object",
102108
"title": "The log schema",
103109
"description": "An explanation about the purpose of this instance.",
@@ -112,6 +118,7 @@
112118
],
113119
"properties": {
114120
"level": {
121+
"$comment": "tf:optional",
115122
"$id": "#/properties/log/properties/level",
116123
"type": "string",
117124
"title": "The level schema",
@@ -135,6 +142,7 @@
135142
"additionalProperties": false
136143
},
137144
"nameOverride": {
145+
"$comment": "tf:optional",
138146
"$id": "#/properties/nameOverride",
139147
"type": "string",
140148
"title": "The nameOverride schema",
@@ -145,6 +153,7 @@
145153
]
146154
},
147155
"fullnameOverride": {
156+
"$comment": "tf:optional",
148157
"$id": "#/properties/fullnameOverride",
149158
"type": "string",
150159
"title": "The fullnameOverride schema",
@@ -155,6 +164,7 @@
155164
]
156165
},
157166
"serviceAccount": {
167+
"$comment": "tf:optional",
158168
"$id": "#/properties/serviceAccount",
159169
"type": "object",
160170
"title": "The serviceAccount schema",
@@ -170,6 +180,7 @@
170180
],
171181
"properties": {
172182
"create": {
183+
"$comment": "tf:optional",
173184
"$id": "#/properties/serviceAccount/properties/create",
174185
"type": "boolean",
175186
"title": "The create schema",
@@ -183,6 +194,7 @@
183194
"additionalProperties": false
184195
},
185196
"rbac": {
197+
"$comment": "tf:optional",
186198
"$id": "#/properties/rbac",
187199
"type": "object",
188200
"title": "The rbac schema",
@@ -198,6 +210,7 @@
198210
],
199211
"properties": {
200212
"create": {
213+
"$comment": "tf:optional",
201214
"$id": "#/properties/rbac/properties/create",
202215
"type": "boolean",
203216
"title": "The create schema",
@@ -211,6 +224,7 @@
211224
"additionalProperties": false
212225
},
213226
"image": {
227+
"$comment": "tf:optional",
214228
"$id": "#/properties/image",
215229
"type": "object",
216230
"title": "The image schema",
@@ -228,6 +242,7 @@
228242
],
229243
"properties": {
230244
"registry": {
245+
"$comment": "tf:optional",
231246
"$id": "#/properties/image/properties/registry",
232247
"type": "string",
233248
"title": "The registry schema",
@@ -239,6 +254,7 @@
239254
]
240255
},
241256
"repository": {
257+
"$comment": "tf:optional",
242258
"$id": "#/properties/image/properties/repository",
243259
"type": "string",
244260
"title": "The repository schema",
@@ -249,6 +265,7 @@
249265
]
250266
},
251267
"pullPolicy": {
268+
"$comment": "tf:optional",
252269
"$id": "#/properties/image/properties/pullPolicy",
253270
"type": "string",
254271
"title": "The pullPolicy schema",
@@ -265,6 +282,7 @@
265282
]
266283
},
267284
"tag": {
285+
"$comment": "tf:optional",
268286
"$id": "#/properties/image/properties/tag",
269287
"type": "string",
270288
"title": "The tag schema",
@@ -278,6 +296,7 @@
278296
"additionalProperties": false
279297
},
280298
"proxy": {
299+
"$comment": "tf:optional",
281300
"$id": "#/properties/proxy",
282301
"type": "object",
283302
"title": "The proxy schema",
@@ -294,6 +313,7 @@
294313
],
295314
"properties": {
296315
"url": {
316+
"$comment": "tf:optional",
297317
"$id": "#/properties/proxy/properties/url",
298318
"type": "string",
299319
"title": "The url schema",
@@ -304,6 +324,7 @@
304324
]
305325
},
306326
"user": {
327+
"$comment": "tf:optional",
307328
"$id": "#/properties/proxy/properties/user",
308329
"type": "string",
309330
"title": "The user schema",
@@ -314,6 +335,7 @@
314335
]
315336
},
316337
"pass": {
338+
"$comment": "tf:optional",
317339
"$id": "#/properties/proxy/properties/pass",
318340
"type": "string",
319341
"title": "The pass schema",
@@ -327,6 +349,7 @@
327349
"additionalProperties": false
328350
},
329351
"nodeSelector": {
352+
"$comment": "tf:optional,yamlencode",
330353
"$id": "#/properties/nodeSelector",
331354
"type": "object",
332355
"title": "The nodeSelector schema",
@@ -341,6 +364,7 @@
341364
"description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/"
342365
},
343366
"affinity": {
367+
"$comment": "tf:optional,yamlencode",
344368
"$id": "#/properties/affinity",
345369
"type": "object",
346370
"title": "The affinity schema",
@@ -352,6 +376,7 @@
352376
"required": []
353377
},
354378
"priorityClassName": {
379+
"$comment": "tf:optional",
355380
"$id": "#/properties/priorityClassName",
356381
"type": "string",
357382
"title": "The priorityClassName schema",
@@ -362,6 +387,7 @@
362387
]
363388
},
364389
"tolerations": {
390+
"$comment": "tf:optional,yamlencode",
365391
"$id": "#/properties/tolerations",
366392
"type": "array",
367393
"title": "The tolerations schema",
@@ -378,6 +404,7 @@
378404
"uniqueItems": true
379405
},
380406
"labels": {
407+
"$comment": "tf:optional,yamlencode",
381408
"$id": "#/properties/labels",
382409
"type": "object",
383410
"title": "The labels schema",
@@ -392,6 +419,7 @@
392419
"required": []
393420
},
394421
"annotations": {
422+
"$comment": "tf:optional,yamlencode",
395423
"$id": "#/properties/annotations",
396424
"type": "object",
397425
"title": "The annotations schema",
@@ -406,6 +434,7 @@
406434
"required": []
407435
},
408436
"ignoreSSL": {
437+
"$comment": "tf:optional",
409438
"$id": "#/properties/ignoreSSL",
410439
"type": "boolean",
411440
"title": "The ignoreSSL schema",
@@ -416,6 +445,7 @@
416445
]
417446
},
418447
"global": {
448+
"$comment": "tf:optional",
419449
"$id": "#/properties/global",
420450
"type": "object",
421451
"additionalProperties": true,
@@ -525,6 +555,7 @@
525555
}
526556
},
527557
"collectorsetServiceNameSuffix": {
558+
"$comment": "tf:optional",
528559
"type": "string",
529560
"default": "",
530561
"description": "Suffix to be added to .Release.name to generate Collectorset controller service name.\nKeep it empty while installing this chart individually, umbrella chart uses this to generate unique name across"

scripts/lmtf/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module github.com/logicmonitor/helm-charts-qa/scripts/lmtf
22

33
go 1.18
4+
5+
require gopkg.in/yaml.v3 v3.0.1

scripts/lmtf/lmtf

595 KB
Binary file not shown.

scripts/lmtf/lmtf-mac

585 KB
Binary file not shown.

scripts/lmtf/main.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"github.com/logicmonitor/helm-charts-qa/scripts/lmtf/pkg/load"
66
"github.com/logicmonitor/helm-charts-qa/scripts/lmtf/pkg/tmpl"
77
"github.com/logicmonitor/helm-charts-qa/scripts/lmtf/pkg/vardef"
8+
"gopkg.in/yaml.v3"
9+
"io/ioutil"
810
"os"
911
)
1012

@@ -13,6 +15,19 @@ func main() {
1315
fmt.Println("Insufficient params: <path> <tmpl file> <var file>")
1416
return
1517
}
18+
bytes, err := ioutil.ReadFile(os.Args[1] + "/Chart.yaml")
19+
cm := map[string]any{}
20+
if err == nil {
21+
err = yaml.Unmarshal(bytes, &cm)
22+
if err != nil {
23+
fmt.Printf("unable to read Chart.yaml to determine version: %s\n", err)
24+
return
25+
}
26+
}
27+
version := ""
28+
if v, ok := cm["version"]; ok {
29+
version = v.(string)
30+
}
1631
m, err := load.WalkSchema(os.Args[1])
1732
if err != nil {
1833
fmt.Println("chart directory doesn't exist")
@@ -26,6 +41,8 @@ func main() {
2641
varDef := vardef.ProcessVarDef(m, "")
2742
defs := vardef.Dump(varDef)
2843

44+
defs = fmt.Sprintf("%s\nvariable \"lm_container_version\" {\n type = string\n default = \"%s\"\n}", defs, version)
45+
2946
err = os.WriteFile(os.Args[3], []byte(defs), os.ModePerm)
3047

3148
}

0 commit comments

Comments
 (0)