config-forker forks presubmit, periodic, and postsubmit job configs with the fork-per-release annotation.
--job-config: Path to the job config--output: Path to the output yaml to create. If not specified, the process still runs but no file is generated (potentially useful for presubmits)--version: the version to generate a forked config for, e.g.1.15
fork-per-release: only jobs with this set to"true"will be forked.fork-per-release-replacements: allows replacing values in jobtags(periodics only) and containerargs(see Custom replacements).fork-per-release-deletions: allows deleting values in joblabelsin periodics (see Custom deletions).fork-per-release-periodic-interval: if set, forked jobs will use this value forinterval. If multiple space-separated values are provided, the first will be used.fork-per-release-cron: if set, forked jobs will use this value forcron. If multiple values separated with,are provided, the first will be used.
For the sake of clarity, all the below will assume we are forking with --version 1.15.
Only jobs annotated with fork-per-release will be forked.
For all jobs:
- If
specincludes a container with animageending in-master, it is replaced with-1.15. - If
specincludes a container with anenvvariable withBRANCH(case-insensitive) in the name and the valuemaster, the value will be changed torelease-1.15. - If the
fork-per-release-replacementsannotation is specified, those replacements will be performed in theargsof all containers for that job. - If the
testgrid-dashboardsannotation is specified, references tomaster-blockingandmaster-informingare changed to1.15-blockingand1.15-informing. - If the
testgrid-tab-nameannotation is specified, references tomasterare changed to1.15. - If the
descriptionannotation is specified, it is removed (for now).
For presubmits only:
- If
namehas no-masterending, then-1.15will be appended. - If
namehas a-masterending, it is replaced with1.15. - If
contextis unset andnamehas no-masterending, it will be set to the originalnamewithout appending-1.15. - If
contextis unset andnamehas a-masterending, it will be set to thename, including the-1.15suffix. - If
contextis set and it has a-masterending, it is replaced with-1.15. - If
contextis set and it has no-masterending, it will be taken over unmodified.
The context is modified in a way to report the same context name on different branches if -master was not included
in the original context. If -master was included (either in an explicit context value, or inferred from the job name),
it gets added to the context.
For presubmits and postsubmits:
skip_brancheswill be deletedbrancheswill be set torelease-1.15
For periodics and postsubmits:
- If the job
nameends in-master, it will be replaced with-1-15, otherwise-1-15will be appended sig-release-1.15-allis added to the job'stestgrid-dashboardsannotation (creating the annotation if necessary)
For periodics only:
- If
decorateistrue, andextra_refscontains a reference tokubernetes/kubernetesmaster, theBaseRefwill be updated torelease-1.15 - If
decorateis not true, some bootstrap-relatedargswill be replaced:--repo=k8s.io/kubernetesor--repo=k8s.io/kubernetes=masterwill be replaced with--repo=k8s.io/kubernetes=release-1.15--branch=masterwill be replaced with--branch=release-1.15
- If the
fork-per-release-periodic-intervalannotation is set, theintervalwill be set to the first value it contains.
The fork-per-release-replacements annotation can be used for custom replacements in your args or tags (periodic jobs only).
It takes the form of a comma-separated list of replacements, like this:
fork-per-release-replacements: "original1 -> replacement1, original2 -> replacement2"
The replacements are interpreted as Go templates, with one value defined: {{.Version}}. {{.Version}} will be replaced
by the version currently being forked (e.g. 1.15). For example:
fork-per-release-replacements: "--version=stable -> --version={{.Version}"
The fork-per-release-deletions annotation can be used for custom deletions in your labels (periodic jobs only).
This is a comma-separated list of keys of labels you would like to remove on forking, for instance:
fork-per-release-deletions: "label-key-to-delete1, label-key-to-delete2"
This is useful for getting rid of a specific preset in the forked job. For instance, one can have a master branch job that has a label corresponding to a master-specific preset which is undesired for forked release jobs.