Skip to content

[PRODENG-3594] Migrate host connectivity layer to rig v2 (rebased, reference only) - #651

Draft
james-nesbitt wants to merge 1 commit into
mainfrom
PRODENG-3594
Draft

[PRODENG-3594] Migrate host connectivity layer to rig v2 (rebased, reference only)#651
james-nesbitt wants to merge 1 commit into
mainfrom
PRODENG-3594

Conversation

@james-nesbitt

@james-nesbitt james-nesbitt commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

What

Rebased copy of #645 (rig v0.x → rig v2 host connectivity migration) onto current main, with conflicts resolved and a pre-existing test-compile bug fixed.

Why

#645 is opened from a fork (kke/launchpad:rig-v2) and has drifted from main (mergeStateStatus: DIRTY, mergeable: CONFLICTING) after several PRODENG fixes landed (PR #640 FIPS MCR fix, PR #641 dependency upgrade, PR #628 swarm dissolution fallback). This PR is a rebased, buildable snapshot for review/reference — not intended to be merged. Kept separate to avoid disrupting #645's existing review thread; work continues there.

How

  • Rebased rig-v2 (commit ed5bd5b) onto main (4f64206)
  • Resolved 5 conflicting files: go.mod/go.sum (kept rig v2 deps + main's later version bumps), pkg/configurer/windows.go (adopted new Host type, dropped a reintroduced hardcoded MCR version that would have regressed PRODENG-3471), pkg/configurer/linux.go (adopted rig v2's h.Sudo() API shape, kept $SUDO_USER — verified rig v2's sudo.go wraps commands identically to the rig v0.21.11 pattern PR chore: upgrade Go modules and GitHub Actions #641 fixed, so $USER would still resolve to root), pkg/configurer/ubuntu/ubuntu.go (dropped an explicit noninteractive apt-get update, confirmed rig v2's packagemanager/apt.go already sets DEBIAN_FRONTEND=noninteractive on every apt-get call)
  • Fixed pkg/product/mke/phase/validate_facts_test.go: a second test helper (makePhaseWithPodCIDR, added later by PR [PRODENG-3342] Validate --pod-cidr does not overlap Swarm overlay address pool #636) still referenced removed rig v0 types (rig.Connection, rig.SSH), missed by the original migration's test conversion — updated to match the already-migrated sibling helper

Testing

  • go build ./... clean
  • go vet ./... clean
  • go test ./... — all packages pass

Links

Checklist

  • Tests added or updated
  • Docs updated if user-visible behaviour changed
  • No debug output or dead code left in

Written by AI: claude-sonnet-5

@james-nesbitt james-nesbitt added smoke-test Run all smoke tests smoke-modern Run modern smoke test smoke-upgrade Run smoke-upgrade CI job smoke-mhupgrade smoke-airgapped-multi-hop smoke-cutting-edge Trigger cutting-edge smoke test smoke-legacy Run legacy smoke test and removed smoke-cutting-edge Trigger cutting-edge smoke test labels Aug 3, 2026
@james-nesbitt

Copy link
Copy Markdown
Collaborator Author

Manual testing in progress

Running a new smoke test against real infra (AWS profile docker-testing-533267045383) to validate the rig v2 migration on paths not covered by the automated smoke-* labels currently on this PR:

TestUpgradeModernClusterFromLegacy (added to test/smoke/upgrade_test.go, not yet merged upstream): installs MCR stable-25.0 / MKE 3.8.8, then upgrades in place to MCR stable-29.2 / MKE 3.9.2, on the modern OS matrix (managers: rhel9/ubuntu24/rocky9; workers: rhel9/sles15/ubuntu24/rocky9).

Rationale: the existing TestUpgradeLegacyToModern covers this exact version transition but only on rhel8/rocky8/ubuntu22 — this exercises the same MCR/MKE upgrade path through the rhel9/ubuntu24/rocky9/sles15 configurer code that the rig v2 migration touches directly.

Will post the result (pass/fail + any findings) once it completes.

Written by AI: claude-sonnet-5

@james-nesbitt

Copy link
Copy Markdown
Collaborator Author

Manual test result: FAIL (infra/coverage gap, not a rig v2 regression)

Ran TestUpgradeModernClusterFromLegacy (install MCR stable-25.0/MKE 3.8.8 → upgrade to stable-29.2/3.9.2, modern OS matrix) against AWS profile docker-testing-533267045383.

Result: failed at base install — WrkSles15 (100.57.157.218) errored package manager could not install containerd.io while all 6 other hosts (rhel9 ×2, ubuntu24 ×2, rocky9 ×2) installed cleanly. Never reached the upgrade step. Teardown was clean (44/44 resources destroyed).

Investigated before reporting:

  • pkg/configurer/sles/sles.go's zypper install flow is functionally identical on main vs this branch — same command, just routed through rig v2's PackageManager() instead of rig v0's. Checked rig v2's actual zypper.go source to confirm no behavioral difference.
  • No existing CI test exercises SLES15 + stable-25.0TestModernCluster only pairs SLES15 with stable-29.2. This combination has never run before, on any branch.
  • Found a real (but pre-existing, unrelated to this PR) bug: sles.go's InstallPackage error handling discards the underlying zypper error (fmt.Errorf("package manager could not install containerd.io") has no %w), so the actual root cause (missing package for that channel/OS, repo issue, etc.) isn't recoverable from the log.

Take: likely an MCR channel/OS coverage gap (stable-25.0 may not publish SLES15 artifacts), not a migration regression — but can't be proven without fixing the error-swallowing bug first and re-running.

Written by AI: claude-sonnet-5

@james-nesbitt

Copy link
Copy Markdown
Collaborator Author

Root cause found: AMI drift + zypper vendor-change policy, NOT a rig v2 regression, NOT an MCR channel gap

Manually reproduced on a standalone SLES15 instance (bypassing Launchpad) to get past the error-swallowing bug fixed earlier in this thread.

Root cause:

  • sles_15 in the terraform-mirantis-provision-aws platform module is an unpinned wildcard (suse-sles-15-sp?-v20??????-hvm-ssd-x86_64) that resolves to whichever SP build is newest. It currently resolves to SLES 15 SP7 (ami-0ae9e33646fbb5238, built 2026-07-22).
  • This SP7 AMI ships SUSE's own containerd-1.7.29-150000.139.1 pre-installed (from SLE-Module-Basesystem15-SP7-Updates).
  • Mirantis's containerd.iocontainerd.io-runccontainerd.io-minimal chain needs to replace/obsolete that SUSE package (different vendor). zypper install -y <pkg> does not auto-accept a vendor-replacing solution non-interactively — it silently cancels (exit 4). Needs --allow-vendor-change.
  • Confirmed the fix directly: zypper --non-interactive install -y --allow-vendor-change containerd.io → exit 0, installs cleanly.

Confirmed channel-independent: reproduced the identical failure with stable-29.2 (the channel TestModernCluster uses today) on the same AMI, then confirmed --allow-vendor-change fixes it there too.

Confirmed NOT a rig v2 regression: main's zypper invocation in pkg/configurer/sles/sles.go is functionally identical to this branch's (same zypper install -y <pkg>, no vendor-change flag, in both rig v0 and rig v2 code paths).

Confirmed undocumented in MCR's own docs: both docs.mirantis.com/mcr/25.0/install/mcr-linux/suse.html and the current /mcr/29/install/mcr-linux/suse.html prescribe the exact command that fails (zypper install containerd.io && zypper install docker-ee), with no mention of pre-installed containerd or --allow-vendor-change. Older docs (≤23.0) warned about a related runc conflict on cloud images but that's since been dropped and doesn't cover containerd.

Impact: TestModernCluster's SLES15 leg is a live risk to CI on main right now, independent of this PR — it will fail the next time CI picks up this (or a future) AMI that ships pre-installed containerd, until sles.go passes --allow-vendor-change on MCR package installs, or the Terraform module pins sles_15 to a known-good SP.

All diagnostic AWS resources (2 standalone EC2 instances, security groups, keypairs) cleaned up and verified terminated/deleted — no orphaned spend.

Written by AI: claude-sonnet-5

Rebased onto main. Resolved the SLES InstallMCR conflict to retain the
--allow-vendor-change fix (PRODENG-3623 / #652) expressed in rig v2's API.
Build/test fixes required by the migration: go.mod/go.sum tidied for
github.com/k0sproject/rig/v2, validate_facts_test.go updated to rig v2
CompositeConfig/ssh.Config, and %w error wrapping in the EL/SLES/Ubuntu
configurers. Adds TestUpgradeModernClusterFromLegacy.

Signed-off-by: Kimmo Lehto <kimmo.lehto@gmail.com>

Written by AI: claude-sonnet-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

smoke-airgapped-multi-hop smoke-legacy Run legacy smoke test smoke-mhupgrade smoke-modern Run modern smoke test smoke-test Run all smoke tests smoke-upgrade Run smoke-upgrade CI job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants