Skip to content

Commit

Permalink
WIP: addressing todos
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed May 23, 2024
1 parent 58bd1a1 commit ac075db
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pkg/bundle/tarball.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (tp *tarballBundleProvider) LoadBundleMetadata() (types.PathMap, error) {
return loaded, nil
}

// todo: rename or refactor, there are 2 getZarfLayers functions in this codebase....
// getZarfLayers returns the layers of the Zarf package that are in the bundle
func (tp *tarballBundleProvider) getZarfLayers(store *ocistore.Store, pkgManifestDesc ocispec.Descriptor) ([]ocispec.Descriptor, int64, error) {
var layersToPull []ocispec.Descriptor
estimatedPkgSize := int64(0)
Expand Down
2 changes: 0 additions & 2 deletions src/pkg/bundler/fetcher/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ func (f *localFetcher) GetPkgMetadata() (zarfTypes.ZarfPackage, error) {
func (f *localFetcher) toBundle(pkgTmp string) ([]ocispec.Descriptor, error) {
ctx := context.TODO()

// todo: test the case of an optional component that only has an action (maybe also test for charts and manifests)

// load pkg and layout of pkg paths
pkgSrc := zarfSources.TarballSource{
ZarfPackageOptions: &zarfTypes.ZarfPackageOptions{
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 @@ -63,7 +63,7 @@ func (p *RemotePusher) Push() (ocispec.Descriptor, error) {
return zarfManifestDesc, nil
}

// PushManifest pushes the Zarf pkg's manifest to either a local or remote bundle
// PushManifest pushes the Zarf pkg's manifest to a remote bundle
func (p *RemotePusher) PushManifest() (ocispec.Descriptor, error) {
var zarfManifestDesc ocispec.Descriptor
desc, err := utils.ToOCIRemote(p.cfg.PkgRootManifest, zoci.ZarfLayerMediaTypeBlob, p.cfg.RemoteDst.OrasRemote)
Expand Down
4 changes: 2 additions & 2 deletions src/test/bundles/14-optional-components/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ packages:
ref: v0.33.0
optionalComponents:
- git-server

- name: podinfo-and-nginx
path: "../../packages/podinfo-and-nginx"
# repository: localhost:5000/podinfo-and-nginx
path: ../../packages/podinfo-and-nginx
ref: 0.0.1
optionalComponents:
- podinfo
2 changes: 2 additions & 0 deletions src/test/e2e/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ func TestBundleOptionalComponents(t *testing.T) {
createLocal(t, bundleDir, e2e.Arch)
deploy(t, bundlePath)
remove(t, bundlePath)

// todo: test that imgs from optional components aren't in the bundle?
}

func TestBundleTmpDir(t *testing.T) {
Expand Down
5 changes: 5 additions & 0 deletions src/test/packages/podinfo-and-nginx/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ components:
- name: nginx-remote
import:
path: ../nginx

- name: test
description: contains only single Zarf action
import:
path: ../no-cluster/real-simple

0 comments on commit ac075db

Please sign in to comment.