-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into chore/refactor-mave…
…n-resolver
- Loading branch information
Showing
47 changed files
with
4,918 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package options | ||
|
||
import ( | ||
"github.com/anchore/fangs" | ||
"github.com/anchore/syft/syft/cataloging" | ||
) | ||
|
||
var ( | ||
_ fangs.FieldDescriber = (*complianceConfig)(nil) | ||
_ fangs.PostLoader = (*complianceConfig)(nil) | ||
) | ||
|
||
type complianceConfig struct { | ||
MissingName cataloging.ComplianceAction `mapstructure:"missing-name" json:"missing-name" yaml:"missing-name"` | ||
MissingVersion cataloging.ComplianceAction `mapstructure:"missing-version" json:"missing-version" yaml:"missing-version"` | ||
} | ||
|
||
func defaultComplianceConfig() complianceConfig { | ||
def := cataloging.DefaultComplianceConfig() | ||
return complianceConfig{ | ||
MissingName: def.MissingName, | ||
MissingVersion: def.MissingVersion, | ||
} | ||
} | ||
|
||
func (r *complianceConfig) DescribeFields(descriptions fangs.FieldDescriptionSet) { | ||
descriptions.Add(&r.MissingName, "action to take when a package is missing a name") | ||
descriptions.Add(&r.MissingVersion, "action to take when a package is missing a version") | ||
} | ||
|
||
func (r *complianceConfig) PostLoad() error { | ||
r.MissingName = r.MissingName.Parse() | ||
r.MissingVersion = r.MissingVersion.Parse() | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.