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

Only clean up containerd hosts dirs managed by k3s #10823

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

brandond
Copy link
Member

@brandond brandond commented Sep 4, 2024

Proposed Changes

Only clean up containerd hosts dirs managed by k3s

If the user creates their own hosts.toml, or drops CA or client certs in the directory by hand, we shouldn't delete them whenever K3s starts.

Types of Changes

enhancement

Verification

  1. Create your own host dir at /var/lib/rancher/k3s/agent/etc/containerd/certs.d/MYREGISTRY and add custom hosts.toml and/or certs. Restart K3s, and note that the custom content you created is left alone.
  2. Add an entry for MYREGISTRY in registries.yaml and restart k3s, note that the custom files are cleaned up and replaced with the K3s-managed hosts.toml
  3. Edit the file at /var/lib/rancher/k3s/agent/etc/containerd/certs.d/MYREGISTRY/hosts.toml to remove the DO NOT EDIT header and restart k3s; note that it is reverted to the managed content.
  4. Remove MYREGISTRY from registries.yaml and restart k3s. Note that /var/lib/rancher/k3s/agent/etc/containerd/certs.d/MYREGISTRY is removed.

Testing

Linked Issues

User-Facing Change

Further Comments

@brandond brandond requested a review from a team as a code owner September 4, 2024 22:15
dereknola
dereknola previously approved these changes Sep 4, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 12.00000% with 22 lines in your changes missing coverage. Please review.

Project coverage is 44.12%. Comparing base (28ceeec) to head (727d8a5).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
pkg/agent/containerd/config.go 12.00% 18 Missing and 4 partials ⚠️

❗ There is a different number of reports uploaded between BASE (28ceeec) and HEAD (727d8a5). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (28ceeec) HEAD (727d8a5)
e2etests 7 6
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10823      +/-   ##
==========================================
- Coverage   49.98%   44.12%   -5.87%     
==========================================
  Files         178      178              
  Lines       14753    14777      +24     
==========================================
- Hits         7375     6521     -854     
- Misses       6039     7060    +1021     
+ Partials     1339     1196     -143     
Flag Coverage Δ
e2etests 36.47% <12.00%> (-9.71%) ⬇️
inttests 36.77% <12.00%> (-0.01%) ⬇️
unittests 13.57% <0.00%> (-0.03%) ⬇️

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.

vitorsavian
vitorsavian previously approved these changes Sep 5, 2024
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
@brandond brandond merged commit 270f85e into k3s-io:master Sep 6, 2024
29 checks passed
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