Documentation ¶
Index ¶
- Constants
- Variables
- type ResolvedClusterResource
- 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, origParams []pipelinev1.Param) (framework.ResolvedResource, error)
- func (r *Resolver) ValidateParams(ctx context.Context, params []pipelinev1.Param) error
Constants ¶
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" )
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" )
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 ¶
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
func (r ResolvedClusterResource) 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 ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements a framework.Resolver that can fetch resources from other namespaces.
func (*Resolver) GetConfigName ¶
GetConfigName returns the name of the cluster resolver's configmap.
func (*Resolver) GetName ¶
GetName returns the string name that the cluster resolver should be associated with.
func (*Resolver) GetSelector ¶
GetSelector returns the labels that resource requests are required to have for the cluster resolver to process them.
func (*Resolver) Initialize ¶
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 ¶
ValidateParams returns an error if the given parameter map is not valid for a resource request targeting the cluster resolver.