Documentation ¶
Overview ¶
Package artifacts implements support to pushing and pulling artifacts to an OCI registry
Index ¶
- Constants
- Variables
- func FetchChartMetadata(ctx context.Context, url string, destination string, opts ...Option) error
- func Insecure(c *RegistryClientConfig)
- func ListTags(ctx context.Context, src string, opts ...crane.Option) ([]string, error)
- func PullChart(chartURL, version string, destDir string, opts ...RegistryClientOption) (string, error)
- func PullImageMetadata(ctx context.Context, image *imagelock.ChartImage, destDir string, ...) error
- func PullImageSignatures(ctx context.Context, image *imagelock.ChartImage, destDir string, ...) error
- func PushChart(tarFile string, pushChartURL string, opts ...RegistryClientOption) error
- func PushChartMetadata(ctx context.Context, url string, chartDir string, opts ...Option) error
- func PushImageMetadata(ctx context.Context, image *imagelock.ChartImage, destDir string, ...) error
- func PushImageSignatures(ctx context.Context, image *imagelock.ChartImage, destDir string, ...) error
- func RemoteChartExist(chartURL string, version string, opts ...RegistryClientOption) bool
- func TagExist(ctx context.Context, src string, tag string, o crane.Options) (bool, error)
- func WithAuth(username, password string) func(cfg *Config)
- func WithInsecure(insecure bool) func(c *RegistryClientConfig)
- func WithInsecureMode(insecure bool) func(cfg *Config)
- func WithPlainHTTP(usePlain bool) func(c *RegistryClientConfig)
- func WithRegistryAuth(username, password string) func(c *RegistryClientConfig)
- func WithResolveReference(v bool) func(cfg *Config)
- func WithTempDir(dir string) func(c *RegistryClientConfig)
- type Auth
- type Config
- type Option
- type RegistryClientConfig
- type RegistryClientOption
Constants ¶
const ( // HelmArtifactsFolder defines the path of the chart artifacts, relative to the bundle root HelmArtifactsFolder = "artifacts" // HelmChartArtifactMetadataDir defines the relative path to the chart metadata inside the chart root HelmChartArtifactMetadataDir = HelmArtifactsFolder + "/chart/metadata" )
Variables ¶
var ( // ErrTagDoesNotExist defines an error locating a remote tag because it does not exist ErrTagDoesNotExist = errors.New("tag does not exist") // ErrLocalArtifactNotExist defines an error locating a local artifact because it does not exist ErrLocalArtifactNotExist = errors.New("local artifact does not exist") )
Functions ¶
func FetchChartMetadata ¶
FetchChartMetadata retrieves the chart metadata artifact from the registry
func Insecure ¶
func Insecure(c *RegistryClientConfig)
Insecure asks the tool to allow insecure HTTPS connections to the remote server.
func PullChart ¶
func PullChart(chartURL, version string, destDir string, opts ...RegistryClientOption) (string, error)
PullChart retrieves the specified chart
func PullImageMetadata ¶
func PullImageMetadata(ctx context.Context, image *imagelock.ChartImage, destDir string, opts ...Option) error
PullImageMetadata pulls the image metadata and stores it locally as an oci-layout
func PullImageSignatures ¶
func PullImageSignatures(ctx context.Context, image *imagelock.ChartImage, destDir string, opts ...Option) error
PullImageSignatures pulls the image signature and stores it locally as an oci-layout
func PushChart ¶
func PushChart(tarFile string, pushChartURL string, opts ...RegistryClientOption) error
PushChart pushes the local chart tarFile to the remote URL provided
func PushChartMetadata ¶
PushChartMetadata pushes the chart metadata artifact to the registry
func PushImageMetadata ¶
func PushImageMetadata(ctx context.Context, image *imagelock.ChartImage, destDir string, opts ...Option) error
PushImageMetadata pushes a oci-layout directory to the registry as the image metadata
func PushImageSignatures ¶
func PushImageSignatures(ctx context.Context, image *imagelock.ChartImage, destDir string, opts ...Option) error
PushImageSignatures pushes a oci-layout directory to the registry as the image signature
func RemoteChartExist ¶
func RemoteChartExist(chartURL string, version string, opts ...RegistryClientOption) bool
RemoteChartExist checks if the provided chart exists
func WithInsecure ¶
func WithInsecure(insecure bool) func(c *RegistryClientConfig)
WithInsecure configures the InsecureMode of the Config
func WithInsecureMode ¶ added in v0.3.1
WithInsecureMode configures Insecure transport
func WithPlainHTTP ¶
func WithPlainHTTP(usePlain bool) func(c *RegistryClientConfig)
WithPlainHTTP configures the InsecureMode of the Config
func WithRegistryAuth ¶ added in v0.4.0
func WithRegistryAuth(username, password string) func(c *RegistryClientConfig)
WithRegistryAuth configures the Auth of the RegistryClientConfig
func WithResolveReference ¶
WithResolveReference configures the ResolveReference setting
func WithTempDir ¶ added in v0.4.0
func WithTempDir(dir string) func(c *RegistryClientConfig)
WithTempDir configures the directory in which to place the temporary credentials file
Types ¶
type Auth ¶ added in v0.4.0
Auth defines the authentication information to access the container registry
type RegistryClientConfig ¶
type RegistryClientConfig struct { UsePlainHTTP bool UseInsecureHTTPS bool Auth Auth TempDir string }
RegistryClientConfig defines how the client communicates with the remote server
func NewRegistryClientConfig ¶
func NewRegistryClientConfig(opts ...RegistryClientOption) *RegistryClientConfig
NewRegistryClientConfig returns a new RegistryClientConfig with default values
type RegistryClientOption ¶
type RegistryClientOption func(*RegistryClientConfig)
RegistryClientOption defines a RegistryClientConfig setting