Skip to content

Commit

Permalink
Merge branch 'main' into test/merge-zarf-state
Browse files Browse the repository at this point in the history
  • Loading branch information
phillebaba authored May 20, 2024
2 parents 88fb25d + 1537260 commit 0481d43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ linters:
enable:
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- revive
Expand Down
18 changes: 4 additions & 14 deletions src/pkg/packager/filters/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,16 @@ type selectStateFilter struct {
// Apply applies the filter.
func (f *selectStateFilter) Apply(pkg types.ZarfPackage) ([]types.ZarfComponent, error) {
isPartial := len(f.requestedComponents) > 0 && f.requestedComponents[0] != ""

result := []types.ZarfComponent{}

for _, component := range pkg.Components {
selectState := unknown

selectState := included
if isPartial {
selectState, _ = includedOrExcluded(component.Name, f.requestedComponents)

if selectState == excluded {
continue
}
} else {
selectState = included
}

if selectState == included {
result = append(result, component)
if selectState != included {
continue
}
result = append(result, component)
}

return result, nil
}

0 comments on commit 0481d43

Please sign in to comment.