Documentation ¶
Index ¶
- Constants
- Variables
- func Append(dest, part *prowconfig.JobConfig)
- func ExactlyBranch(branch string) string
- func FeatureBranch(branch string) string
- func IsGenerated(job prowconfig.JobBase, generator Generator) (bool, error)
- func MakeRegexFilenameLabel(possibleRegex string) string
- func OperateOnJobConfigDir(configDir string, knownInfraJobFiles sets.Set[string], ...) error
- func OperateOnJobConfigSubdir(configDir, subDir string, knownInfraJobFiles sets.Set[string], ...) error
- func OperateOnJobConfigSubdirPaths(configDir, subDir string, knownInfraJobFiles sets.Set[string], ...) error
- func Prune(jobConfig *prowconfig.JobConfig, generator Generator, pruneLabels labels.Set) (*prowconfig.JobConfig, error)
- func ReadFromDir(dir string) (*prowconfig.JobConfig, error)
- func WriteToDir(jobDir, org, repo string, jobConfig *prowconfig.JobConfig, generator Generator, ...) error
- func WriteToFile(path string, jobConfig *prowconfig.JobConfig) error
- type Generator
- type Info
Constants ¶
const ( CanBeRehearsedLabel = "pj-rehearse.openshift.io/can-be-rehearsed" CanBeRehearsedValue = "true" SSHBastionLabel = "dptp.openshift.io/ssh-bastion" ProwJobLabelVariant = "ci-operator.openshift.io/variant" ReleaseControllerLabel = "ci-operator.openshift.io/release-controller" LabelBuildFarm = "ci.openshift.io/build-farm" LabelGenerator = "ci.openshift.io/generator" ReleaseControllerValue = "true" JobReleaseKey = "job-release" PresubmitPrefix = "pull" PostsubmitPrefix = "branch" PeriodicPrefix = "periodic" )
Variables ¶
var SimpleBranchRegexp = regexp.MustCompile(`^[\w\-.]+$`)
SimpleBranchRegexp matches a branch name that does not appear to be a regex (lacks wildcard, group, or other modifiers). For instance, `master` is considered simple, `master-.*` would not.
Functions ¶
func Append ¶
func Append(dest, part *prowconfig.JobConfig)
Append merges job configuration from part into dest Jobs are assumed to not overlap.
func ExactlyBranch ¶
ExactlyBranch returns a regex string that matches exactly the given branch name: I.e. returns '^master$' for 'master'. If the given branch name already looks like a regex, return it unchanged.
func FeatureBranch ¶
FeatureBranch returns a regex string that matches feature branch prefixes for the given branch name: I.e. returns '^master-' for 'master'. If the given branch name already looks like a regex, return it unchanged.
func IsGenerated ¶
func IsGenerated(job prowconfig.JobBase, generator Generator) (bool, error)
IsGenerated returns true if the job was generated by the provided Generator
func MakeRegexFilenameLabel ¶
func OperateOnJobConfigDir ¶
func Prune ¶
func Prune(jobConfig *prowconfig.JobConfig, generator Generator, pruneLabels labels.Set) (*prowconfig.JobConfig, error)
Prune removes all generated jobs of the supplied Generator with values that are NOT newly-generated. Prune() returns the resulting job config (which may even be completely empty).
func ReadFromDir ¶
func ReadFromDir(dir string) (*prowconfig.JobConfig, error)
ReadFromDir reads Prow job config from a directory and merges into one config
func WriteToDir ¶
func WriteToDir(jobDir, org, repo string, jobConfig *prowconfig.JobConfig, generator Generator, matchLabels labels.Set) error
WriteToDir takes a JobConfig and a target directory, and writes the Prow job configuration into files in that directory. Jobs are sharded by branch and by type. If target files already exist and contain Prow job configuration, the jobs will be merged. Jobs will be pruned based on the provided Generator that match the matchLabels set
func WriteToFile ¶
func WriteToFile(path string, jobConfig *prowconfig.JobConfig) error
WriteToFile writes Prow job config to a YAML file
Types ¶
type Info ¶
type Info struct { Org string Repo string Branch string // Type is the type of ProwJob contained in this file Type string // Filename is the full path to the file on disk Filename string }
Info describes the metadata for a Prow job configuration file
func (*Info) ConfigMapName ¶
ConfigMapName returns the configmap in which we expect this file to be uploaded