cnti-testcatalog / testsuite

πŸ“žπŸ“±β˜ŽοΈπŸ“‘πŸŒ Cloud Native Telecom Initiative (CNTI) Test Catalog is a tool to check for and provide feedback on the use of K8s + cloud native best practices in networking applications and platforms
https://wiki.lfnetworking.org/display/LN/Test+Catalog
Apache License 2.0
169 stars 70 forks source link

[BUG] Operator Framework gives hash key "kind" error when running on latest Ubuntu client #1753

Open agentpoyo opened 1 year ago

agentpoyo commented 1 year ago

Describe the bug Operator Framework gives hash key "kind" error when running on latest Ubuntu client

To Reproduce Setup CNF-Testsuite on latest Ubuntu 22.04 (this might be occurring on other OSes as well)

Expected behavior This spec test to verify operator framework should not fail with crystal hash errors

Error

$ crystal spec --tag operator_test
current_branch during compile: "main"
current_tag during compile: "v0.41.0"
Note: switching to 'tags/v0.22.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at e08415d12 (e2e-fix) do not check for updated csv that is likely to be GC'd (#2837)
E.

Failures:

  1) Operator 'operator_test' test if operator is being used

       Missing hash key: "kind" (KeyError)
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/hash.cr:1077:11 in '[]'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/json/any.cr:103:7 in '[]'
         from lib/kubectl_client/kubectl_client.cr:590:32 in 'pods_by_resource'
         from spec/workload/operator_spec.cr:34:308 in '->'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/example.cr:45:13 in 'internal_run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/example.cr:33:16 in 'run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/context.cr:339:7 in 'run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/context.cr:18:23 in 'internal_run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/context.cr:156:7 in 'run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/spec/dsl.cr:220:7 in '->'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/crystal/at_exit_handlers.cr:14:19 in 'run'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/crystal/main.cr:50:14 in 'exit'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/crystal/main.cr:45:5 in 'main'
         from /home/pair/.crenv/versions/1.6.0/share/crystal/src/crystal/main.cr:127:3 in 'main'
         from /lib/x86_64-linux-gnu/libc.so.6 in '??'
         from /lib/x86_64-linux-gnu/libc.so.6 in '__libc_start_main'
         from /home/pair/.cache/crystal/crystal-run-spec.tmp in '_start'
         from ???

Finished in 16:53 minutes
2 examples, 0 failures, 1 errors, 0 pending

Failed examples:

crystal spec spec/workload/operator_spec.cr:13 # Operator 'operator_test' test if operator is being used

Device (please complete the following information):

agentpoyo commented 1 year ago

This is also happening running the new sig_term_handled test.

HashNuke commented 1 year ago

May need some help to reproduce this. The test runs as expected on Ubuntu 22.04.

CleanShot 2023-03-05 at 12 07 56@2x

I'll try running it a few times to see if this test fails randomly.

HashNuke commented 1 year ago

@agentpoyo Was able to reproduce the bug with the sig_term_handled test.

CleanShot 2023-03-05 at 14 32 34@2x
HashNuke commented 1 year ago

The issue for sig_term_handled test was the sample CNF that was being used. It was the CNF used in the specs for the test.

PodDisruptionBudget version was policy/v1beta earlier. Since K8s 1.25, this is now policy/v1. I updated the sample CNF and pushed a change for GitHub Actions to run. That will confirm my assumption if the specs work as expected.

HashNuke commented 1 year ago

Confirmed. The issue is actually about the k8s version. It won't be caught on GitHub Actions.

PodDisruptionBudget policy/v1beta was removed from k8s 1.25. So sample CNFs that use this have to be updated. I'll create a ticket for this.

This might be the reason why this issue isn't caught on GitHub Actions.

lixuna commented 5 months ago

@HashNuke is this issue still relevant?

HashNuke commented 5 months ago

@lixuna Yes. This issue is still relevant.

HashNuke commented 5 months ago

I just re-read the details and checked the attached commit on this ticket.

There's a branch bug/1753 with some unmerged changes but that requires other work updating kind on github actions. We can let any of the contributors help resolve this since one of them is already working on kind-related issues.

I was confused when I saw Denver's commit on this ticket and thought this was fixed. The commit is attributed to Denver, but that was actually me committing and pushing on the pair machine.

HashNuke commented 5 months ago

Here is a summary of what is happening

Here is why this is a problem

CleanShot 2024-02-22 at 17 00 52@2x

Here is what is required

The following changes have to be done in the one PR.

I've added a contributions-welcome tag to this ticket so that anyone interested can pick this up to lend a hand.