-
Notifications
You must be signed in to change notification settings - Fork 0
Emit transfer.v1.local unpack_config for containerd_snapshotter #5
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
base: far-main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| version = 3 | ||
|
|
||
| imports = ["/etc/containerd/conf.d/*.toml"] | ||
|
Check failure on line 3 in roles/container-engine/containerd/templates/config.toml.j2
|
||
|
|
||
| root = "{{ containerd_storage_dir }}" | ||
| state = "{{ containerd_state_dir }}" | ||
| oom_score = {{ containerd_oom_score }} | ||
|
|
@@ -88,6 +90,12 @@ | |
| [plugins."io.containerd.nri.v1.nri"] | ||
| disable = {{ 'false' if nri_enabled else 'true' }} | ||
|
|
||
| [plugins."io.containerd.transfer.v1.local"] | ||
| [[plugins."io.containerd.transfer.v1.local".unpack_config]] | ||
| differ = "" | ||
| platform = "linux/amd64" | ||
| snapshotter = "{{ containerd_snapshotter }}" | ||
|
Check failure on line 97 in roles/container-engine/containerd/templates/config.toml.j2
|
||
|
Comment on lines
+93
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 The new Extended reasoning...What the bug isThe new platform = "linux/amd64"This is the same template that is rendered on every containerd node regardless of CPU architecture. Why it's wrong in this codebaseKubespray is explicitly multi-arch. The defaults already provide arch-aware variables:
These are used pervasively throughout the project for arch-aware download URLs, checksums, and container image refs (kubelet, kubectl, etcd, cni, containerd itself, etc.). Hardcoding The failure mode this re-introducescontainerd 2.x's Step-by-step proof on an aarch64 worker
FixOne-line change: platform = "linux/{{ image_arch }}"(Or |
||
|
|
||
| {% if containerd_tracing_enabled %} | ||
| [plugins."io.containerd.tracing.processor.v1.otlp"] | ||
| endpoint = "{{ containerd_tracing_endpoint }}" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 The new
importsline hardcodes/etc/containerd/conf.d/*.tomlwhile the rest of the template and role uses the configurablecontainerd_cfg_dir(default/etc/containerd). If a user overridescontainerd_cfg_dir(e.g. to/opt/containerd),config.tomlwill be written under the override but containerd will still scan the hardcoded/etc/containerd/conf.d/, silently dropping their drop-ins. Fix:imports = ["{{ containerd_cfg_dir }}/conf.d/*.toml"].Extended reasoning...
What the bug is
The new line
hardcodes the path
/etc/containerd/conf.d/*.toml, but everywhere else in the role the configurable variablecontainerd_cfg_diris used to derive containerd-config paths.Why this is inconsistent with the rest of the role
roles/container-engine/containerd/defaults/main.yml:81declarescontainerd_cfg_dir: /etc/containerd(overridable).roles/container-engine/containerd/tasks/main.yml:{{ containerd_cfg_dir }}itself,config.tomlto{{ containerd_cfg_dir }}/config.toml,{{ containerd_cfg_dir }}/certs.d/hosts files.containerd_cfg_diris already used at:base_runtime_spec("{{ containerd_cfg_dir }}/{{ runtime.base_runtime_spec }}"),[plugins."io.containerd.cri.v1.images".registry] config_path = "{{ containerd_cfg_dir }}/certs.d".The new
importsline is the only place that bakes in/etc/containerdliterally.Concrete proof / step-by-step
containerd_cfg_dir: /opt/containerdin their inventory./opt/containerd/(tasks/main.yml:36).config.tomland Ansible writes it to/opt/containerd/config.toml(tasks/main.yml:68).imports = ["/etc/containerd/conf.d/*.toml"]— pointing at a directory the role never creates or manages under the override.99-nvidia.tomlinto/opt/containerd/conf.d/(mirroring where everything else lives)./etc/containerd/conf.d/. The PR description specifically motivatesimportsfor picking up post-bringup drop-ins, so this silently defeats the feature for the override case.Why existing code doesn’t prevent it
Nothing else in the role enforces the
/etc/containerdliteral — defaults match the hardcoded path, so for default deployments the bug is invisible. There is no validation thatcontainerd_cfg_direquals/etc/containerd, and no symlink or fallback creating/etc/containerd/conf.d/when an override is in use.Impact
Limited but real: any operator who overrides
containerd_cfg_dirgets a config that silently disagrees with itself. Drop-ins land in{{ containerd_cfg_dir }}/conf.d/(the natural location, and where the rest of the role keeps subdirectories likecerts.d) butimportslooks elsewhere. Failures are silent — containerd just doesn’t apply the drop-in.Fix
One-line change at
roles/container-engine/containerd/templates/config.toml.j2:3:imports = ["{{ containerd_cfg_dir }}/conf.d/*.toml"]This matches the convention already used at lines 58 and 88 of the same template and at all
containerd_cfg_dircallsites intasks/main.yml.