Skip to content

Commit 5f4c5d4

Browse files
committed
extract controller kustomization to named template
1 parent 41d11f7 commit 5f4c5d4

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

pkg/generate/ack/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ var (
3737
"config/crd/kustomization.yaml.tpl",
3838
}
3939
controllerIncludePaths = []string{
40+
"config/controller/kustomization_def.yaml.tpl",
4041
"boilerplate.go.tpl",
4142
"pkg/resource/sdk_find_read_one.go.tpl",
4243
"pkg/resource/sdk_find_get_attributes.go.tpl",
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
resources:
2-
- deployment.yaml
3-
- service.yaml
4-
apiVersion: kustomize.config.k8s.io/v1beta1
5-
kind: Kustomization
6-
images:
7-
- name: controller
8-
newName: ack-{{ .ServiceIDClean }}-controller
9-
newTag: latest
1+
{{ template "controller_kustomization" . }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- define "controller_kustomization" -}}
2+
resources:
3+
- deployment.yaml
4+
- service.yaml
5+
apiVersion: kustomize.config.k8s.io/v1beta1
6+
kind: Kustomization
7+
images:
8+
- name: controller
9+
newName: ack-{{ .ServiceIDClean }}-controller
10+
newTag: latest
11+
{{end}}

0 commit comments

Comments
 (0)