[BUG] Get chaos specs to run on kind v0.15
This is an offshoot of #1631
Describe the bug
As a part of Issue-1631, GitHub Actions yaml config was patched to use kind 0.14 to avoid issues with the kindest/node v1.25.0 container image.
Expected behavior
Chaos specs should be working on kind 0.15 without needing a patch to our GitHub Actions config.
This line in the GitHub Actions config for Chaos specs is not running as expected. Produces an empty result.
This is the line in the Chaos specs config in GitHub Actions YAML (under the "Run Crystal Spec" step.
CLUSTER_RATE_LIMIT=$(kubectl exec -ti $LOCAL_PATH_STORAGE_POD --namespace=kube-system -- curl --head -H "Authorization: Bearer $(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep ratelimit-remaining || true)
The nested curl command for the auth header, which is within quotes, is interpreted first before passing the command to the kubectl. This is because the $ is not escaped for the nested curl command to run within the container.
Resolving this issue involves doing the following in the GitHub Actions config.
1. Replace use of kindnet container with a temporary container on the kind cluster
Because the kindnet container now uses Distroless instead of Debian and installing packages on this container is not possible.
2. Fix the CLUSTER_RATE_LIMIT output
Without fixing the command, the output would continue to be blank. Therefore making this output useless.
Checked with Denver about the following yesterday:
- It is alright if
CLUSTER_RATE_LIMITis blank. - The shell interpretation for bearer token is supposed to run on the host machine.
So the PR that has been submitted for this ticket only removes dependency on the kindnet container and also the step to install kind v0.14.
No AC required, this is for github actions and these are running without issues now with kind version specified.