k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
26.71k stars 2.24k forks source link

test: add agent with auth file #10119

Closed npitsillos closed 4 days ago

npitsillos commented 2 weeks ago

Proposed Changes

Adds a test to address changes in #10074

Types of Changes

Test

Verification

Testing

Adds another node to tailscale test that authenticates using a vpn-auth-file.

Linked Issues

10064

User-Facing Change

Fix bug when using `vpn-auth-file` in the agent

Further Comments

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 41.71%. Comparing base (aadec85) to head (59c6853).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #10119 +/- ## ========================================== - Coverage 48.01% 41.71% -6.30% ========================================== Files 173 173 Lines 14658 14658 ========================================== - Hits 7038 6115 -923 - Misses 6288 7375 +1087 + Partials 1332 1168 -164 ``` | [Flag](https://app.codecov.io/gh/k3s-io/k3s/pull/10119/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | Coverage Δ | | |---|---|---| | [e2etests](https://app.codecov.io/gh/k3s-io/k3s/pull/10119/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | `36.30% <ø> (-10.30%)` | :arrow_down: | | [inttests](https://app.codecov.io/gh/k3s-io/k3s/pull/10119/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | `37.04% <ø> (+0.07%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/k3s-io/k3s/pull/10119/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | `11.38% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

manuelbuil commented 1 week ago

Thanks for this contribution! Please also update to 2 the integer here https://github.com/k3s-io/k3s/blob/master/tests/e2e/tailscale/tailscale_test.go#L17

npitsillos commented 1 week ago

I can confirm that the file is correctly copied to the guest machine, however the tailscale key is not picked up from the env image

manuelbuil commented 1 week ago

I can confirm that the file is correctly copied to the guest machine, however the tailscale key is not picked up from the env image

did you run the test passing the tailscale key?

E2E_TAILSCALE_KEY=xxxxxx go test -v ./test/e2e/tailscale
npitsillos commented 1 week ago

no I just exported it as an environment variable

manuelbuil commented 1 week ago

Are you testing this? Is it working for you?

npitsillos commented 1 week ago

I just managed to run the tests I had issues with running vagrant without sudo. The tests fail but I should rebase my branch with the latest changes that have your code for it right?

manuelbuil commented 5 days ago

I just managed to run the tests I had issues with running vagrant without sudo. The tests fail but I should rebase my branch with the latest changes that have your code for it right?

What's the error you get?

manuelbuil commented 5 days ago

Could you please rebase? That will include my fix :)

npitsillos commented 5 days ago

Just rebased from master and pushed the changes

manuelbuil commented 4 days ago

I have just tested and works :). Thanks again @npitsillos

npitsillos commented 4 days ago

I'm glad I could contribute here! I am looking forward to contributing on things in the future as well!