pipelinescheduler

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAgent is the default agent vaule
	DefaultAgent = "tekton"
	// DefaultMergeType is the default merge type
	DefaultMergeType = "merge"
)

Variables

This section is empty.

Functions

func ApplyDirectly

func ApplyDirectly(kubeClient kubernetes.Interface, namespace string, cfg *config.Config,
	plugs *plugins.Configuration) error

ApplyDirectly directly applies the prow config to the cluster

func Build

Build combines the slice of schedulers into one, with the most specific schedule config defined last

func BuildProwConfig

func BuildProwConfig(schedulers []*SchedulerLeaf) (*config.Config, *plugins.Configuration,
	error)

BuildProwConfig takes a list of schedulers and creates a Prow Config from it

func BuildSchedulers

func BuildSchedulers(prowConfig *config.Config, pluginConfig *plugins.Configuration) ([]*jenkinsv1.SourceRepository, map[string]*jenkinsv1.SourceRepository, map[string]*schedulerapi.Scheduler, error)

BuildSchedulers turns prow config in to schedulers

func FindSourceRepository

func FindSourceRepository(jxClient versioned.Interface, ns string, owner string, name string, providerName string) (*v1.SourceRepository, error)

FindSourceRepository returns a SourceRepository for the given namespace, owner, repo name, and (optional) provider name. If no SourceRepository is found, return nil.

func FindSourceRepositoryWithoutProvider

func FindSourceRepositoryWithoutProvider(jxClient versioned.Interface, ns string, owner string, name string) (*v1.SourceRepository, error)

FindSourceRepositoryWithoutProvider returns a SourceRepository for the given namespace, owner and repo name. If no SourceRepository is found, return nil.

func GenerateProw

func GenerateProw(gitOps bool, autoApplyConfigUpdater bool, jxClient versioned.Interface, namespace string, teamSchedulerName string, devEnv *jenkinsv1.Environment, loadSchedulerResourcesFunc func(versioned.Interface, string) (map[string]*schedulerapi.Scheduler, *jenkinsv1.SourceRepositoryList, error)) (*config.Config,
	*plugins.Configuration, error)

GenerateProw will generate the prow config for the namespace

func GetOrCreateSourceRepository

func GetOrCreateSourceRepository(jxClient versioned.Interface, ns string, name, organisation, providerURL string) (*v1.SourceRepository, error)

GetOrCreateSourceRepository gets or creates the SourceRepository for the given repository name and organisation

func GetOrCreateSourceRepositoryCallback

func GetOrCreateSourceRepositoryCallback(jxClient versioned.Interface, ns string, name, organisation, providerURL string, callback func(*v1.SourceRepository)) (*v1.SourceRepository, error)

GetOrCreateSourceRepositoryCallback gets or creates the SourceRepository for the given repository name and organisation invoking the given callback to modify the resource before create/udpate

func GetRepositoryGitURL

func GetRepositoryGitURL(s *v1.SourceRepository) (string, error)

GetRepositoryGitURL returns the git repository clone URL

func IsIncludedInTheGivenEnvs

func IsIncludedInTheGivenEnvs(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool

IsIncludedInTheGivenEnvs returns true if the given repository is an environment repository

func IsRemoteEnvironmentRepository

func IsRemoteEnvironmentRepository(environments map[string]*v1.Environment, repository *v1.SourceRepository) bool

IsRemoteEnvironmentRepository returns true if the given repository is a remote environment

func ToProviderName

func ToProviderName(gitURL string) string

ToProviderName takes the git URL and converts it to a provider name which can be used as a label selector

Types

type DefaultOwnersDirBlacklist

type DefaultOwnersDirBlacklist struct {
	// Blacklist configures a default blacklist for repos (or orgs) not
	// specifically configured
	Blacklist []string `json:"default"`
}

DefaultOwnersDirBlacklist is the default blacklist

type GarbageCollection

type GarbageCollection struct {
	// Interval is how often a Garbage Collection will be performed. Defaults to one hour.
	Interval time.Duration `json:"-"`
	// PipelineAge is how old a Pipeline can be before it is garbage-collected.
	// Defaults to one week.
	PipelineAge time.Duration `json:"-"`
	// PodAge is how old a Pod can be before it is garbage-collected.
	// Defaults to one day.
	PodAge time.Duration `json:"-"`
}

GarbageCollection defines the configuration for cleaning up pipeline related resources

type Heart

type Heart struct {
	// Adorees is a list of GitHub logins for members
	// for whom we will add emojis to comments
	Adorees []string `json:"adorees,omitempty"`
	// CommentRegexp is the regular expression for comments
	// made by adorees that the plugin adds emojis to.
	// If not specified, the plugin will not add emojis to
	// any comments.
	// Compiles into CommentRe during config load.
	CommentRegexp string `json:"commentregexp,omitempty"`
}

Heart contains the configuration for adding emojis

type Owners

type Owners struct {
	// SkipCollaborators disables collaborator cross-checks and forces both
	// the approve and lgtm plugins to use solely OWNERS files for access
	// control in the provided repos.
	SkipCollaborators []string `json:"skip_collaborators,omitempty"`

	// LabelsBlackList holds a list of labels that should not be present in any
	// OWNERS file, preventing their automatic addition by the owners-label plugin.
	// This check is performed by the verify-owners plugin.
	LabelsBlackList []string `json:"labels_blacklist,omitempty"`
}

Owners contains configuration related to handling OWNERS files.

type ProwConfig

type ProwConfig struct {
	Reviewers Reviewers `yaml:"blunderbuss,omitempty"`
	Owners    Owners    `json:"owners,omitempty"`
	// DefaultNamespace defines the namespace to run the jobs, by default the team namespace
	DefaultNamespace string `yaml:"jobNamespace,omitempty"`
	// TODO PushGateway
	DefaultOwnersDirBlacklist DefaultOwnersDirBlacklist `yaml:"defaultOwnersDirBlacklist,omitempty"`
	GarbageCollection         GarbageCollection         `yaml:"garbageCollection,omitempty"`
	Heart                     Heart                     `yaml:"heart,omitempty"`
}

ProwConfig is the SchedulerSpec config that relates explicitly to Prow

type Reviewers

type Reviewers struct {
	// ReviewerCount is the minimum number of reviewers to request
	// reviews from. Defaults to requesting reviews from 2 reviewers
	// if FileWeightCount is not set.
	ReviewerCount *int `json:"request_count,omitempty"`
	// MaxReviewerCount is the maximum number of reviewers to request
	// reviews from. Defaults to 0 meaning no limit.
	MaxReviewerCount int `json:"max_request_count,omitempty"`
	// FileWeightCount is the maximum number of reviewers to request
	// reviews from. Selects reviewers based on file weighting.
	// This and request_count are mutually exclusive options.
	FileWeightCount *int `json:"file_weight_count,omitempty"`
	// ExcludeApprovers controls whether approvers are considered to be
	// reviewers. By default, approvers are considered as reviewers if
	// insufficient reviewers are available. If ExcludeApprovers is true,
	// approvers will never be considered as reviewers.
	ExcludeApprovers bool `json:"exclude_approvers,omitempty"`
}

Reviewers defines configuration for PR review

type SchedulerLeaf

type SchedulerLeaf struct {
	*schedulerapi.SchedulerSpec
	Org  string
	Repo string
}

SchedulerLeaf defines a pipeline scheduler leaf

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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