Skip to content

fix: skeleton packages drop non-host-arch components - #5020

Open
JeffResc wants to merge 5 commits into
zarf-dev:mainfrom
JeffResc:fix/skeleton-arch
Open

fix: skeleton packages drop non-host-arch components#5020
JeffResc wants to merge 5 commits into
zarf-dev:mainfrom
JeffResc:fix/skeleton-arch

Conversation

@JeffResc

Copy link
Copy Markdown
Contributor

Description

Skeleton publishing resolved the package definition using the build host's architecture, so compose filtered out components gated to other arches via only.cluster.architecture before the package was marked arch-agnostic. The published zarf init skeleton therefore shipped only the amd64 zarf-injector/k3s, and importing it to build for arm64 failed with no compatible component named zarf-injector found.

This resolves the skeleton definition under SkeletonArch (match-all), so all architecture variants are retained, mirroring how Only.Flavor is already neutralized for skeletons. Consumers are unaffected: they import the (now complete) skeleton and their own load filters to the concrete target arch.

Related Issue

Fixes #5019

Checklist before merging

Signed-off-by: Jeff Rescignano <jeffr@defenseunicorns.com>
@JeffResc
JeffResc requested review from a team as code owners June 30, 2026 01:19
@netlify

netlify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 09a5480
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6a5a5dec5bd19f000781e936

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/packager/load/import.go 68.75% 3 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
src/internal/api/v1alpha1/validate.go 89.90% <100.00%> (+0.19%) ⬆️
src/pkg/packager/load/load.go 71.34% <100.00%> (+0.65%) ⬆️
src/pkg/packager/publish.go 63.29% <100.00%> (+0.19%) ⬆️
src/pkg/packager/load/import.go 55.40% <68.75%> (-0.32%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Jeff Rescignano <jeffr@defenseunicorns.com>
Comment thread src/pkg/packager/publish.go Outdated
@github-project-automation github-project-automation Bot moved this to In progress in Zarf Jun 30, 2026
Signed-off-by: Jeff Rescignano <jeffr@defenseunicorns.com>

@AustinAbro321 AustinAbro321 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for taking this on, requesting an abstraction

Comment thread src/test/e2e/10_component_flavor_test.go Outdated
Comment thread src/pkg/packager/load/load.go Outdated
// SkipVersionCheck skips version requirement validation
SkipVersionCheck bool
// Skeleton retains all architecture variants instead of filtering to the build host arch
Skeleton bool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd like to avoid tying load.PackageDefinition to skeletons.

I think something like below would be a better abstraction. It would also aid the work that @chaospuppy is doing in #4783.

type VariantDimension string

const (
    VariantArchitecture VariantDimension = "architecture"
    VariantFlavor       VariantDimension = "flavor"
)

// SkipVariantFilters lists dimensions to retain instead of filtering out.
SkipVariantFilters []VariantDimension

func AllVariantDimension() []VariantDimension

@JeffResc JeffResc Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just pushed a commit to address this, let me know any feedback you have

JeffResc and others added 2 commits July 17, 2026 12:13
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Signed-off-by: Jeff Rescignano <jeff@jeffresc.dev>
Signed-off-by: Jeff Rescignano <jeffr@defenseunicorns.com>

@AustinAbro321 AustinAbro321 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Few more separation of concern comments

}
}

func TestResolveImportsSkeletonRetainsAllArches(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This test shouldn't be focused on skeletons (publish_test.go is handling that). Make this test ensure that the variant dimensions work separately and together

}
pkg.Metadata.Architecture = config.GetArch(pkg.Metadata.Architecture)
if slices.Contains(opts.SkipVariantFilters, VariantArchitecture) {
pkg.Metadata.Architecture = v1alpha1.SkeletonArch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We still don't want the load package to know about skeletons, instead of setting the architecture, and checking for a skeleton architecture we should pass the variant dimensions into validate and import

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

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Skeleton packages drop only.cluster.architecture components for non-host arches, making multi-arch composed packages un-importable

3 participants