Skip to content

Commit

Permalink
Manually propagate eirini service account
Browse files Browse the repository at this point in the history
- use correct root namespace for e2e tests

Co-authored-by: Andrew Costa <ancosta@vmware.com>
Co-authored-by: Tim Downey <tdowney@vmware.com>
  • Loading branch information
3 people committed Nov 19, 2021
1 parent bdf5380 commit 2b8a625
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
63 changes: 36 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,34 +283,43 @@ certificate when connecting to the API.
As the current implementation of HNC does not correctly propagate ServiceAccounts, when we `cf create-space`, the ServiceAccount required for image building is absent. We must create the
ServiceAccount ourselves with a reference to the image registry credentials.

Pre-req: Have a local copy of the required ServiceAccount resource
```
cat <<EOF >> kpack-service-account.yml
apiVersion: v1
imagePullSecrets:
- name: image-registry-credentials
kind: ServiceAccount
metadata:
name: kpack-service-account
secrets:
- name: image-registry-credentials
EOF
```
1. Pre-req: Have a local copy of the required ServiceAccount resources

```
cat <<EOF >> service-accounts.yml
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: eirini
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kpack-service-account
imagePullSecrets:
- name: image-registry-credentials
secrets:
- name: image-registry-credentials
EOF
```

1. Create the cf space
```
cf create-org <org_name>
cf target -o <org_name>
cf create-space <space_name>
```
2. Get the cf space guid which corresponds to the kubernetes namespace in which we create the ServiceAccount
```
cf space <space_name> —guid
```
3. Apply the service-account yaml to that namespace
```
kubectl apply -f kpack-service-account.yml -n <space_guid>
```
```
cf create-org <org_name>
cf target -o <org_name>
cf create-space <space_name>
```

1. Get the cf space guid which corresponds to the kubernetes namespace in which we create the ServiceAccount
```
cf space <space_name> —guid
```

1. Apply the `service-accounts.yml` to that namespace
```
kubectl apply -f service-accounts.yml -n <space_guid>
```

### Running Tests
make
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else

export KUBECONFIG="${HOME}/.kube/e2e.yml"
export API_SERVER_ROOT=http://localhost
export ROOT_NAMESPACE=cf-k8s-api-system
export ROOT_NAMESPACE=cf

extra_args+=("--slow-spec-threshold=30s")
fi
Expand Down

0 comments on commit 2b8a625

Please sign in to comment.