Skip to content

Commit 120ec75

Browse files
committed
commands,test: add service account to ansible operator
1 parent 9262b56 commit 120ec75

File tree

4 files changed

+3
-0
lines changed

4 files changed

+3
-0
lines changed

commands/operator-sdk/cmd/new.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func doAnsibleScaffold() {
181181
GeneratePlaybook: generatePlaybook,
182182
},
183183
galaxyInit,
184+
&scaffold.ServiceAccount{},
184185
&scaffold.Role{},
185186
&scaffold.RoleBinding{},
186187
&ansible.Operator{},

pkg/scaffold/ansible/operator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
labels:
4747
name: {{.ProjectName}}
4848
spec:
49+
serviceAccountName: {{.ProjectName}}
4950
containers:
5051
- name: {{.ProjectName}}
5152
# Replace this with the built image name
39.1 MB
Binary file not shown.

test/test-ansible.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ sed -i "s|REPLACE_IMAGE|$DEST_IMAGE|g" deploy/operator.yaml
2727
sed -i 's|Always|Never|g' deploy/operator.yaml
2828

2929
# deploy the operator
30+
kubectl create -f deploy/sa.yaml
3031
kubectl create -f deploy/role.yaml
3132
kubectl create -f deploy/role_binding.yaml
3233
kubectl create -f deploy/crds/ansible_v1alpha1_memcached_crd.yaml

0 commit comments

Comments
 (0)