Documentation ¶
Index ¶
- Constants
- type ResolvedGitResource
- type Resolver
- func (r *Resolver) GetConfigName(context.Context) string
- func (r *Resolver) GetName(_ context.Context) string
- func (r *Resolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration) time.Duration
- 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 map[string]string) (framework.ResolvedResource, error)
- func (r *Resolver) ValidateParams(_ context.Context, params map[string]string) error
Constants ¶
const ( // AnnotationKeyRevision is the revision that was fetched // from git AnnotationKeyRevision = "revision" )
const ConfigFieldTimeout = "fetch-timeout"
ConfigFieldTimeout is the configuration field name for controlling the maximum duration of a resolution request for a file from git.
const ConfigRevision = "default-revision"
ConfigRevision is the configuration field name for controlling the revision to fetch the remote resource from.
const ConfigURL = "default-url"
ConfigURL is the configuration field name for controlling the git url to fetch the remote resource from.
const GitResolverName string = "Git"
GitResolverName is the name that the git resolver should be associated with
const LabelValueGitResolverType string = "git"
LabelValueGitResolverType is the value to use for the resolution.tekton.dev/type label on resource requests
const PathParam string = "pathInRepo"
PathParam is the pathInRepo into the git repo where a file is located
const RevisionParam string = "revision"
RevisionParam is the commit hash/branch/tag that a file should be fetched from
const URLParam string = "url"
URLParam is the git repo url
const YAMLContentType string = "application/x-yaml"
YAMLContentType is the content type to use when returning yaml
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResolvedGitResource ¶
ResolvedGitResource implements framework.ResolvedResource and returns the resolved file []byte data and an annotation map for any metadata.
func (*ResolvedGitResource) Annotations ¶
func (r *ResolvedGitResource) Annotations() map[string]string
Annotations returns the metadata that accompanies the file fetched from git.
func (*ResolvedGitResource) Data ¶
func (r *ResolvedGitResource) Data() []byte
Data returns the bytes of the file resolved from git.
type Resolver ¶
type Resolver struct{}
Resolver implements a framework.Resolver that can fetch files from git.
func (*Resolver) GetConfigName ¶
GetConfigName returns the name of the git resolver's configmap.
func (*Resolver) GetName ¶
GetName returns the string name that the gitresolver should be associated with.
func (*Resolver) GetResolutionTimeout ¶
func (r *Resolver) GetResolutionTimeout(ctx context.Context, defaultTimeout time.Duration) time.Duration
GetResolutionTimeout returns a time.Duration for the amount of time a single git fetch may take. This can be configured with the fetch-timeout field in the git-resolver-config configmap.
func (*Resolver) GetSelector ¶
GetSelector returns the labels that resource requests are required to have for the gitresolver to process them.
func (*Resolver) Initialize ¶
Initialize performs any setup required by the gitresolver.