Skip to content

Commit

Permalink
POC BB Extension
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Aug 27, 2024
1 parent f6e06da commit 148e95c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/api/v1beta1/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ func (pkg ZarfPackage) HasImages() bool {
return false
}

func (pkg ZarfPackage) IsAirGap() bool {
if pkg.Metadata.Airgap == nil {
return true
}
return *pkg.Metadata.Airgap
}

// IsSBOMAble checks if a package has contents that an SBOM can be created on (i.e. images, files, or data injections).
func (pkg ZarfPackage) IsSBOMAble() bool {
for _, c := range pkg.Components {
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/packager/creator/normal.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func (pc *PackageCreator) Output(ctx context.Context, dst *layout.PackagePaths,
return nil
}

func (pc *PackageCreator) processExtensions(ctx context.Context, pkg v1beta1.ZarfPackage, layout *layout.PackagePaths) (processedComponents []v1beta1.ZarfComponent, err error) {
func (pc *PackageCreator) processExtensions(ctx context.Context, pkg types.ZarfPackage, layout *layout.PackagePaths) (processedComponents []types.ZarfComponent, err error) {
// Create component paths and process extensions for each component.
for _, c := range pkg.Components {
componentPaths, err := layout.Components.Create(c)
Expand Down
7 changes: 7 additions & 0 deletions src/types/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ func (pkg ZarfPackage) HasImages() bool {
return false
}

func (pkg ZarfPackage) IsAirGap() bool {
if pkg.Metadata.Airgap == nil {
return true
}
return *pkg.Metadata.Airgap
}

// IsSBOMAble checks if a package has contents that an SBOM can be created on (i.e. images, files, or data injections).
func (pkg ZarfPackage) IsSBOMAble() bool {
for _, c := range pkg.Components {
Expand Down

0 comments on commit 148e95c

Please sign in to comment.