cluster

package
v0.53.8 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultKindKey is the key in the config map for the default kind setting
	DefaultKindKey = "default-kind"
	// DefaultNamespaceKey is the key in the config map for the default namespace setting
	DefaultNamespaceKey = "default-namespace"

	// AllowedNamespacesKey is the key in the config map for an optional comma-separated list of namespaces which the
	// resolver is allowed to access. Defaults to empty, meaning all namespaces are allowed.
	AllowedNamespacesKey = "allowed-namespaces"
	// BlockedNamespacesKey is the key in the config map for an optional comma-separated list of namespaces which the
	// resolver is blocked from accessing. Defaults to empty, meaning no namespaces are blocked.
	BlockedNamespacesKey = "blocked-namespaces"
)
View Source
const (
	// KindParam is the parameter for the object kind
	KindParam = "kind"
	// NameParam is the parameter for the object name
	NameParam = "name"
	// NamespaceParam is the parameter for the namespace containing the object
	NamespaceParam = "namespace"
)
View Source
const (

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

	// ClusterResolverName is the name that the cluster resolver should be
	// associated with
	ClusterResolverName string = "Cluster"
)

Variables

View Source
var (
	// ResourceNameAnnotation is the annotation key for the fetched resource name
	ResourceNameAnnotation = resolution.GroupName + "/name"
	// ResourceNamespaceAnnotation is the annotation key for the fetched resource's namespace
	ResourceNamespaceAnnotation = resolution.GroupName + "/namespace"
)

Functions

This section is empty.

Types

type ResolvedClusterResource

type ResolvedClusterResource struct {
	// Content is the actual resolved resource data.
	Content []byte
	// Spec is the data in the resolved task/pipeline CRD spec.
	Spec []byte
	// Name is the resolved resource name in the cluster
	Name string
	// Namespace is the namespace in the cluster under which the resolved resource was created.
	Namespace string
	// Identifier is the unique identifier for the resource in the cluster.
	// It is in the format of <resource uri>@<uid>.
	// Resource URI is the namespace-scoped uri i.e. /apis/GROUP/VERSION/namespaces/NAMESPACE/RESOURCETYPE/NAME.
	// https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-uris
	Identifier string
	// Sha256 Checksum of the cluster resource
	Checksum []byte
}

ResolvedClusterResource implements framework.ResolvedResource and returns the resolved file []byte data and an annotation map for any metadata.

func (*ResolvedClusterResource) Annotations

func (r *ResolvedClusterResource) Annotations() map[string]string

Annotations returns the metadata that accompanies the resource fetched from the cluster.

func (*ResolvedClusterResource) Data

func (r *ResolvedClusterResource) Data() []byte

Data returns the bytes of the file resolved from git.

func (ResolvedClusterResource) RefSource added in v0.47.0

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

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

Resolver implements a framework.Resolver that can fetch resources from other namespaces.

func (*Resolver) GetConfigName

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

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

func (*Resolver) GetName

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

GetName returns the string name that the cluster resolver should be associated with.

func (*Resolver) GetSelector

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

GetSelector returns the labels that resource requests are required to have for the cluster resolver to process them.

func (*Resolver) Initialize

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

Initialize performs any setup required by the cluster resolver.

func (*Resolver) Resolve

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

Resolve performs the work of fetching a resource from a namespace with the given parameters.

func (*Resolver) ValidateParams

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

ValidateParams returns an error if the given parameter map is not valid for a resource request targeting the cluster resolver.

Jump to

Keyboard shortcuts

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