Skip to content

feat: support containerd 2.x addon#6029

Open
nvanthao wants to merge 2 commits into
mainfrom
gerard/sc-138417/containerd2-config
Open

feat: support containerd 2.x addon#6029
nvanthao wants to merge 2 commits into
mainfrom
gerard/sc-138417/containerd2-config

Conversation

@nvanthao

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Steps to reproduce

Does this PR introduce a user-facing change?


Does this PR require documentation?

@nvanthao nvanthao added the type::feature An enhancement to an existing add on or feature label Jun 12, 2026
@nvanthao nvanthao requested a review from a team as a code owner June 12, 2026 06:16
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown

Comments Outside Diff (1)

  1. scripts/common/containerd.sh, line 29-32 (link)

    P2 install_major is assigned without local, so it leaks into the global shell scope. All other captured semver values in this function (current_major, current_minor, install_minor) are properly declared. If another function ever reads $install_major after calling containerd_migration_steps, it will silently receive the wrong value.

Reviews (1): Last reviewed commit: "regenerate manifests for containerd 2.x" | Re-trigger Greptile

Comment on lines +219 to +224
function test_migration_steps_1_7_to_2x() {
CONTAINERD_STEP_VERSIONS=(1.2.13 1.3.9 1.4.13 1.5.11 1.6.33 1.7.29 2.0.5)
local steps
steps="$(containerd_migration_steps "1.7.29" "2.0.5")"
assertEquals "migration steps 1.7->2.0" "2.0.5" "$steps"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing coverage for production step-version set

test_migration_steps_1_7_to_2x uses STEP_VERSIONS that includes 2.0.5, but the actual scripts/Manifest has no 2.0.x entry — only 2.1.5 and 2.2.4. When a 1.7 → 2.1 or 1.7 → 2.2 migration is evaluated with the real step set, the while loop in containerd_migration_steps fires with current_minor=8 > install_minor, so the loop is skipped and only $to_version is returned — which is the correct result. However there are no tests asserting this exact path. Adding a test case for "1.7.29" → "2.1.5" and "1.7.29" → "2.2.4" with the production STEP_VERSIONS would guard against future regressions.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +293 to +298
if [ "${config_schema_version:-2}" -ge "3" ]; then
# Validate the effective merged config: the dump must parse cleanly AND contain the
# drop-in's settings, proving the conf.d import survived any CONTAINERD_TOML_CONFIG patch.
if ! containerd --config /etc/containerd/config.toml config dump | grep -q 'SystemdCgroup = true'; then
bail "containerd drop-in /etc/containerd/conf.d/99-replicated.toml was not applied to the merged config"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Merged-config validation only checks SystemdCgroup

The post-configure validation checks that SystemdCgroup = true survived the drop-in merge, which proves the imports patch and drop-in write succeeded. However it doesn't validate the pause/sandbox image or config_path settings. If the user's CONTAINERD_TOML_CONFIG patch removes the [plugins.'io.containerd.cri.v1.images'.pinned_images] section (or the certs.d path), the installation would silently proceed with the wrong sandbox image or broken registry config. Expanding the grep to also check for config_path (which is always written) would catch a broader class of broken patches with no additional overhead.

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type::feature An enhancement to an existing add on or feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant