-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm-convert: Enable capturegroup default substitution
Signed-off-by: Jim Ramsay <[email protected]>
- Loading branch information
Showing
12 changed files
with
194 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/reference/metadata.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v2 | ||
parts: | ||
- name: ExamplePart | ||
components: | ||
- name: DemonSets | ||
allOf: | ||
- path: sa.yaml | ||
config: | ||
perField: | ||
- pathToKey: spec.value | ||
inlineDiffFunc: capturegroups | ||
- path: secret.yaml |
11 changes: 11 additions & 0 deletions
11
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/reference/sa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: {{ .apiVersion }} | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
k8s-app: kubernetes-dashboard | ||
name: {{ .metadata.name }} | ||
namespace: kubernetes-dashboard | ||
spec: | ||
value: |- | ||
Long string with (?<one>[a-z0-9]*) capturegroup | ||
And another (?<two>[a-z0-9]*) capturegorup |
10 changes: 10 additions & 0 deletions
10
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/reference/secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
k8s-app: kubernetes-dashboard | ||
name: {{ .metadata.name }} | ||
namespace: kubernetes-dashboard | ||
type: Opaque | ||
{{ if .data }}data: | ||
{{ .data | toYaml }}{{ end }} |
3 changes: 3 additions & 0 deletions
3
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/result/Chart.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
description: This Helm Chart was generated from a kube-compare reference | ||
name: Capturegroup Defaults | ||
version: "1" |
Empty file.
19 changes: 19 additions & 0 deletions
19
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/result/templates/sa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- $values := list (dict)}} | ||
{{- if .Values.sa}} | ||
{{- $values = .Values.sa }} | ||
{{- end }} | ||
{{- range $values -}} | ||
--- | ||
apiVersion: {{ .apiVersion }} | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
k8s-app: kubernetes-dashboard | ||
name: {{ .metadata.name }} | ||
namespace: kubernetes-dashboard | ||
spec: | ||
value: |- | ||
Long string with 100 capturegroup | ||
And another (?<two>[a-z0-9]*) capturegorup | ||
{{ end -}} |
18 changes: 18 additions & 0 deletions
18
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/result/templates/secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- $values := list (dict)}} | ||
{{- if .Values.secret}} | ||
{{- $values = .Values.secret }} | ||
{{- end }} | ||
{{- range $values -}} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
k8s-app: kubernetes-dashboard | ||
name: {{ .metadata.name }} | ||
namespace: kubernetes-dashboard | ||
type: Opaque | ||
{{ if .data }}data: | ||
{{ .data | toYaml }}{{ end }} | ||
|
||
{{ end -}} |
8 changes: 8 additions & 0 deletions
8
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/result/values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sa: | ||
- apiVersion: v1 | ||
metadata: | ||
name: kubernetes-dashboard | ||
secret: | ||
- data: {} | ||
metadata: | ||
name: {} |
6 changes: 6 additions & 0 deletions
6
addon-tools/helm-convert/convert/testdata/CapturegroupDefaults/values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
sa: | ||
- apiVersion: v1 | ||
metadata: | ||
name: kubernetes-dashboard | ||
captureGroup_defaults: | ||
one: 100 |