Documentation
¶
Index ¶
- Constants
- Variables
- type RequestOptions
- type ResolvedResource
- type Resolver
- func (r *Resolver) GetConfigName(context.Context) string
- func (r *Resolver) GetName(context.Context) string
- func (r *Resolver) GetSelector(context.Context) map[string]string
- func (r *Resolver) Initialize(ctx context.Context) error
- func (r *Resolver) Resolve(ctx context.Context, params []pipelinev1beta1.Param) (framework.ResolvedResource, error)
- func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1beta1.Param) error
Constants ¶
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" )
const ( // ConfigMapName is the bundle resolver's config map ConfigMapName = "bundleresolver-config" // 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" )
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" )
const (
// MaximumBundleObjects defines the maximum number of objects in a bundle
MaximumBundleObjects = 20
)
const ParamBundle = "bundle"
ParamBundle is the parameter defining what the bundle image url is.
const ParamKind = "kind"
ParamKind is the parameter defining what the layer kind in the bundle image is.
const ParamName = "name"
ParamName is the parameter defining what the layer name in the bundle image is.
const ParamServiceAccount = "serviceAccount"
ParamServiceAccount is the parameter defining what service account name to use for bundle requests.
Variables ¶
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 ¶
This section is empty.
Types ¶
type RequestOptions ¶
RequestOptions are the options used to request a resource from a remote bundle.
func OptionsFromParams ¶
func OptionsFromParams(ctx context.Context, params []pipelinev1beta1.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) Source ¶ added in v0.41.0
func (br *ResolvedResource) Source() *pipelinev1beta1.ConfigSource
Source 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 ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements a framework.Resolver that can fetch files from OCI bundles.
func (*Resolver) GetConfigName ¶
GetConfigName returns the name of the bundle resolver's configmap.
func (*Resolver) GetSelector ¶
GetSelector returns a map of labels to match requests to this Resolver.
func (*Resolver) Initialize ¶
Initialize sets up any dependencies needed by the Resolver. None atm.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(ctx context.Context, params []pipelinev1beta1.Param) (framework.ResolvedResource, error)
Resolve uses the given params to resolve the requested file or resource.
func (*Resolver) ValidateParams ¶
ValidateParams ensures parameters from a request are as expected.