Test client

This commit is contained in:
erthalion 2019-05-07 14:27:29 +02:00
parent af13605abf
commit c772287e0d
5 changed files with 22 additions and 26 deletions

View File

@ -93,7 +93,7 @@ test:
@go test ./... @go test ./...
e2e-tools: e2e-tools:
@pip3 install -r e2e/requirements.txt @pip3 install --user --upgrade -r e2e/requirements.txt
@go get -u sigs.k8s.io/kind @go get -u sigs.k8s.io/kind
# assumes kubectl is already isntalled # assumes kubectl is already isntalled

View File

@ -35,7 +35,7 @@ class SmokeTestCase(unittest.TestCase):
# 1. creating RBAC entites with a separate client fails # 1. creating RBAC entites with a separate client fails
# with "AttributeError: object has no attribute 'select_header_accept'" # with "AttributeError: object has no attribute 'select_header_accept'"
# 2. utils.create_from_yaml cannot create multiple entites from a single file # 2. utils.create_from_yaml cannot create multiple entites from a single file
subprocess.run(["kubectl", "create", "-f", "manifests/operator-service-account-rbac.yaml"]) # subprocess.run(["kubectl", "create", "-f", "manifests/operator-service-account-rbac.yaml"])
for filename in ["configmap.yaml", "postgres-operator.yaml"]: for filename in ["configmap.yaml", "postgres-operator.yaml"]:
utils.create_from_yaml(k8s_api.k8s_client, "manifests/" + filename) utils.create_from_yaml(k8s_api.k8s_client, "manifests/" + filename)

View File

@ -1,10 +1,3 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: zalando-postgres-operator
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
@ -139,19 +132,3 @@ rules:
- bind - bind
resourceNames: resourceNames:
- zalando-postgres-operator - zalando-postgres-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: zalando-postgres-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: zalando-postgres-operator
subjects:
- kind: ServiceAccount
# note: the cluster role binding needs to be defined
# for every namespace the operator service account lives in.
name: zalando-postgres-operator
namespace: default

View File

@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: zalando-postgres-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: zalando-postgres-operator
subjects:
- kind: ServiceAccount
# note: the cluster role binding needs to be defined
# for every namespace the operator service account lives in.
name: zalando-postgres-operator
namespace: default

View File

@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: zalando-postgres-operator
namespace: default