Skip to content

Commit

Permalink
fix: hotfix skeleton publish (#2398)
Browse files Browse the repository at this point in the history
## Description

Hotfixes skeleton publish. However, this breakage has revealed that the
entire `skeleton` creation + publishing flow is flawed and requires an
overhaul. Currently, while `skeleton` says it has an `arch` of
`skeleton`, it is actually honoring the `--architecture` flag and
resulting in a `skeleton` package that is single architecture. It is
also not honoring `flavor`.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

---------

Signed-off-by: razzle <harry@razzle.cloud>
  • Loading branch information
Noxsios committed Mar 22, 2024
1 parent 63259f2 commit 0689007
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/pkg/packager/composer/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,6 @@ func (ic *ImportChain) MergeConstants(existing []types.ZarfPackageConstant) (mer

// CompatibleComponent determines if this component is compatible with the given create options
func CompatibleComponent(c types.ZarfComponent, arch, flavor string) bool {
if arch == zoci.SkeletonArch {
return true
}
satisfiesArch := c.Only.Cluster.Architecture == "" || c.Only.Cluster.Architecture == arch
satisfiesFlavor := c.Only.Flavor == "" || c.Only.Flavor == flavor
return satisfiesArch && satisfiesFlavor
Expand Down
4 changes: 3 additions & 1 deletion src/pkg/packager/creator/skeleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ func (sc *SkeletonCreator) LoadPackageDefinition(dst *layout.PackagePaths) (pkg
return types.ZarfPackage{}, nil, err
}

pkg.Metadata.Architecture = zoci.SkeletonArch
pkg.Metadata.Architecture = config.GetArch()

// Compose components into a single zarf.yaml file
pkg, composeWarnings, err := ComposeComponents(pkg, sc.createOpts.Flavor)
if err != nil {
return types.ZarfPackage{}, nil, err
}

pkg.Metadata.Architecture = zoci.SkeletonArch

warnings = append(warnings, composeWarnings...)

pkg.Components, err = sc.processExtensions(pkg.Components, dst)
Expand Down

0 comments on commit 0689007

Please sign in to comment.