SAP-archive / karydia

Kubernetes Security Walnut
Other
77 stars 10 forks source link

e2e-tests fail with minikube cluster #92

Closed ionysos closed 5 years ago

ionysos commented 5 years ago

Description

make e2e-test fail with minikube cluster current commit on master: 52b1c6ccdcae966ba6895573ef913f31af9179b5

Steps to reproduce

  1. minikube start --vm-driver=hyperkit
  2. checkout karydia master branch (commit: 52b1c6ccdcae966ba6895573ef913f31af9179b5)
  3. install karydia on cluster as described here
  4. run make e2e-test

Expected behavior

e2e-tests succeed

Logs / console output / screenshots / affected lines of code

console output: go test -v ./tests/e2e/... --server "" --kubeconfig "/Users/username/.kube/config" === RUN TestAutomountServiceAccountTokenForbidden --- FAIL: TestAutomountServiceAccountTokenForbidden (127.21s) karydia_admission_test.go:73: pod never reached state running === RUN TestAutomountServiceAccountTokenNonDefault --- PASS: TestAutomountServiceAccountTokenNonDefault (14.18s) === RUN TestAutomountServiceAccountTokenRemoveDefault --- FAIL: TestAutomountServiceAccountTokenRemoveDefault (12.16s) karydia_admission_test.go:173: pod's automountServiceAccountToken hasn't been set to false by default FAIL FAIL github.com/karydia/karydia/tests/e2e 178.939s ? github.com/karydia/karydia/tests/e2e/framework [no test files] make: *** [e2e-test] Error 1

kubectl describe pod/karydia-e2e-test-pod -n karydia-e2e-test-xyz12 (for associated pod) reveals: Name: karydia-e2e-test-pod Namespace: karydia-e2e-test-xyz12 Priority: 0 PriorityClassName: Node: Labels: Annotations: Status: Pending IP: Containers: nginx: Image: nginx Port: Host Port: Environment: Mounts: Conditions: Type Status PodScheduled False Volumes: QoS Class: BestEffort Node-Selectors: Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s node.kubernetes.io/unreachable:NoExecute for 300s Events: Type Reason Age From Message


Warning FailedScheduling 34s (x2 over 109s) default-scheduler Binding rejected: Internal error occurred: admission webhook "karydia.e2e.test" denied the request: [automount of service account not allowed]

Environment

ionysos commented 5 years ago

I tried also with:

Steps to reproduce

  1. minikube start --vm-driver=hyperkit --cpus 4 --memory 4096
  2. checkout karydia master branch (commit: 52b1c6ccdcae966ba6895573ef913f31af9179b5)
  3. install karydia on cluster as described here
  4. run make e2e-test

with same results.

Logs / console output / screenshots / affected lines of code

console output: go test -v ./tests/e2e/... --server "" --kubeconfig "/Users/username/.kube/config" === RUN TestAutomountServiceAccountTokenForbidden --- FAIL: TestAutomountServiceAccountTokenForbidden (120.16s) karydia_admission_test.go:73: pod never reached state running === RUN TestAutomountServiceAccountTokenNonDefault --- PASS: TestAutomountServiceAccountTokenNonDefault (10.16s) === RUN TestAutomountServiceAccountTokenRemoveDefault --- PASS: TestAutomountServiceAccountTokenRemoveDefault (3.17s) FAIL FAIL github.com/karydia/karydia/tests/e2e 153.957s ? github.com/karydia/karydia/tests/e2e/framework [no test files] make: *** [e2e-test] Error 1

ionysos commented 5 years ago

found the issue: I just used a wrong container registry and, thus, an old container image.