Skip to content

Commit 4adeb28

Browse files
author
Nicholas Thomson
committed
Update Go template with new service names
1 parent 1d5377d commit 4adeb28

24 files changed

+44
-43
lines changed

pkg/model/model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type Model struct {
5151
// service API
5252
func (m *Model) MetaVars() templateset.MetaVars {
5353
return templateset.MetaVars{
54+
ServiceAlias: m.serviceAlias,
5455
ServiceAliasClean: m.ServiceAliasClean(),
5556
ServiceModelName: m.serviceModelName,
5657
APIGroup: m.APIGroup(),

templates/cmd/controller/main.go.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ import (
1414
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1515
ctrlrt "sigs.k8s.io/controller-runtime"
1616
ctrlrtmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
17-
svcsdk "github.com/aws/aws-sdk-go/service/{{ .ServiceIDClean }}"
17+
svcsdk "github.com/aws/aws-sdk-go/service/{{ .ServiceAlias }}"
1818

1919
ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
20-
svcresource "github.com/aws-controllers-k8s/{{ .ServiceIDClean }}-controller/pkg/resource"
21-
svctypes "github.com/aws-controllers-k8s/{{ .ServiceIDClean }}-controller/apis/{{ .APIVersion }}"
20+
svcresource "github.com/aws-controllers-k8s/{{ .ServiceAlias }}-controller/pkg/resource"
21+
svctypes "github.com/aws-controllers-k8s/{{ .ServiceAlias }}-controller/apis/{{ .APIVersion }}"
2222
{{/* TODO(a-hilaly): import apis/* packages to register webhooks */}}
23-
{{ $serviceIDClean := .ServiceIDClean }} {{range $crdName := .SnakeCasedCRDNames }}_ "github.com/aws-controllers-k8s/{{ $serviceIDClean }}-controller/pkg/resource/{{ $crdName }}"
23+
{{ $serviceAlias := .ServiceAlias }} {{range $crdName := .SnakeCasedCRDNames }}_ "github.com/aws-controllers-k8s/{{ $serviceAlias }}-controller/pkg/resource/{{ $crdName }}"
2424
{{end}}
2525
)
2626

2727
var (
2828
awsServiceAPIGroup = "{{ .APIGroup }}"
29-
awsServiceAlias = "{{ .ServiceIDClean }}"
29+
awsServiceAlias = "{{ .ServiceAlias }}"
3030
awsServiceEndpointsID = svcsdk.EndpointsID
3131
scheme = runtime.NewScheme()
3232
setupLog = ctrlrt.Log.WithName("setup")

templates/config/controller/deployment.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
apiVersion: apps/v1
99
kind: Deployment
1010
metadata:
11-
name: ack-{{ .ServiceIDClean }}-controller
11+
name: ack-{{ .ServiceAlias }}-controller
1212
namespace: ack-system
1313
labels:
1414
control-plane: controller

templates/config/controller/kustomization_def.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
66
kind: Kustomization
77
images:
88
- name: controller
9-
newName: ack-{{ .ServiceIDClean }}-controller
9+
newName: ack-{{ .ServiceAlias }}-controller
1010
newTag: latest
1111
{{end}}

templates/config/controller/service.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: ack-{{ .ServiceIDClean }}-metrics-service
4+
name: ack-{{ .ServiceAlias }}-metrics-service
55
namespace: ack-system
66
spec:
77
selector:

templates/config/controller/user-env.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: ack-{{.ServiceIDClean}}-controller
4+
name: ack-{{.ServiceAlias}}-controller
55
namespace: {{.Annotations.SuggestedNamespace}}
66
spec:
77
template:

templates/config/manifests/bases/clusterserviceversion.yaml.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ metadata:
77
capabilities: {{.Annotations.CapabilityLevel}}
88
operatorframework.io/suggested-namespace: "ack-system"
99
repository: {{.Annotations.Repository}}
10-
containerImage: {{.Annotations.ContainerImage}}/{{.ServiceIDClean}}-controller:v{{.Version}}
10+
containerImage: {{.Annotations.ContainerImage}}/{{.ServiceAlias}}-controller:v{{.Version}}
1111
description: {{.Annotations.ShortDescription}}
1212
createdAt: {{.CreatedAt}}
1313
support: {{.Annotations.Support}}
1414
certified: {{.Annotations.IsCertified}}
15-
name: ack-{{.ServiceIDClean }}-controller.v0.0.0
15+
name: ack-{{.ServiceAlias }}-controller.v0.0.0
1616
namespace: placeholder
1717
spec:
1818
apiservicedefinitions: {}
@@ -42,7 +42,7 @@ spec:
4242
type: {{ .Type }}
4343
{{- end}}
4444
keywords:
45-
- {{.ServiceIDClean}}
45+
- {{.ServiceAlias}}
4646
{{- range .Common.Keywords}}
4747
- {{ . }}
4848
{{- end}}

templates/config/overlays/namespaced/kustomization.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ patches:
66
group: rbac.authorization.k8s.io
77
version: v1
88
kind: ClusterRole
9-
name: ack-{{ .ServiceIDClean }}-controller
9+
name: ack-{{ .ServiceAlias }}-controller
1010
- path: role-binding.json
1111
target:
1212
group: rbac.authorization.k8s.io
1313
version: v1
1414
kind: ClusterRoleBinding
15-
name: ack-{{ .ServiceIDClean }}-controller-rolebinding
15+
name: ack-{{ .ServiceAlias }}-controller-rolebinding

templates/config/rbac/cluster-role-binding.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: ack-{{ .ServiceIDClean }}-controller-rolebinding
4+
name: ack-{{ .ServiceAlias }}-controller-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: ack-{{ .ServiceIDClean }}-controller
8+
name: ack-{{ .ServiceAlias }}-controller
99
subjects:
1010
- kind: ServiceAccount
1111
name: default

templates/config/rbac/role-reader.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:
55
creationTimestamp: null
6-
name: ack-{{ .ServiceIDClean }}-reader
6+
name: ack-{{ .ServiceAlias }}-reader
77
namespace: default
88
rules:
99
- apiGroups:

0 commit comments

Comments
 (0)