git

package
v0.0.0-...-d680719 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotationKeyRevision is the revision that was fetched
	// from git
	AnnotationKeyRevision = "revision"
)
View Source
const ConfigFieldTimeout = "fetch-timeout"

ConfigFieldTimeout is the configuration field name for controlling the maximum duration of a resolution request for a file from git.

View Source
const ConfigRevision = "default-revision"

ConfigRevision is the configuration field name for controlling the revision to fetch the remote resource from.

View Source
const ConfigURL = "default-url"

ConfigURL is the configuration field name for controlling the git url to fetch the remote resource from.

View Source
const GitResolverName string = "Git"

GitResolverName is the name that the git resolver should be associated with

View Source
const LabelValueGitResolverType string = "git"

LabelValueGitResolverType is the value to use for the resolution.tekton.dev/type label on resource requests

View Source
const PathParam string = "pathInRepo"

PathParam is the pathInRepo into the git repo where a file is located

View Source
const RevisionParam string = "revision"

RevisionParam is the commit hash/branch/tag that a file should be fetched from

View Source
const URLParam string = "url"

URLParam is the git repo url

View Source
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

type ResolvedGitResource struct {
	Revision string
	Content  []byte
}

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

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 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

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

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

func (*Resolver) Initialize

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

Initialize performs any setup required by the gitresolver.

func (*Resolver) Resolve

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

Resolve performs the work of fetching a file from git given a map of parameters.

func (*Resolver) ValidateParams

func (r *Resolver) ValidateParams(_ context.Context, params map[string]string) error

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

Jump to

Keyboard shortcuts

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