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 support for using base template in etc/containerd/config.toml.tmpl #7991

Merged

Conversation

skirsten
Copy link
Contributor

@skirsten skirsten commented Jul 15, 2023

Proposed Changes

Right now you need copy-paste the default containerd config template from github into config.toml.tmpl only to add a few lines.

This PR allows to do 👇 instead which is much cleaner and removes the need to keep the base template up-to-date from ☝️ :

/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl
{{ template "base" . }}

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes."custom"]
  runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes."custom".options]
  BinaryName = "/usr/bin/custom-container-runtime"

Types of Changes

The PR adds the base template to the template list, so that it can be used.

Verification

  • Build
  • Use above config.toml.tmpl
  • cat config.toml

Testing

Linked Issues

User-Facing Change

User-provided containerd config templates may now use `{{ template "base" . }}` to include the default K3s template content. This makes it easier to maintain user configuration if the only need is to add additional sections to the file.

Further Comments

…ml.tmpl

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
@skirsten skirsten requested a review from a team as a code owner July 15, 2023 01:05
@brandond
Copy link
Contributor

Thanks! Would you mind opening an issue describing the problem you're trying to solve, so that our QA folks have something to work against for validation?

@cwayne18
Copy link
Collaborator

Thanks for the contribution!

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +4.48% 🎉

Comparison is base (be44243) 46.94% compared to head (f78a66b) 51.42%.
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7991      +/-   ##
==========================================
+ Coverage   46.94%   51.42%   +4.48%     
==========================================
  Files         143      143              
  Lines       14561    14562       +1     
==========================================
+ Hits         6836     7489     +653     
+ Misses       6629     5883     -746     
- Partials     1096     1190      +94     
Flag Coverage Δ
e2etests 49.26% <100.00%> (?)
inttests 44.40% <100.00%> (+0.07%) ⬆️
unittests 19.86% <0.00%> (-0.01%) ⬇️

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

Files Changed Coverage Δ
pkg/agent/templates/templates_linux.go 62.50% <100.00%> (+5.35%) ⬆️

... and 44 files with indirect coverage changes

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

@cwayne18 cwayne18 merged commit 546dc24 into k3s-io:master Jul 31, 2023
11 checks passed
eltociear pushed a commit to eltociear/k3s that referenced this pull request Aug 1, 2023
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Aug 3, 2023
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
brandond pushed a commit to brandond/k3s that referenced this pull request Aug 3, 2023
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Aug 3, 2023
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Aug 4, 2023
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit to brandond/k3s that referenced this pull request Aug 4, 2023
…ml.tmpl (k3s-io#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Aug 4, 2023
…ml.tmpl (#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Aug 4, 2023
…ml.tmpl (#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond pushed a commit that referenced this pull request Aug 4, 2023
…ml.tmpl (#7991)

Signed-off-by: Simon Kirsten <simonkirsten24@gmail.com>
(cherry picked from commit 546dc24)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
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.

None yet

5 participants