testsuite icon indicating copy to clipboard operation
testsuite copied to clipboard

[BUG] Get chaos specs to run on kind v0.15

Open HashNuke opened this issue 3 years ago • 3 comments

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.

HashNuke avatar Sep 08 '22 13:09 HashNuke

This line in the GitHub Actions config for Chaos specs is not running as expected. Produces an empty result.

CleanShot 2022-09-12 at 14 28 31@2x

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.

HashNuke avatar Sep 12 '22 08:09 HashNuke

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.

HashNuke avatar Sep 12 '22 09:09 HashNuke

Checked with Denver about the following yesterday:

  • It is alright if CLUSTER_RATE_LIMIT is 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.

HashNuke avatar Sep 13 '22 12:09 HashNuke

No AC required, this is for github actions and these are running without issues now with kind version specified.

agentpoyo avatar Sep 27 '22 19:09 agentpoyo