artifact

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrManifestNotFound                  = errors.New("bundle definition manifest not found in index")
	ErrHCLLayerNotFound                  = errors.New("bundle HCL layer not found in config manifest")
	ErrBundleDefinitionLayerNotFound     = errors.New("bundle artifact contains no bundle definition layer")
	ErrBundleNil                         = errors.New("bundle must not be nil")
	ErrBundleDirRequired                 = errors.New("bundle directory is required")
	ErrPackageNil                        = errors.New("package must not be nil")
	ErrConfigNil                         = errors.New("config must not be nil")
	ErrConfigOptionsNil                  = errors.New("config.Options must not be nil")
	ErrMultipleBundleDefinitionManifests = errors.New("bundle index contains multiple bundle definition manifests")
	ErrExtractingBundleArtifact          = errors.New("extracting bundle artifact")
	ErrResolvingLayerTitle               = errors.New("resolving layer title")
	ErrCheckingLayerTitle                = errors.New("checking layer title")
	ErrReadingConfigManifest             = errors.New("reading config manifest blob")
	ErrParsingConfigManifest             = errors.New("parsing config manifest")
	ErrReadingHCLBlob                    = errors.New("reading HCL blob")
	ErrParsingHCLBlob                    = errors.New("parsing HCL blob")
	ErrReadingBundleIndex                = errors.New("reading index.json")
	ErrParsingBundleIndex                = errors.New("parsing index.json")
	ErrLocatingBundleDefinition          = errors.New("locating bundle definition")
	ErrVerifyingArtifactDigest           = errors.New("artifact digest verification failed")
	ErrReadingBundleDefinitionManifest   = errors.New("reading bundle definition manifest")
	ErrParsingBundleDefinitionManifest   = errors.New("parsing bundle definition manifest")
	ErrReadingValuesDirectory            = errors.New("reading values directory")
	ErrResolvingDestinationDirectory     = errors.New("resolving destination directory")
	ErrPruningUnreferencedBlobs          = errors.New("cleaning up unreferenced blobs")
	ErrCreatingVerificationWorkspace     = errors.New("creating package verification workspace")
	ErrPushingBundleHCL                  = errors.New("pushing bundle HCL")
	ErrPushingDefaultsHCL                = errors.New("pushing defaults HCL")
	ErrPackingBundleDefinitionManifest   = errors.New("packing bundle definition manifest")
	ErrCreatingInspectionWorkspace       = errors.New("creating inspection workspace")
	ErrFetchingBundleDefinitionManifest  = errors.New("fetching bundle definition manifest")
	ErrFetchingBundleDefinitionHCL       = errors.New("fetching bundle definition HCL")
	ErrInvalidBundle                     = errors.New("invalid bundle")
	ErrFetchingPackageManifest           = errors.New("fetching package manifest")
	ErrParsingPackageManifest            = errors.New("parsing package manifest")
	ErrFetchingZarfYAML                  = errors.New("fetching zarf.yaml")
	ErrParsingZarfYAML                   = errors.New("parsing zarf.yaml")
)

Functions

func CountTarZstEntries

func CountTarZstEntries(ctx context.Context, src, name string) (count int, retErr error)

CountTarZstEntries returns the number of archive entries that extract to name.

func CreateBundleArchive

func CreateBundleArchive(ctx context.Context, streams iostreams.IOStreams, ociDir, targetDir string, idx ocispec.Index, arch string) (string, error)

CreateBundleArchive writes a pulled OCI bundle layout to targetDir.

func ExtractTarZst

func ExtractTarZst(ctx context.Context, streams iostreams.IOStreams, src, dst string) error

ExtractTarZst extracts a tar.zst archive into dst.

func IsTarZst

func IsTarZst(s string) bool

IsTarZst reports whether s has a .tar.zst extension.

func ValidateBundleForCreate

func ValidateBundleForCreate(b *spec.UDSBundle) error

ValidateBundleForCreate applies the create-only package signature policy.

func WriteTarZst

func WriteTarZst(ctx context.Context, streams iostreams.IOStreams, dst, srcDir string) (retErr error)

WriteTarZst writes the regular files beneath srcDir to a tar.zst archive.

Types

type ConfiguringPackageSignatureVerificationError

type ConfiguringPackageSignatureVerificationError struct {
	Package string
	Err     error
}

func (ConfiguringPackageSignatureVerificationError) Error

func (ConfiguringPackageSignatureVerificationError) Unwrap

type ConflictingPackageManifestDigestError

type ConflictingPackageManifestDigestError struct {
	Annotation     string
	Reference      string
	ExistingDigest digest.Digest
	Digest         digest.Digest
}

func (ConflictingPackageManifestDigestError) Error

type CreateOptions

type CreateOptions struct {
	Config      *bundleinternal.UDSBundleConfig
	Bundle      *spec.UDSBundle
	BundleHCL   []byte
	DefaultsHCL []byte
	BundleDir   string
	Streams     iostreams.IOStreams
}

CreateOptions contains private inputs needed to assemble a bundle artifact.

type CreateResult

type CreateResult struct{ OutputPath string }

CreateResult contains the path written by Create.

func Create

func Create(ctx context.Context, opts CreateOptions) (*CreateResult, error)

Create assembles an OCI layout and writes it as a UDS bundle archive.

type CreatingLayerDirectoryError

type CreatingLayerDirectoryError struct {
	Title string
	Err   error
}

func (CreatingLayerDirectoryError) Error

func (CreatingLayerDirectoryError) Unwrap

type ExtractedBundle

type ExtractedBundle struct {
	// Dir is the root extraction directory containing bundle.uds.hcl and,
	// when present, defaults.uds.hcl and values files. The caller owns this
	// directory and is responsible for its cleanup.
	Dir string

	// OCIDir is the extracted OCI image layout directory (Dir + "/oci").
	OCIDir string

	// BundleDefPath is the absolute path to the materialized bundle definition.
	BundleDefPath string

	// PackageManifests maps each package ref.name to its OCI manifest descriptor.
	PackageManifests map[string]ocispec.Descriptor
}

ExtractedBundle holds the results of extracting a bundle artifact.

func ExtractArtifact

func ExtractArtifact(ctx context.Context, streams iostreams.IOStreams, tarPath, dstDir string) (*ExtractedBundle, error)

ExtractArtifact extracts a .tar.zst bundle artifact into dstDir, verifies OCI layout digests, and materializes bundle.uds.hcl, defaults.uds.hcl, and values files at the top of dstDir so existing source-dir code paths work without modification. Returns an ExtractedBundle with package digest info.

dstDir must already exist; the caller owns its lifecycle (creation and cleanup). On failure, extracted files may remain in dstDir. The caller is responsible for cleanup in all cases.

func (*ExtractedBundle) ValuesFilesByPackage

func (e *ExtractedBundle) ValuesFilesByPackage() (map[string][]string, error)

ValuesFilesByPackage walks the values/<pkg>/*.yaml directory tree materialized by ExtractArtifact and returns a map of package name to ordered list of absolute file paths. Files are sorted numerically by the index in their filename stem (0.yaml < 1.yaml < ... < 10.yaml).

type IngestingPackageError

type IngestingPackageError struct {
	Package string
	Err     error
}

func (IngestingPackageError) Error

func (e IngestingPackageError) Error() string

func (IngestingPackageError) Unwrap

func (e IngestingPackageError) Unwrap() error

type InspectOptions

type InspectOptions struct {
	Source  string
	Config  *bundleinternal.UDSBundleConfig
	Streams iostreams.IOStreams
}

InspectOptions contains the internal inputs for built bundle inspection.

type InspectResult

type InspectResult struct {
	Bundle            *spec.UDSBundle
	Packages          []*spec.Package
	ArtifactDigest    string
	ReconfiguredFrom  string
	PackageSignatures map[string]PackageSignatureSummary
}

InspectResult contains the parsed bundle and metadata extracted during inspection.

func Inspect

func Inspect(ctx context.Context, opts InspectOptions) (*InspectResult, error)

Inspect reads a built local or OCI bundle. It reads metadata only and does not verify package content or signatures.

type InspectingPackageSignatureError

type InspectingPackageSignatureError struct {
	Package string
	Err     error
}

func (InspectingPackageSignatureError) Error

func (InspectingPackageSignatureError) Unwrap

type InvalidBundleIndexError

type InvalidBundleIndexError struct {
	Source       string
	ArtifactType string
}

func (InvalidBundleIndexError) Error

func (e InvalidBundleIndexError) Error() string

type LayerNotFoundError

type LayerNotFoundError struct{ Title string }

func (LayerNotFoundError) Error

func (e LayerNotFoundError) Error() string

type LayerTitleEscapesDestinationError

type LayerTitleEscapesDestinationError struct{ Title string }

func (LayerTitleEscapesDestinationError) Error

type MissingBundleArchitectureError

type MissingBundleArchitectureError struct{ Annotation string }

func (MissingBundleArchitectureError) Error

type MissingPackageManifestAnnotationError

type MissingPackageManifestAnnotationError struct {
	Index      int
	Annotation string
}

func (MissingPackageManifestAnnotationError) Error

type MultiplePackageManifestEntriesError

type MultiplePackageManifestEntriesError struct{ Package string }

func (MultiplePackageManifestEntriesError) Error

type OutputPathIsDirError

type OutputPathIsDirError struct{ Path string }

func (OutputPathIsDirError) Error

func (e OutputPathIsDirError) Error() string

type PackageManifestNotFoundError

type PackageManifestNotFoundError struct {
	Package string
	Source  string
}

func (PackageManifestNotFoundError) Error

type PackageSignatureSummary

type PackageSignatureSummary struct {
	Signed       PackageSigningStatus
	Verification PackageVerificationStatus
}

PackageSignatureSummary contains package signing and verification metadata.

type PackageSigningStatus

type PackageSigningStatus uint8

PackageSigningStatus describes signing metadata persisted in a package.

const (
	PackageSigningStatusUnknown PackageSigningStatus = iota
	PackageSigningStatusSigned
	PackageSigningStatusUnsigned
)

type PackageVerificationStatus

type PackageVerificationStatus uint8

PackageVerificationStatus describes the verification posture persisted in a package manifest.

const (
	PackageVerificationStatusUnknown PackageVerificationStatus = iota
	PackageVerificationStatusVerified
	PackageVerificationStatusSkipped
)

type PushingValueFileError

type PushingValueFileError struct {
	Package string
	Err     error
}

func (PushingValueFileError) Error

func (e PushingValueFileError) Error() string

func (PushingValueFileError) Unwrap

func (e PushingValueFileError) Unwrap() error

type ReadingLayerBlobError

type ReadingLayerBlobError struct {
	Title  string
	Digest digest.Digest
	Err    error
}

func (ReadingLayerBlobError) Error

func (e ReadingLayerBlobError) Error() string

func (ReadingLayerBlobError) Unwrap

func (e ReadingLayerBlobError) Unwrap() error

type ReadingPackageValuesError

type ReadingPackageValuesError struct {
	Package string
	Err     error
}

func (ReadingPackageValuesError) Error

func (ReadingPackageValuesError) Unwrap

func (e ReadingPackageValuesError) Unwrap() error

type ReadingValueFileError

type ReadingValueFileError struct {
	Package string
	Path    string
	Err     error
}

func (ReadingValueFileError) Error

func (e ReadingValueFileError) Error() string

func (ReadingValueFileError) Unwrap

func (e ReadingValueFileError) Unwrap() error

type ResolvingBundleSourceError

type ResolvingBundleSourceError struct {
	Source string
	Err    error
}

func (ResolvingBundleSourceError) Error

func (ResolvingBundleSourceError) Unwrap

func (e ResolvingBundleSourceError) Unwrap() error

type ResolvingInspectSourceError

type ResolvingInspectSourceError struct {
	Source string
	Err    error
}

func (ResolvingInspectSourceError) Error

func (ResolvingInspectSourceError) Unwrap

type UnsupportedFileTypeError

type UnsupportedFileTypeError struct{ Path string }

func (UnsupportedFileTypeError) Error

func (e UnsupportedFileTypeError) Error() string

type UnsupportedMediaTypeError

type UnsupportedMediaTypeError struct {
	Artifact  string
	MediaType string
}

func (UnsupportedMediaTypeError) Error

type UnsupportedPackageEntryMediaTypeError

type UnsupportedPackageEntryMediaTypeError struct {
	Package   string
	MediaType string
}

func (UnsupportedPackageEntryMediaTypeError) Error

type UnsupportedPackageManifestMediaTypeError

type UnsupportedPackageManifestMediaTypeError struct {
	Index     int
	MediaType string
}

func (UnsupportedPackageManifestMediaTypeError) Error

type UnsupportedSchemaVersionError

type UnsupportedSchemaVersionError struct {
	Artifact string
	Version  int
}

func (UnsupportedSchemaVersionError) Error

type ValueFileIsDirectoryError

type ValueFileIsDirectoryError struct {
	Package string
	Path    string
}

func (ValueFileIsDirectoryError) Error

type ValueFileStatError

type ValueFileStatError struct {
	Package string
	Path    string
	Err     error
}

func (ValueFileStatError) Error

func (e ValueFileStatError) Error() string

func (ValueFileStatError) Unwrap

func (e ValueFileStatError) Unwrap() error

type VerifyingAndIngestingPackageError

type VerifyingAndIngestingPackageError struct {
	Package string
	Err     error
}

func (VerifyingAndIngestingPackageError) Error

func (VerifyingAndIngestingPackageError) Unwrap

type WritingLayerError

type WritingLayerError struct {
	Title string
	Err   error
}

func (WritingLayerError) Error

func (e WritingLayerError) Error() string

func (WritingLayerError) Unwrap

func (e WritingLayerError) Unwrap() error

Jump to

Keyboard shortcuts

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