pipelinescheduler

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 35 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 ApplySchedulersDirectly

func ApplySchedulersDirectly(jxClient versioned.Interface, namespace string, sourceRepositoryGroups []*jenkinsv1.SourceRepositoryGroup, sourceRepositories []*jenkinsv1.SourceRepository, schedulers map[string]*jenkinsv1.Scheduler, devEnv *jenkinsv1.Environment) error

ApplySchedulersDirectly directly applies pipeline schedulers to the cluster

func Build

func Build(schedulers []*jenkinsv1.SchedulerSpec) (*jenkinsv1.SchedulerSpec, error)

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

BuildSchedulers turns prow config in to schedulers

func CreateSchedulersFromProwConfig

func CreateSchedulersFromProwConfig(configFileLocation string, pluginsFileLocation string, skipVerification bool, dryRun bool, gitOps bool, jxClient versioned.Interface, kubeClient kubernetes.Interface, namespace string, teamSchedulerName string, devEnv *jenkinsv1.Environment) ([]*jenkinsv1.SourceRepositoryGroup, []*jenkinsv1.SourceRepository, map[string]*jenkinsv1.Scheduler, error)

CreateSchedulersFromProwConfig will generate Pipeline Schedulers from the prow configmaps in the specified namespace or the config and plugins files specified as an option

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]*jenkinsv1.Scheduler, *jenkinsv1.SourceRepositoryGroupList, *jenkinsv1.SourceRepositoryList, error)) (*config.Config,
	*plugins.Configuration, error)

GenerateProw will generate the prow config for the namespace

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 GitOpsOptions

type GitOpsOptions struct {
	Gitter              gits.Gitter
	Verbose             bool
	Helmer              helm.Helmer
	GitProvider         gits.GitProvider
	DevEnv              *jenkinsv1.Environment
	PullRequestCloneDir string
}

GitOpsOptions are options for running AddToEnvironmentRepo

func (*GitOpsOptions) AddSchedulersToEnvironmentRepo

func (o *GitOpsOptions) AddSchedulersToEnvironmentRepo(sourceRepositoryGroups []*jenkinsv1.SourceRepositoryGroup, sourceRepositories []*jenkinsv1.SourceRepository, schedulers map[string]*jenkinsv1.Scheduler) error

AddSchedulersToEnvironmentRepo adds the prow config to the gitops environment repo

func (*GitOpsOptions) AddToEnvironmentRepo

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

AddToEnvironmentRepo adds the prow config to the gitops environment repo

func (*GitOpsOptions) RegisterProwConfigUpdater

func (o *GitOpsOptions) RegisterProwConfigUpdater(kubeClient kubernetes.Interface, namespace string) error

RegisterProwConfigUpdater Register the config updater in the plugin configmap

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 {
	*jenkinsv1.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