Documentation
¶
Overview ¶
Package distro is used for creating/deploying distro package
Index ¶
- func Build(ctx context.Context, distroPath string, opts CreateOptions) (*layout.DistroLayout, error)
- func Create(ctx context.Context, distroPath string, output string, opts CreateOptions) (_ string, err error)
- func Import(ctx context.Context, source string, opts ImportOptions) (string, error)
- func ImportLayout(ctx context.Context, source string, opts ImportOptions) (*layout.DistroLayout, error)
- func Load(ctx context.Context, source string, opts LoadOptions) (*layout.DistroLayout, error)
- func Mirror(ctx context.Context, l *layout.DistroLayout, target string, opts MirrorOptions) error
- func Publish(ctx context.Context, disLayout *layout.DistroLayout, dst registry.Reference, ...) (registry.Reference, error)
- func Pull(ctx context.Context, source, destination string, opts PullOptions) (string, error)
- type CreateOptions
- type ImportOptions
- type LoadOptions
- type MirrorOptions
- type PublishOptions
- type PullOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶ added in v0.39.0
func Build(ctx context.Context, distroPath string, opts CreateOptions) (*layout.DistroLayout, error)
Build assembles a distro package and returns its layout without archiving it.
It is the half of Create that produces the package; Create is Build plus the archive step. Splitting them is what lets a caller about to consume the package in this same process -- `cargoship dev apply` -- skip compressing a multi-gigabyte layout and decompressing the same bytes straight back again.
The caller owns the returned layout and must Cleanup it. That is the one thing to get right when reaching for this rather than Create, which cleans up the layout itself because the archive is the only thing meant to outlive it.
func Create ¶
func Create(ctx context.Context, distroPath string, output string, opts CreateOptions) (_ string, err error)
Create builds a distro package, writes it to output as an archive, and returns the path to that archive.
func Import ¶ added in v0.35.0
Import converts an OCI Image Layout archive or directory, such as one written by `skopeo copy ... oci-archive:`, into a native Cargoship package.
func ImportLayout ¶ added in v0.35.0
func ImportLayout(ctx context.Context, source string, opts ImportOptions) (*layout.DistroLayout, error)
ImportLayout reads an OCI Image Layout archive or directory and unpacks it into a DistroLayout.
func Load ¶
func Load(ctx context.Context, source string, opts LoadOptions) (*layout.DistroLayout, error)
Load fetches, verifies, and loads a Zarf package from the specified source.
func Mirror ¶ added in v0.39.0
func Mirror(ctx context.Context, l *layout.DistroLayout, target string, opts MirrorOptions) error
Mirror publishes the contents of a built package into target, a registry host optionally followed by a repository prefix.
This is not `publish`. Publish pushes the package as one OCI artifact, to be pulled back as a package; Mirror pushes what the package carries as individually pullable images and files, so that the registry a fleet is already pointed at holds the content its nodes will ask for.
The reference each item lands under is computed, never chosen, and the same two rules are applied by anything reading a mirror back. See images.Push and contentstore.FileRef.
Types ¶
type CreateOptions ¶
type CreateOptions struct {
OCIConcurrency int
CachePath string
IsInteractive bool
// Architecture narrows a package that targets several architectures down to a single one.
// A package that targets one architecture ignores it.
Architecture string
// Reproducible pins Build.Timestamp to config.Timestamp instead of the
// current time, and is recorded on Build.Reproducible, so identical package
// inputs produce byte-identical output.
Reproducible bool
RegistryOverrides []images.RegistryOverride
// FileOverrides redirect the file downloads a distro definition declares to an internal
// mirror or to a directory of pre-staged assets.
FileOverrides []fileoverride.Override
// ContentStore is the path to a local content bundle that images and files are resolved
// from before the network: a hauler store directory or archive, or a built zarf package.
// The format is read from the bundle, not from the path. Empty means no store.
ContentStore []string
// SigningKeyPath and SigningKeyPassword sign the package as part of creation
// when set. Empty values are a no-op -- see DistroLayout.SignPackage.
SigningKeyPath string
SigningKeyPassword string
// Tag overrides the package metadata version.
Tag string
types.RemoteOptions
}
CreateOptions are the optional parameters to create
type ImportOptions ¶ added in v0.35.0
type ImportOptions struct {
Architecture string
Output string
VerifyBlobOptions *signing.VerifyBlobOptions
VerificationStrategy layout.VerificationStrategy
}
ImportOptions declares optional parameters for an Import operation.
type LoadOptions ¶
type LoadOptions struct {
Shasum string
Architecture string
Output string
// number of layers to pull in parallel
OCIConcurrency int
// CachePath is used to cache layers from OCI package pulls
CachePath string
VerifyBlobOptions *signing.VerifyBlobOptions
// Only applicable to OCI + HTTP
types.RemoteOptions
// CABundle is one or more PEM-encoded certificates to trust in addition to the system roots,
// for a registry or an HTTP source serving a certificate the management node does not trust.
//
// Bytes rather than a path, so a caller holding the certificate in memory -- a controller
// reading it out of a Kubernetes secret, say -- does not have to write it to a file first.
// Only applicable to OCI + HTTP.
CABundle []byte
// VerificationStrategy for explicit definition
layout.VerificationStrategy
}
LoadOptions are the options for LoadDistro.
type MirrorOptions ¶ added in v0.39.0
type MirrorOptions struct {
types.RemoteOptions
OCIConcurrency int
Retries int
// Images and Files select what is mirrored. Both false means both, which is what a command
// line that named neither asked for.
Images bool
Files bool
}
MirrorOptions are the optional parameters to Mirror.
type PublishOptions ¶
type PublishOptions struct {
// OCIConcurrency configures the amount of layers to push in parallel
OCIConcurrency int
// Retries specifies the number of retries to use
Retries int
// SignBlobOptions holds all signing configuration. Use signing.DefaultSignBlobOptions() as a base.
SignBlobOptions signing.SignBlobOptions
CachePath string
IsInteractive bool
Registry *registry.Reference
types.RemoteOptions
// Tag is an optional tag for the OCI reference separate from the package metadata.version
Tag string
}
PublishOptions are the optional parameters to publish
type PullOptions ¶
type PullOptions struct {
// SHASum uniquely identifies a package based on its contents.
SHASum string
// Architecture is the package architecture.
Architecture string
// Deprecated: Use VerifyBlobOptions instead. PublicKeyPath validates the create-time signage of a package.
PublicKeyPath string
// VerifyBlobOptions configures package signature verification.
VerifyBlobOptions *signing.VerifyBlobOptions
// OCIConcurrency is the number of layers pulled in parallel
OCIConcurrency int
// CachePath is used to cache layers from OCI package pulls
CachePath string
types.RemoteOptions
// CABundle is trusted in addition to the system roots. See LoadOptions.CABundle.
CABundle []byte
// VerificationStrategy for explicit definition
layout.VerificationStrategy
}
PullOptions declares optional configuration for a Pull operation.