cssc

package
v0.0.0-...-381c873 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cssc provides functionality for Container Software Supply Chain (CSSC) operations, including filter management and patch tag processing.

Index

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

func GetFilterFromFilePath(filePath string) (Filter, error)

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

func (filter *Filter) ValidateFilter() error

ValidateFilter validates the filter and returns an error if the filter is invalid.

type FilteredRepository

type FilteredRepository struct {
	Repository string
	Tag        string
	PatchTag   string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL