hangar

package
v1.9.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValidateFailed = errors.New("some images failed to validate")
	ErrCopyFailed     = errors.New("some images failed to copy")
	ErrSignFailed     = errors.New("some images failed to sign")
	ErrScanFailed     = errors.New("some images failed to scan")
)

Functions

func NewError

func NewError(id int, e error, s *source.Source, d *destination.Destination) error

Types

type CommonOpts

type CommonOpts struct {
	Images              []string
	Arch                []string
	OS                  []string
	Variant             []string
	Timeout             time.Duration
	Workers             int
	FailedImageListName string
	SystemContext       *typesv5.SystemContext
	Policy              *signaturev5.Policy
	RemoveSignatures    bool
	SigstorePrivateKey  string
	SigstorePassphrase  []byte
	SigstorePublicKey   string
	CopyProvenance      bool
	OverwriteExist      bool
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

type Hangar

type Hangar interface {
	Run(ctx context.Context) error
	Validate(ctx context.Context) error
	FailedImages() error
}

type Loader

type Loader struct {

	// Specify the source image registry.
	SourceRegistry string
	// Specify the source image project.
	SourceProject string
	// Specify the destination image registry.
	DestinationRegistry string
	// Specify the destination image project.
	DestinationProject string
	// Directory is the source archive directory
	Directory string
	// SharedBlobDirPath is the directory to save the shared blobs
	SharedBlobDirPath string
	// ArchiveName is the archive file name to be load
	ArchiveName string
	// contains filtered or unexported fields
}

Loader loads images from hangar archive file to registry server.

func NewLoader

func NewLoader(o *LoaderOpts) (*Loader, error)

func (Loader) FailedImages added in v1.9.0

func (c Loader) FailedImages() error

func (*Loader) Run

func (l *Loader) Run(ctx context.Context) error

Run loads images from hangar archive to destination image registry

func (*Loader) Validate

func (l *Loader) Validate(ctx context.Context) error

type LoaderOpts

type LoaderOpts struct {
	CommonOpts

	// Specify the source image registry.
	SourceRegistry string
	// Specify the source image project.
	SourceProject string
	// Specify the destination image registry.
	DestinationRegistry string
	// Specify the destination image project.
	DestinationProject string
	// Directory is the source archive directory
	Directory string
	// SharedBlobDirPath is the directory to save the shared blobs
	SharedBlobDirPath string
	// ArchiveName is the archive file name to be load
	ArchiveName string
}

type Mirrorer

type Mirrorer struct {

	// Override the registry of source image to be copied
	SourceRegistry string
	// Override the registry of the copied destination image
	DestinationRegistry string
	// Override the project of source image to be copied
	SourceProject string
	// Override the project of the copied destination image
	DestinationProject string
	// contains filtered or unexported fields
}

Mirrorer mirrors multipule images between image registries.

func NewMirrorer

func NewMirrorer(o *MirrorerOpts) (*Mirrorer, error)

func (Mirrorer) FailedImages added in v1.9.0

func (c Mirrorer) FailedImages() error

func (*Mirrorer) Run

func (m *Mirrorer) Run(ctx context.Context) error

Run mirror images from source to destination registry.

func (*Mirrorer) Validate

func (m *Mirrorer) Validate(ctx context.Context) error

type MirrorerOpts

type MirrorerOpts struct {
	CommonOpts

	SourceRegistry      string
	DestinationRegistry string
	SourceProject       string
	DestinationProject  string
}

type Saver

type Saver struct {

	// Override the registry of source image to be copied
	SourceRegistry string
	// Override the project of source image to be copied
	SourceProject string
	// SharedBlobDirPath is the directory to save the shared blobs
	SharedBlobDirPath string
	// ArchiveName is the saved archive file name
	ArchiveName string
	// contains filtered or unexported fields
}

func NewSaver

func NewSaver(o *SaverOpts) (*Saver, error)

func (Saver) FailedImages added in v1.9.0

func (c Saver) FailedImages() error

func (*Saver) Run

func (s *Saver) Run(ctx context.Context) error

Run save images from registry server into local directory / hangar archive.

func (*Saver) Validate

func (s *Saver) Validate(ctx context.Context) error

type SaverOpts

type SaverOpts struct {
	CommonOpts

	// Override the registry of source image to be copied
	SourceRegistry string
	// Override the project of source image to be copied
	SourceProject string
	// SharedBlobDirPath is the directory to save the shared blobs
	SharedBlobDirPath string
	// ArchiveName is the saved archive file name
	ArchiveName string
}

type Scanner added in v1.8.0

type Scanner struct {

	// Override the registry
	Registry string
	// Override the project
	Project string
	// contains filtered or unexported fields
}

func NewScanner added in v1.8.0

func NewScanner(o *ScannerOpts) (*Scanner, error)

func (Scanner) FailedImages added in v1.9.0

func (c Scanner) FailedImages() error

func (*Scanner) Run added in v1.8.0

func (s *Scanner) Run(ctx context.Context) error

func (*Scanner) Validate added in v1.8.0

func (s *Scanner) Validate(_ context.Context) error

type ScannerOpts added in v1.8.0

type ScannerOpts struct {
	CommonOpts

	Report   *scan.Report
	Registry string
	Project  string
}

type SignerV1 added in v1.9.0

type SignerV1 struct {

	// Override the registry of all images to be signed
	Registry string
	// Override the project of all images to be signed
	Project string
	// contains filtered or unexported fields
}

func NewSignerV1 added in v1.9.0

func NewSignerV1(o *SignerV1Opts) (*SignerV1, error)

func (SignerV1) FailedImages added in v1.9.0

func (c SignerV1) FailedImages() error

func (*SignerV1) Run added in v1.9.0

func (s *SignerV1) Run(ctx context.Context) error

Run sign all images in the registry server.

func (*SignerV1) Validate added in v1.9.0

func (s *SignerV1) Validate(ctx context.Context) error

type SignerV1Opts added in v1.9.0

type SignerV1Opts struct {
	CommonOpts

	ExactRepository string
	Registry        string
	Project         string
}

type SignerV2 added in v1.9.0

type SignerV2 struct {

	// Override the registry of all images to be signed
	Registry string
	// Override the project of all images to be signed
	Project string
	// contains filtered or unexported fields
}

func NewSignerV2 added in v1.9.0

func NewSignerV2(o *Signerv2Opts) (*SignerV2, error)

func (SignerV2) FailedImages added in v1.9.0

func (c SignerV2) FailedImages() error

func (*SignerV2) InitGlobalSignerVerifier added in v1.9.0

func (s *SignerV2) InitGlobalSignerVerifier(ctx context.Context) error

func (*SignerV2) Run added in v1.9.0

func (s *SignerV2) Run(ctx context.Context) error

Run sign all images in the registry server.

func (*SignerV2) Validate added in v1.9.0

func (s *SignerV2) Validate(ctx context.Context) error

type Signerv2Opts added in v1.9.0

type Signerv2Opts struct {
	CommonOpts

	// sigstore public key filename
	PublicKey string

	// sigstore private key filename
	PrivateKey string

	// uploads to sigstore transparency log server or not
	TLogUpload bool

	// IgnoreTlog ignores transparency log server (for validate)
	IgnoreTlog bool

	// records timestamp or not
	RecordCreationTimestamp bool

	// rekorURL is the address of rekor STL server
	RekorURL string

	// OIDC provider to be used to issue ID token
	OIDCIssuer string

	// client ID for application (default sigstore)
	OIDCClientID string

	// provider to get the OIDC token
	// (spiffe, google, github-actions, filesystem, buildkite-agent)
	OIDCProvider string

	// allow HTTP & insecure TLS certificate registry
	InsecureSkipTLSVerify bool

	AutoYes bool

	// CertIdentity is the fulcio certificate (for keyless validate)
	CertIdentity string

	// CertOidcIssuer is the OIDC issuer of fulcio certificate (for keyless validate)
	CertOidcIssuer string

	// signManifestIndex will create a cosign signature for manifest index
	SignManifestIndex bool

	// validateManifestIndex will validate the cosign signature of manifest index
	ValidateManifestIndex bool

	Report *signv2.Report

	Registry string
	Project  string
}

type Syncer

type Syncer struct {

	// Override the registry of source image to be copied
	SourceRegistry string
	// Override the project of source image to be copied
	SourceProject string
	// SharedBlobDirPath is the directory to save the shared blobs
	SharedBlobDirPath string
	// ArchiveName is the saved archive file name
	ArchiveName string
	// contains filtered or unexported fields
}

func NewSyncer

func NewSyncer(o *SyncerOpts) (*Syncer, error)

func (Syncer) FailedImages added in v1.9.0

func (c Syncer) FailedImages() error

func (*Syncer) Run

func (s *Syncer) Run(ctx context.Context) error

Run append images from registry server into local directory / hangar archive.

func (*Syncer) Validate

func (s *Syncer) Validate(ctx context.Context) error

type SyncerOpts

type SyncerOpts struct {
	CommonOpts

	// Override the registry of source image to be copied
	SourceRegistry string
	// Override the project of source image to be copied
	SourceProject string
	// SharedBlobDirPath is the directory to save the shared blobs
	SharedBlobDirPath string
	// ArchiveName is the saved archive file name
	ArchiveName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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