Documentation
¶
Overview ¶
Package cssc provides functionality for Container Software Supply Chain (CSSC) operations, including filter management and patch tag processing.
Index ¶
- func ApplyFilterAndGetFilteredList(ctx context.Context, acrClient api.AcrCLIClientInterface, filter Filter) ([]FilteredRepository, []FilteredRepository, error)
- func PrintFilteredResult(filteredResult []FilteredRepository, showPatchTags bool)
- func PrintNotFoundArtifacts(artifactsNotFound []FilteredRepository)
- type Filter
- type FilteredRepository
- type Repository
- type TagConvention
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFilterAndGetFilteredList ¶
func ApplyFilterAndGetFilteredList(ctx context.Context, acrClient api.AcrCLIClientInterface, filter Filter) ([]FilteredRepository, []FilteredRepository, error)
ApplyFilterAndGetFilteredList applies filter to filter out the repositories and tags from the ACR according to the specified criteria and returns the FilteredRepository struct.
func PrintFilteredResult ¶
func PrintFilteredResult(filteredResult []FilteredRepository, showPatchTags bool)
PrintFilteredResult prints the filtered result to the console.
func PrintNotFoundArtifacts ¶
func PrintNotFoundArtifacts(artifactsNotFound []FilteredRepository)
PrintNotFoundArtifacts prints the artifacts not found to the console.
Types ¶
type Filter ¶
type Filter struct {
Version string `json:"version"`
TagConvention TagConvention `json:"tag-convention"`
Repositories []Repository `json:"repositories"`
}
Filter struct to hold the filter policy
func GetFilterFromFilePath ¶
GetFilterFromFilePath reads the filter json from the specified file path and returns the Filter struct.
func GetFilterFromFilterPolicy ¶
func GetFilterFromFilterPolicy(ctx context.Context, filterPolicy string, loginURL string, username string, password string) (Filter, error)
GetFilterFromFilterPolicy reads the filter policy from the specified repository and tag and returns the Filter struct.
func (*Filter) ValidateFilter ¶
ValidateFilter validates the filter and returns an error if the filter is invalid.
type FilteredRepository ¶
FilteredRepository struct to hold the filtered repository, tag and patch tag if any
type Repository ¶
type Repository struct {
Repository string `json:"repository"`
Tags []string `json:"tags"`
Enabled *bool `json:"enabled"`
}
Repository struct to hold the repository, tags and enabled flag
type TagConvention ¶
type TagConvention string
TagConvention represents the tag naming convention used for patch tags.
const ( // Incremental represents the incremental tag convention using numeric suffixes (e.g., tag-1, tag-2). Incremental TagConvention = "incremental" // Floating represents the floating tag convention using -patched suffix. Floating TagConvention = "floating" )
func (TagConvention) IsValid ¶
func (tc TagConvention) IsValid() error
IsValid validates that the TagConvention is either incremental or floating.