bundle

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PodmanKeyChain authn.Keychain = &podmanKeychain{}

Functions

func AddCacheFlags

func AddCacheFlags(flags *pflag.FlagSet, opts *CacheOptions)

AddCacheFlags will define a set of flags to control how Tekton Bundle caching is done.

func AddRemoteFlags

func AddRemoteFlags(flags *pflag.FlagSet, opts *RemoteOptions)

AddRemoteFlags will define a common set of flags that can be used to change how images are pushed/fetched from remote image repositories.

func BuildTektonBundle

func BuildTektonBundle(contents []string, annotations map[string]string, ctime time.Time, log io.Writer) (v1.Image, error)

BuildTektonBundle will return a complete OCI Image usable as a Tekton Bundle built by parsing, decoding, and compressing the provided contents as Tekton objects.

func Get

func Get(img v1.Image, pkind, name string, visitor ObjectVisitor) error

Get returns a single named element of a specific kind from the Tekton Bundle.

func List

func List(img v1.Image, visitor ObjectVisitor) error

List will call visitor for every single layer in the img.

func ListKind

func ListKind(img v1.Image, pkind string, visitor ObjectVisitor) error

ListKind is like #List but only returns elements of a single kind. Kind will be lowercased to conform to the Tekton Bundle spec.

func Read

func Read(ref name.Reference, cacheOptions *CacheOptions, opts ...remoteimg.Option) (v1.Image, error)

Read looks up an image from a remote registry and fetches layers from a local cache if we have seen it before.

func Write

func Write(img v1.Image, ref name.Reference, opts ...remoteimg.Option) (string, error)

Write will publish an OCI image to a remote registry using the provided options and reference.

Types

type CacheOptions

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

PullOptions configure how an image is cached once it is fetched from the remote.

type ObjectVisitor

type ObjectVisitor func(version, kind, name string, element runtime.Object, raw []byte)

ObjectVisitor is an input function that callers of this file's methods can implement to act on the read contents of a Tekton bundle. The `version`, `kind`, and `name` fields map 1:1 with the same named fields in the Tekton Bundle spec.

type RemoteOptions

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

RemoteOptions is a set of flags that are used configure the connection options to a registry.

func (*RemoteOptions) ToOptions

func (r *RemoteOptions) ToOptions() []remoteimg.Option

ToOptions outputs a list of `remoteimg.Option`s that can be passed into various fetch/write calls to a remote registry.

Jump to

Keyboard shortcuts

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