bundle

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// BundleAnnotationKind is the image layer annotation used to indicate
	// the "kind" of resource stored in a given layer.
	BundleAnnotationKind = "dev.tekton.image.kind"

	// BundleAnnotationName is the image layer annotation used to indicate
	// the "name" of resource stored in a given layer.
	BundleAnnotationName = "dev.tekton.image.name"

	// BundleAnnotationAPIVersion is the image layer annotation used to
	// indicate the "apiVersion" of resource stored in a given layer.
	BundleAnnotationAPIVersion = "dev.tekton.image.apiVersion"
)
View Source
const (
	// ConfigServiceAccount is the configuration field name for controlling
	// the Service Account name to use for bundle requests.
	ConfigServiceAccount = "default-service-account"
	// ConfigKind is the configuration field name for controlling
	// what the layer name in the bundle image is.
	ConfigKind = "default-kind"
	// ConfigTimeoutKey is the configuration field name for controlling
	// the maximum duration of a resolution request for a file from registry.
	ConfigTimeoutKey = "fetch-timeout"
	// ConfigBackoffDuration is the configuration field name for controlling
	// the initial duration of a backoff when a bundle resolution fails
	ConfigBackoffDuration  = "backoff-duration"
	DefaultBackoffDuration = 2.0 * time.Second
	// ConfigBackoffFactor is the configuration field name for controlling
	// the factor by which successive backoffs will increase when a bundle
	// resolution fails
	ConfigBackoffFactor  = "backoff-factor"
	DefaultBackoffFactor = 2.0
	// ConfigBackoffJitter is the configuration field name for controlling
	// the randomness applied to backoff durations when a bundle resolution fails
	ConfigBackoffJitter  = "backoff-jitter"
	DefaultBackoffJitter = 0.1
	// ConfigBackoffSteps is the configuration field name for controlling
	// the number of attempted backoffs to retry when a bundle resolution fails
	ConfigBackoffSteps  = "backoff-steps"
	DefaultBackoffSteps = 2
	// ConfigBackoffCap is the configuration field name for controlling
	// the maximum duration to try when backing off
	ConfigBackoffCap  = "backoff-cap"
	DefaultBackoffCap = 10 * time.Second
)
View Source
const (

	// LabelValueBundleResolverType is the value to use for the
	// resolution.tekton.dev/type label on resource requests
	LabelValueBundleResolverType string = "bundles"

	// BundleResolverName is the name that the bundle resolver should be associated with.
	BundleResolverName = "bundleresolver"

	// ConfigMapName is the bundle resolver's config map
	ConfigMapName = "bundleresolver-config"
)
View Source
const (
	// MaximumBundleObjects defines the maximum number of objects in a bundle
	MaximumBundleObjects = 20
)
View Source
const ParamBundle = "bundle"

ParamBundle is the parameter defining what the bundle image url is.

View Source
const ParamImagePullSecret = "secret"

ParamImagePullSecret is the parameter defining what secret name to use for bundle requests.

View Source
const ParamKind = "kind"

ParamKind is the parameter defining what the layer kind in the bundle image is.

View Source
const ParamName = resource.ParamName

ParamName is the parameter defining what the layer name in the bundle image is.

View Source
const ParamServiceAccount = "serviceAccount"

ParamServiceAccount is the parameter defining what service account name to use for bundle requests.

Variables

View Source
var (
	// ResolverAnnotationKind is the resolver annotation used to indicate
	// the "kind" of resource.
	ResolverAnnotationKind = resolution.GroupName + "/" + BundleAnnotationKind

	// ResolverAnnotationName is resolver annotation used to indicate
	// the "name" of resource.
	ResolverAnnotationName = resolution.GroupName + "/" + BundleAnnotationName

	// ResolverAnnotationAPIVersion is the resolver annotation used to
	// indicate the "apiVersion" of resource.
	ResolverAnnotationAPIVersion = resolution.GroupName + "/" + BundleAnnotationAPIVersion
)

Functions

func GetBundleResolverBackoff added in v1.0.0

func GetBundleResolverBackoff(ctx context.Context) (remote.Backoff, error)

GetBundleResolverBackoff returns a remote.Backoff to be passed when resolving remote images. This can be configured with the backoff-duration, backoff-factor, backoff-jitter, backoff-steps, and backoff-cap fields in the bundle-resolver-config ConfigMap.

func ResolveRequest added in v0.60.0

Resolve uses the given params to resolve the requested file or resource.

func ValidateParams added in v0.60.0

func ValidateParams(ctx context.Context, params []v1.Param) error

Types

type RequestOptions

type RequestOptions struct {
	ServiceAccount  string
	ImagePullSecret string
	Bundle          string
	EntryName       string
	Kind            string
}

RequestOptions are the options used to request a resource from a remote bundle.

func OptionsFromParams

func OptionsFromParams(ctx context.Context, params []pipelinev1.Param) (RequestOptions, error)

OptionsFromParams parses the params from a resolution request and converts them into options to pass as part of a bundle request.

type ResolvedResource

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

ResolvedResource wraps the content of a matched entry in a bundle.

func GetEntry

func GetEntry(ctx context.Context, keychain authn.Keychain, opts RequestOptions) (*ResolvedResource, error)

GetEntry accepts a keychain and options for the request and returns either a successfully resolved bundle entry or an error.

func (*ResolvedResource) Annotations

func (br *ResolvedResource) Annotations() map[string]string

Annotations returns the annotations from the bundle that are relevant to resolution.

func (*ResolvedResource) Data

func (br *ResolvedResource) Data() []byte

Data returns the bytes of the resource fetched from the bundle.

func (*ResolvedResource) RefSource added in v0.47.0

func (br *ResolvedResource) RefSource() *pipelinev1.RefSource

RefSource is the source reference of the remote data that records where the remote file came from including the url, digest and the entrypoint.

type Resolver deprecated

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

Resolver implements a framework.Resolver that can fetch files from OCI bundles.

Deprecated: Use github.com/tektoncd/pipeline/pkg/remoteresolution/resolver/bundle.Resolver instead.

func (*Resolver) GetConfigName

func (r *Resolver) GetConfigName(context.Context) string

GetConfigName returns the name of the git resolver's configmap.

func (*Resolver) GetName

func (r *Resolver) GetName(context.Context) string

GetName returns a string name to refer to this Resolver by.

func (*Resolver) GetResolutionTimeout added in v0.68.0

func (r *Resolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration, params map[string]string) (time.Duration, error)

GetResolutionTimeout returns a time.Duration for the amount of time a single bundle fetch may take. This can be configured with the fetch-timeout field in the bundle-resolver-config ConfigMap.

func (*Resolver) GetSelector

func (r *Resolver) GetSelector(context.Context) map[string]string

GetSelector returns a map of labels to match requests to this Resolver.

func (*Resolver) Initialize

func (r *Resolver) Initialize(ctx context.Context) error

Initialize sets up any dependencies needed by the Resolver. None atm.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, params []v1.Param) (framework.ResolvedResource, error)

Resolve uses the given params to resolve the requested file or resource.

func (*Resolver) ValidateParams

func (r *Resolver) ValidateParams(ctx context.Context, params []v1.Param) error

ValidateParams ensures parameters from a request are as expected.

Jump to

Keyboard shortcuts

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