Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add int test for flannel-ipv6masq #10440

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

manuelbuil
Copy link
Contributor

Proposed Changes

Add a new integration test to verify k3s works as expected when deploying with --flannel-ipv6-masq.

Adds also a log when running the integration test. Otherwise it seems like we are stuck at waiting to get test lock when running the test manually

Types of Changes

New test

Verification

Testing

Linked Issues

#10419

User-Facing Change


Further Comments

@manuelbuil manuelbuil requested a review from a team as a code owner July 1, 2024 13:39
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.02%. Comparing base (f10cb29) to head (e5079ce).
Report is 90 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10440      +/-   ##
==========================================
- Coverage   41.78%   39.02%   -2.76%     
==========================================
  Files         177      177              
  Lines       14806    14830      +24     
==========================================
- Hits         6186     5788     -398     
- Misses       7443     7897     +454     
+ Partials     1177     1145      -32     
Flag Coverage Δ
e2etests ?
inttests 37.03% <ø> (+0.02%) ⬆️
unittests 11.34% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dereknola
dereknola previously approved these changes Jul 1, 2024
Comment on lines 48 to 50
podname, err := testutil.K3sCmd("kubectl", "get", "pods", "-n", "kube-system", "-o", "jsonpath={.items[?(@.metadata.labels.app\\.kubernetes\\.io/name==\"traefik\")].metadata.name}")
Expect(err).NotTo(HaveOccurred())
Eventually(func() (string, error) {
return testutil.K3sCmd("kubectl", "exec", podname, "-n", "kube-system", "--", "ip", "a")
}, "5s", "1s").Should(ContainSubstring("2001:cafe:42:"))
Copy link
Member

@brandond brandond Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Do you really need to exec into the pod to do this? The IPs are exposed via pod.status.podIPs:
    kubectl get pod -n kube-system -l app.kubernetes.io/name=traefik -o "jsonpath={.items[].status.podIPs[].ip}"
    You should also use a label selector instead of filtering by name in the jsonpath expression...
  2. If you really want to exec into the pod to get this info, you can do so in one line (without listing the pods first) by running:
    kubectl exec -n kube-system deployment/traefik -c traefik -- ip a

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point about the one liner, I'll change the dualStack int test as well. I would like to get into the pod network namespace and verify that the podIP is really assigned to the interface. 99% of the time {.items[].status.podIPs[].ip} will be the same but I remember once there was a bug and the interface was not assigned the IP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you review again please? Thanks!

Copy link
Member

@dereknola dereknola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manuelbuil
Copy link
Contributor Author

Can you add this test to the CI matrix https://github.com/k3s-io/k3s/blob/master/.github/workflows/integration.yaml#L41

The problem is that it requires dualStack to be available... :(

@manuelbuil manuelbuil requested a review from brandond July 2, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants