Skip to content

Commit

Permalink
it wasnt the destroyed load?
Browse files Browse the repository at this point in the history
This reverts commit c502bfa.
  • Loading branch information
schristoff committed Sep 24, 2024
1 parent c502bfa commit 0fbab7d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 16 additions & 2 deletions src/internal/packager2/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,20 @@ func packageFromSourceOrCluster(ctx context.Context, cluster *cluster.Cluster, s
}
return depPkg.Data, nil
}
//todo(schristoff): :/
return v1alpha1.ZarfPackage{}, nil

loadOpt := LoadOptions{
Source: src,
SkipSignatureValidation: skipSignatureValidation,
Filter: filters.Empty(),
}
pkgPaths, err := LoadPackage(ctx, loadOpt)
if err != nil {
return v1alpha1.ZarfPackage{}, err
}
defer os.RemoveAll(pkgPaths.Base)
pkg, _, err := pkgPaths.ReadZarfYAML()
if err != nil {
return v1alpha1.ZarfPackage{}, err
}
return pkg, nil
}
6 changes: 3 additions & 3 deletions src/internal/packager2/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestPackageFromSourceOrCluster(t *testing.T) {
}
_, err = c.RecordPackageDeployment(ctx, pkg, nil, 1)
require.NoError(t, err)
// pkg, err = packageFromSourceOrCluster(ctx, c, "test", false)
// require.NoError(t, err)
// require.Equal(t, "test", pkg.Metadata.Name)
pkg, err = packageFromSourceOrCluster(ctx, c, "test", false)
require.NoError(t, err)
require.Equal(t, "test", pkg.Metadata.Name)
}

0 comments on commit 0fbab7d

Please sign in to comment.