k3s-io / k3s

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

Make `/db/info` available anonymously from localhost #10001

Closed brandond closed 3 weeks ago

brandond commented 3 weeks ago

Proposed Changes

The Rancher CAPR planner apparently queries this anonymously to get the IP address of the first etcd node (to be used as the init node), instead of just using the address of the first node with the etcd label.

K3s itself uses auth when retrieving this resource, but since Rancher does not we need to make it available anonymously again - at least from localhost.

Types of Changes

integration/ bugfix

Verification

Testing

Linked Issues

Further Comments

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 43.32%. Comparing base (d3b6054) to head (c5a55c5).

Files Patch % Lines
pkg/server/auth/auth.go 22.22% 6 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #10001 +/- ## ========================================== - Coverage 50.06% 43.32% -6.74% ========================================== Files 158 158 Lines 14021 14032 +11 ========================================== - Hits 7019 6080 -939 - Misses 5672 6785 +1113 + Partials 1330 1167 -163 ``` | [Flag](https://app.codecov.io/gh/k3s-io/k3s/pull/10001/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/10001/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | `36.34% <22.72%> (-10.23%)` | :arrow_down: | | [inttests](https://app.codecov.io/gh/k3s-io/k3s/pull/10001/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | `19.78% <68.18%> (-17.32%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/k3s-io/k3s/pull/10001/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=k3s-io) | `16.58% <61.11%> (+0.02%)` | :arrow_up: | 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.

brandond commented 3 weeks ago

virtualbox image for btrfs test appears to be broken; merging