git

package
v0.0.0-...-4fc8c9b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ServerURLKey is the config map key for the SCM provider URL
	ServerURLKey = "server-url"
	// SCMTypeKey is the config map key for the SCM provider type
	SCMTypeKey = "scm-type"
	// APISecretNameKey is the config map key for the token secret's name
	APISecretNameKey = "api-token-secret-name"
	// APISecretKeyKey is the config map key for the containing the token within the token secret
	APISecretKeyKey = "api-token-secret-key"
	// APISecretNamespaceKey is the config map key for the token secret's namespace
	APISecretNamespaceKey = "api-token-secret-namespace"
)
View Source
const (

	// ConfigMapName is the git resolver's config map
	ConfigMapName = "git-resolver-config"
)

Variables

View Source
var (
	// AnnotationKeyRevision is the commit hash that was fetched
	// from git
	AnnotationKeyRevision = resolution.GroupName + "/revision"

	// AnnotationKeyOrg is the org used
	AnnotationKeyOrg = resolution.GroupName + "/org"
	// AnnotationKeyRepo is the repo used
	AnnotationKeyRepo = resolution.GroupName + "/repo"
	// AnnotationKeyPath is the path used
	AnnotationKeyPath = resolution.GroupName + "/path"
	// AnnotationKeyURL is the repo URL used
	AnnotationKeyURL = resolution.GroupName + "/url"
)

Functions

This section is empty.

Types

type Resolver

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

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, origParams []pipelinev1.Param) (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(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 gitresolver.

Jump to

Keyboard shortcuts

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