Documentation
¶
Index ¶
- Variables
- func CountTarZstEntries(ctx context.Context, src, name string) (count int, retErr error)
- func CreateBundleArchive(ctx context.Context, streams iostreams.IOStreams, ociDir, targetDir string, ...) (string, error)
- func ExtractTarZst(ctx context.Context, streams iostreams.IOStreams, src, dst string) error
- func IsTarZst(s string) bool
- func ValidateBundleForCreate(b *spec.UDSBundle) error
- func WriteTarZst(ctx context.Context, streams iostreams.IOStreams, dst, srcDir string) (retErr error)
- type ConfiguringPackageSignatureVerificationError
- type ConflictingPackageManifestDigestError
- type CreateOptions
- type CreateResult
- type CreatingLayerDirectoryError
- type ExtractedBundle
- type IngestingPackageError
- type InspectOptions
- type InspectResult
- type InspectingPackageSignatureError
- type InvalidBundleIndexError
- type LayerNotFoundError
- type LayerTitleEscapesDestinationError
- type MissingBundleArchitectureError
- type MissingPackageManifestAnnotationError
- type MultiplePackageManifestEntriesError
- type OutputPathIsDirError
- type PackageManifestNotFoundError
- type PackageSignatureSummary
- type PackageSigningStatus
- type PackageVerificationStatus
- type PushingValueFileError
- type ReadingLayerBlobError
- type ReadingPackageValuesError
- type ReadingValueFileError
- type ResolvingBundleSourceError
- type ResolvingInspectSourceError
- type UnsupportedFileTypeError
- type UnsupportedMediaTypeError
- type UnsupportedPackageEntryMediaTypeError
- type UnsupportedPackageManifestMediaTypeError
- type UnsupportedSchemaVersionError
- type ValueFileIsDirectoryError
- type ValueFileStatError
- type VerifyingAndIngestingPackageError
- type WritingLayerError
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
ExtractTarZst extracts a tar.zst archive into dst.
func ValidateBundleForCreate ¶
ValidateBundleForCreate applies the create-only package signature policy.
Types ¶
type ConfiguringPackageSignatureVerificationError ¶
func (ConfiguringPackageSignatureVerificationError) Error ¶
func (e ConfiguringPackageSignatureVerificationError) Error() string
func (ConfiguringPackageSignatureVerificationError) Unwrap ¶
func (e ConfiguringPackageSignatureVerificationError) Unwrap() error
type ConflictingPackageManifestDigestError ¶
type ConflictingPackageManifestDigestError struct {
Annotation string
Reference string
ExistingDigest digest.Digest
Digest digest.Digest
}
func (ConflictingPackageManifestDigestError) Error ¶
func (e ConflictingPackageManifestDigestError) Error() string
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 ¶
func (CreatingLayerDirectoryError) Error ¶
func (e CreatingLayerDirectoryError) Error() string
func (CreatingLayerDirectoryError) Unwrap ¶
func (e CreatingLayerDirectoryError) Unwrap() error
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 ¶
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 ¶
func (InspectingPackageSignatureError) Error ¶
func (e InspectingPackageSignatureError) Error() string
func (InspectingPackageSignatureError) Unwrap ¶
func (e InspectingPackageSignatureError) Unwrap() error
type InvalidBundleIndexError ¶
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 ¶
func (e LayerTitleEscapesDestinationError) Error() string
type MissingBundleArchitectureError ¶
type MissingBundleArchitectureError struct{ Annotation string }
func (MissingBundleArchitectureError) Error ¶
func (e MissingBundleArchitectureError) Error() string
type MissingPackageManifestAnnotationError ¶
func (MissingPackageManifestAnnotationError) Error ¶
func (e MissingPackageManifestAnnotationError) Error() string
type MultiplePackageManifestEntriesError ¶
type MultiplePackageManifestEntriesError struct{ Package string }
func (MultiplePackageManifestEntriesError) Error ¶
func (e MultiplePackageManifestEntriesError) Error() string
type OutputPathIsDirError ¶
type OutputPathIsDirError struct{ Path string }
func (OutputPathIsDirError) Error ¶
func (e OutputPathIsDirError) Error() string
type PackageManifestNotFoundError ¶
func (PackageManifestNotFoundError) Error ¶
func (e PackageManifestNotFoundError) Error() string
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 ¶
func (PushingValueFileError) Error ¶
func (e PushingValueFileError) Error() string
func (PushingValueFileError) Unwrap ¶
func (e PushingValueFileError) Unwrap() error
type ReadingLayerBlobError ¶
func (ReadingLayerBlobError) Error ¶
func (e ReadingLayerBlobError) Error() string
func (ReadingLayerBlobError) Unwrap ¶
func (e ReadingLayerBlobError) Unwrap() error
type ReadingPackageValuesError ¶
func (ReadingPackageValuesError) Error ¶
func (e ReadingPackageValuesError) Error() string
func (ReadingPackageValuesError) Unwrap ¶
func (e ReadingPackageValuesError) Unwrap() error
type ReadingValueFileError ¶
func (ReadingValueFileError) Error ¶
func (e ReadingValueFileError) Error() string
func (ReadingValueFileError) Unwrap ¶
func (e ReadingValueFileError) Unwrap() error
type ResolvingBundleSourceError ¶
func (ResolvingBundleSourceError) Error ¶
func (e ResolvingBundleSourceError) Error() string
func (ResolvingBundleSourceError) Unwrap ¶
func (e ResolvingBundleSourceError) Unwrap() error
type ResolvingInspectSourceError ¶
func (ResolvingInspectSourceError) Error ¶
func (e ResolvingInspectSourceError) Error() string
func (ResolvingInspectSourceError) Unwrap ¶
func (e ResolvingInspectSourceError) Unwrap() error
type UnsupportedFileTypeError ¶
type UnsupportedFileTypeError struct{ Path string }
func (UnsupportedFileTypeError) Error ¶
func (e UnsupportedFileTypeError) Error() string
type UnsupportedMediaTypeError ¶
func (UnsupportedMediaTypeError) Error ¶
func (e UnsupportedMediaTypeError) Error() string
type UnsupportedPackageEntryMediaTypeError ¶
func (UnsupportedPackageEntryMediaTypeError) Error ¶
func (e UnsupportedPackageEntryMediaTypeError) Error() string
type UnsupportedPackageManifestMediaTypeError ¶
func (UnsupportedPackageManifestMediaTypeError) Error ¶
func (e UnsupportedPackageManifestMediaTypeError) Error() string
type UnsupportedSchemaVersionError ¶
func (UnsupportedSchemaVersionError) Error ¶
func (e UnsupportedSchemaVersionError) Error() string
type ValueFileIsDirectoryError ¶
func (ValueFileIsDirectoryError) Error ¶
func (e ValueFileIsDirectoryError) Error() string
type ValueFileStatError ¶
func (ValueFileStatError) Error ¶
func (e ValueFileStatError) Error() string
func (ValueFileStatError) Unwrap ¶
func (e ValueFileStatError) Unwrap() error
type VerifyingAndIngestingPackageError ¶
func (VerifyingAndIngestingPackageError) Error ¶
func (e VerifyingAndIngestingPackageError) Error() string
func (VerifyingAndIngestingPackageError) Unwrap ¶
func (e VerifyingAndIngestingPackageError) Unwrap() error
type WritingLayerError ¶
func (WritingLayerError) Error ¶
func (e WritingLayerError) Error() string
func (WritingLayerError) Unwrap ¶
func (e WritingLayerError) Unwrap() error