Skip to content

Commit d950a25

Browse files
authored
Adding back the build-secret to the e2e test. (kubernetes-sigs#232)
The decision to remove it was a mistake. It was confused with `imageRepoSecret`. The build arg is supposed to be available to the `build` Dockerfile at `/run/secrets/build-secret/filename`. Signed-off-by: Yoni Bettan <[email protected]> Signed-off-by: Yoni Bettan <[email protected]>
1 parent fea0bd5 commit d950a25

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ci/module-kmm-ci-build.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ spec:
1616
build:
1717
baseImageRegistryTLS:
1818
insecure: true
19+
secrets:
20+
- name: build-secret
1921
dockerfileConfigMap:
2022
name: kmm-kmod-dockerfile
2123
# Optional. If kanikoParams.tag is empty, the default value will be: 'latest'

ci/prow/e2e-incluster-build

+9-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ if minikube ssh -- lsmod | grep kmm_ci_a; then
1111
exit 1
1212
fi
1313

14+
echo "Create a build secret..."
15+
oc create secret generic build-secret --from-literal=ci-build-secret=super-secret-value
16+
1417
echo "Add a configmap that contain the kernel module build dockerfile..."
1518
kubectl apply -f ci/kmm-kmod-dockerfile.yaml
1619

@@ -23,10 +26,14 @@ echo "Waiting for the build pod to be created..."
2326
timeout 1m bash -c 'until kubectl get pods -o json | jq -er ".items[].metadata.name | select(.? | match(\"build\"))"; do sleep 1; done'
2427
POD_NAME=$(kubectl get pods -o json | jq -r '.items[].metadata.name | select(.? | match("build"))')
2528

29+
# we can't exec a command nor get the logs on a pod that isn't `Running` yet.
30+
kubectl wait pod/${POD_NAME} --for jsonpath='{.status.phase}'=Running --timeout=60s
31+
32+
# Check that the build secret is available to the build pod
33+
timeout 1m bash -c "until kubectl exec ${POD_NAME} -- grep super-secret-value /run/secrets/build-secret/ci-build-secret; do sleep 3; done"
34+
2635
# The build job/pod is deleted once done so we won't be able to get this info later on in the troubleshooting section.
2736
echo "Print the build logs..."
28-
# we can't get the logs on a pod that isn't `Running` yet.
29-
kubectl wait pod/${POD_NAME} --for jsonpath='{.status.phase}'=Running --timeout=60s
3037
kubectl logs pod/${POD_NAME} -f
3138

3239
echo "Check that the module gets loaded on the node..."

0 commit comments

Comments
 (0)