Skip to content

Commit

Permalink
updates Zarf to 0.32.6
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Mar 25, 2024
1 parent bb7dc6b commit 1a262ee
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/defenseunicorns/uds-cli

go 1.21.6

replace github.com/defenseunicorns/zarf v0.32.5 => github.com/defenseunicorns/zarf v0.32.6-0.20240321202634-329a1ae1f69c

replace github.com/defenseunicorns/maru-runner v0.0.2 => github.com/defenseunicorns/maru-runner v0.0.3-0.20240322171619-a7974e34d1d0

require (
Expand All @@ -13,7 +11,7 @@ require (
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/defenseunicorns/maru-runner v0.0.2
github.com/defenseunicorns/zarf v0.32.5
github.com/defenseunicorns/zarf v0.32.6
github.com/fatih/color v1.16.0
github.com/fsnotify/fsnotify v1.7.0
github.com/goccy/go-yaml v1.11.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ github.com/daviddengcn/go-colortext v1.0.0 h1:ANqDyC0ys6qCSvuEK7l3g5RaehL/Xck9EX
github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c=
github.com/defenseunicorns/maru-runner v0.0.3-0.20240322171619-a7974e34d1d0 h1:HgtK7fLR1+3PeEgZlykkN40hfngrAZrY2Oc1gv3Enas=
github.com/defenseunicorns/maru-runner v0.0.3-0.20240322171619-a7974e34d1d0/go.mod h1:hyQyYIFMb1b284uVEIbhc9qySyVCDbYcjteniHuNKE0=
github.com/defenseunicorns/zarf v0.32.6-0.20240321202634-329a1ae1f69c h1:EtW8FLWEJ8ducXN7Y1Z7kAmLGuVeicMOSLknYcvV/Q8=
github.com/defenseunicorns/zarf v0.32.6-0.20240321202634-329a1ae1f69c/go.mod h1:EISjg8T4jZUgc1QAMkX/RNQ0PS4WegKcJDZwztvQ2Bw=
github.com/defenseunicorns/zarf v0.32.6 h1:zWfKmAo898P7OHosKQaiV4E6YjDrqpsryz0BqrQqgg4=
github.com/defenseunicorns/zarf v0.32.6/go.mod h1:EISjg8T4jZUgc1QAMkX/RNQ0PS4WegKcJDZwztvQ2Bw=
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da h1:ZOjWpVsFZ06eIhnh4mkaceTiVoktdU67+M7KDHJ268M=
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da/go.mod h1:B3tI9iGHi4imdLi4Asdha1Sc6feLMTfPLXh9IUYmysk=
github.com/depcheck-test/depcheck-test v0.0.0-20220607135614-199033aaa936 h1:foGzavPWwtoyBvjWyKJYDYsyzy+23iBV7NKTwdk+LRY=
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/bundler/fetcher/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (f *remoteFetcher) Fetch() ([]ocispec.Descriptor, error) {
func (f *remoteFetcher) layersToLocalBundle(spinner *message.Spinner, currentPackageIter int, totalPackages int) ([]ocispec.Descriptor, error) {
spinner.Updatef("Fetching %s package layer metadata (package %d of %d)", f.pkg.Name, currentPackageIter, totalPackages)
// get only the layers that are required by the components
layersToCopy, err := utils.GetZarfLayers(*f.remote, f.pkg, f.pkgRootManifest)
layersToCopy, err := utils.GetZarfLayers(*f.remote, f.pkgRootManifest)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/bundler/pusher/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (p *RemotePusher) PushManifest() (ocispec.Descriptor, error) {
func (p *RemotePusher) LayersToRemoteBundle(spinner *message.Spinner, currentPackageIter int, totalPackages int) ([]ocispec.Descriptor, error) {
spinner.Updatef("Fetching %s package layer metadata (package %d of %d)", p.pkg.Name, currentPackageIter, totalPackages)
// get only the layers that are required by the components
layersToCopy, err := utils.GetZarfLayers(p.cfg.RemoteSrc, p.pkg, p.cfg.PkgRootManifest)
layersToCopy, err := utils.GetZarfLayers(p.cfg.RemoteSrc, p.cfg.PkgRootManifest)
if err != nil {
return nil, err
}
Expand Down
3 changes: 0 additions & 3 deletions src/pkg/sources/tarball.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ func (t *TarballBundle) extractPkgFromBundle() ([]string, error) {
return err
}

// todo: everything is broken! seems like this fn isn't pulling all the layers
// try rebuilding the packages with the latest Zarf + rebuilding bundle
// try with old version of UDS CLI
target, err := os.Create(layerDst)
if err != nil {
return err
Expand Down
18 changes: 13 additions & 5 deletions src/pkg/utils/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,21 @@ func EnsureOCIPrefix(source string) string {
}

// GetZarfLayers grabs the necessary Zarf pkg layers from a remote OCI registry
func GetZarfLayers(remote zoci.Remote, pkg types.Package, pkgRootManifest *oci.Manifest) ([]ocispec.Descriptor, error) {
func GetZarfLayers(remote zoci.Remote, pkgRootManifest *oci.Manifest) ([]ocispec.Descriptor, error) {
// todo: ensure we are only pulling non-optional components
ctx := context.TODO()
var optComponents []zarfTypes.ZarfComponent
for _, c := range pkg.OptionalComponents {
optComponents = append(optComponents, zarfTypes.ZarfComponent{Name: c})
var components []zarfTypes.ZarfComponent
for _, layer := range pkgRootManifest.Layers {
// infer component name from layer title annotation
titleAnnotation := layer.Annotations[ocispec.AnnotationTitle]
isComponent := strings.HasPrefix(titleAnnotation, "components/") && strings.HasSuffix(titleAnnotation, ".tar")
if isComponent {
afterComponents := strings.Split(titleAnnotation, "components/")[1]
componentName := strings.Split(afterComponents, ".tar")[0]
components = append(components, zarfTypes.ZarfComponent{Name: componentName})
}
}
layersFromComponents, err := remote.LayersFromRequestedComponents(ctx, optComponents)
layersFromComponents, err := remote.LayersFromRequestedComponents(ctx, components)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func IsValidTarballPath(path string) bool {

// ConfigureLogs sets up the log file, log cache and output for the CLI
func ConfigureLogs(op string) error {
// don't configure UDS logs for vendored Zarf cmds
if op == "zarf COMMAND" {
// don't configure UDS logs for vendored cmds
if strings.HasPrefix(op, "zarf") || strings.HasPrefix(op, "run") {
return nil
}
writer, err := message.UseLogFile("")
Expand Down
4 changes: 2 additions & 2 deletions src/test/bundles/04-init/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ packages:
- name: init
path: "../../packages"
# renovate: datasource=github-tags depName=defenseunicorns/zarf
ref: v0.32.5
ref: v0.32.6
optionalComponents:
- git-server
- name: init
repository: ghcr.io/defenseunicorns/packages/init
# renovate: datasource=github-tags depName=defenseunicorns/zarf
ref: v0.32.5
ref: v0.32.6
optionalComponents:
- git-server

0 comments on commit 1a262ee

Please sign in to comment.