added 'kubectl create sa' to create serviceaccounts

This commit is contained in:
Steve Kuznetsov
2016-02-17 13:15:32 -05:00
parent d1798010c1
commit e5b696ee43
13 changed files with 613 additions and 1 deletions

View File

@@ -856,6 +856,28 @@ __EOF__
kubectl delete configmap test-configmap --namespace=test-configmaps
kubectl delete namespace test-configmaps
####################
# Service Accounts #
####################
### Create a new namespace
# Pre-condition: the test-service-accounts namespace does not exist
kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-service-accounts\" }}found{{end}}{{end}}:' ':'
# Command
kubectl create namespace test-service-accounts
# Post-condition: namespace 'test-service-accounts' is created.
kube::test::get_object_assert 'namespaces/test-service-accounts' "{{$id_field}}" 'test-service-accounts'
### Create a service account in a specific namespace
# Command
kubectl create serviceaccount test-service-account --namespace=test-service-accounts
# Post-condition: secret exists and has expected values
kube::test::get_object_assert 'serviceaccount/test-service-account --namespace=test-service-accounts' "{{$id_field}}" 'test-service-account'
# Clean-up
kubectl delete serviceaccount test-service-account --namespace=test-service-accounts
# Clean up
kubectl delete namespace test-service-accounts
#################
# Pod templates #
#################