Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigMapName(path string, updater plugins.ConfigUpdater) (name, pattern string, err error)
- func GetAddedConfigs(path, baseRev string) ([]string, error)
- func GetChangedRegistrySteps(path, baseRev string, graph registry.NodeByName) ([]registry.Node, error)
- func GetChangedTemplates(path, baseRev string) ([]string, error)
- func LoadProwConfig(releaseRepo string) (*prowconfig.Config, error)
- func LoggerForInfo(info Info) *logrus.Entry
- func NewLocalJobSpec(path string) (*pjdwapi.JobSpec, error)
- func OperateOnCIOperatorConfig(path string, callback ConfigIterFunc) error
- func OperateOnCIOperatorConfigDir(configDir string, callback ConfigIterFunc) error
- func OperateOnCIOperatorConfigPaths(path string, callback InfoIterFunc) error
- func OperateOnCIOperatorConfigSubdir(configDir, subDir string, callback ConfigIterFunc) error
- func ProwConfigForOrgRepo(releaseRepo, org, repo string) string
- type ByFilename
- type ByOrgRepo
- type ConfigIterFunc
- type ConfirmableOptions
- type DataByFilename
- type DataWithInfo
- type Info
- type InfoIterFunc
- type Options
- func (o *Options) Bind(fs *flag.FlagSet)
- func (o *Options) Complete() error
- func (o *Options) OperateOnCIOperatorConfigDir(configDir string, ...) error
- func (o *Options) OperateOnJobConfigSubdirPaths(dir, subDir string, knownInfraJobFiles sets.Set[string], ...) error
- func (o *Options) ProcessAll() bool
- func (o *Options) Validate() error
- type Periodics
- type Presubmits
- type Prowgen
- type Rehearsals
- type ReleaseRepoConfig
- type SlackReporterConfig
- type SourceType
- type WhitelistConfig
- type WhitelistOptions
Constants ¶
const ( // ConfigInRepoPath is the prow config path from release repo ConfigInRepoPath = "core-services/prow/02_config/_config.yaml" // ProwConfigFile is the filename where Prow config lives ProwConfigFile = "_config.yaml" // SupplementalProwConfigFileName is the name of supplemental prow config files. SupplementalProwConfigFileName = "_prowconfig.yaml" // SupplementalPluginConfigFileName is the name of supplemental plugin config // files. SupplementalPluginConfigFileName = "_pluginconfig.yaml" // PluginConfigFile is the filename where plugins live PluginConfigFile = "_plugins.yaml" // PluginConfigInRepoPath is the prow plugin config path from release repo PluginConfigInRepoPath = "core-services/prow/02_config/" + PluginConfigFile // JobConfigInRepoPath is the prowjobs path from release repo JobConfigInRepoPath = "ci-operator/jobs" // CiopConfigInRepoPath is the ci-operator config path from release repo CiopConfigInRepoPath = "ci-operator/config" // TemplatesPath is the path of the templates from release repo TemplatesPath = "ci-operator/templates" // StagingNamespace is the staging namespace in api.ci StagingNamespace = "ci-stg" // RegistryPath is the path to the multistage step registry RegistryPath = "ci-operator/step-registry" )
Variables ¶
var ( SourceTypeLabel string = "pj-rehearse.openshift.io/source-type" ChangedPresubmit SourceType = "changedPresubmit" ChangedPeriodic SourceType = "changedPeriodic" ChangedCiopConfig SourceType = "changedCiopConfig" ChangedClusterProfile SourceType = "changedClusterProfile" ChangedTemplate SourceType = "changedTemplate" ChangedRegistryContent SourceType = "changedRegistryContent" Unknown SourceType = "unknownSource" )
var ProwgenFile = ".config.prowgen"
ProwgenFile is the name of prowgen's configuration file.
Functions ¶
func ConfigMapName ¶
func ConfigMapName(path string, updater plugins.ConfigUpdater) (name, pattern string, err error)
ConfigMapName returns the name of the ConfigMap to which config-updater would put the content, and the config-updater config pattern that covers the path of the ConfigMap source.
func GetAddedConfigs ¶
func GetChangedRegistrySteps ¶
func GetChangedRegistrySteps(path, baseRev string, graph registry.NodeByName) ([]registry.Node, error)
GetChangedRegistrySteps identifies all registry components that changed.
func GetChangedTemplates ¶
func LoadProwConfig ¶
func LoadProwConfig(releaseRepo string) (*prowconfig.Config, error)
LoadProwConfig loads Prow configuration from the release repo
func LoggerForInfo ¶
func NewLocalJobSpec ¶
NewLocalJobSpec creates a fake JobSpec based on information extracted from the local git repository to simulate a CI job.
func OperateOnCIOperatorConfig ¶
func OperateOnCIOperatorConfig(path string, callback ConfigIterFunc) error
OperateOnCIOperatorConfig runs the callback on the parsed data from the CI Operator configuration file provided
func OperateOnCIOperatorConfigDir ¶
func OperateOnCIOperatorConfigDir(configDir string, callback ConfigIterFunc) error
OperateOnCIOperatorConfigDir runs the callback on all CI Operator configuration files found while walking the directory provided
func OperateOnCIOperatorConfigPaths ¶
func OperateOnCIOperatorConfigPaths(path string, callback InfoIterFunc) error
func OperateOnCIOperatorConfigSubdir ¶
func OperateOnCIOperatorConfigSubdir(configDir, subDir string, callback ConfigIterFunc) error
func ProwConfigForOrgRepo ¶
ProwConfigForOrgRepo returns the Prow configuration file for the org/repo
Types ¶
type ByFilename ¶
type ByFilename map[string]cioperatorapi.ReleaseBuildConfiguration
ByFilename stores CI Operator configurations with their metadata by filename
func LoadByFilename ¶
func LoadByFilename(path string) (ByFilename, error)
type ByOrgRepo ¶
type ByOrgRepo map[string]map[string][]cioperatorapi.ReleaseBuildConfiguration
ByOrgRepo maps org --> repo --> list of branched and variant configs
func LoadByOrgRepo ¶
type ConfigIterFunc ¶
type ConfigIterFunc func(*cioperatorapi.ReleaseBuildConfiguration, *Info) error
type ConfirmableOptions ¶
func (*ConfirmableOptions) Bind ¶
func (o *ConfirmableOptions) Bind(fs *flag.FlagSet)
func (*ConfirmableOptions) Validate ¶
func (o *ConfirmableOptions) Validate() error
type DataByFilename ¶
type DataByFilename map[string]DataWithInfo
DataByFilename stores CI Operator configurations with their metadata by filename
func LoadDataByFilename ¶
func LoadDataByFilename(path string) (DataByFilename, error)
type DataWithInfo ¶
type DataWithInfo struct { Configuration cioperatorapi.ReleaseBuildConfiguration Info Info }
DataWithInfo wraps a CI Operator configuration and metadata for it
func (*DataWithInfo) CommitTo ¶
func (i *DataWithInfo) CommitTo(dir string) error
func (*DataWithInfo) Logger ¶
func (i *DataWithInfo) Logger() *logrus.Entry
type Info ¶
type Info struct { cioperatorapi.Metadata // Filename is the full path to the file on disk Filename string // OrgPath is the full path to the directory containing config for the org OrgPath string // RepoPath is the full path to the directory containing config for the repo RepoPath string }
Info describes the metadata for a CI Operator configuration file along with where it's loaded from
func InfoFromPath ¶
We use the directory/file naming convention to encode useful information about component repository information. The convention for ci-operator config files in this repo: ci-operator/config/ORGANIZATION/COMPONENT/ORGANIZATION-COMPONENT-BRANCH.yaml
type InfoIterFunc ¶
type Options ¶
type Options struct { ConfigDir string Org string Repo string LogLevel string // contains filtered or unexported fields }
Options holds options to load CI Operator configuration and select a subset of that configuration to operate on. Configurations can be filtered by --org, --repo, or both.
func (*Options) OperateOnCIOperatorConfigDir ¶
func (o *Options) OperateOnCIOperatorConfigDir(configDir string, callback func(*cioperatorapi.ReleaseBuildConfiguration, *Info) error) error
OperateOnCIOperatorConfigDir filters the full set of configurations down to those that were selected by the user with --{org|repo}
func (*Options) OperateOnJobConfigSubdirPaths ¶
func (o *Options) OperateOnJobConfigSubdirPaths(dir, subDir string, knownInfraJobFiles sets.Set[string], callback func(info *jc.Info) error) error
OperateOnJobConfigSubdirPaths filters the full set of configurations down to those that were selected by the user with --{org|repo}
func (*Options) ProcessAll ¶
type Periodics ¶
type Periodics map[string]prowconfig.Periodic
func (Periodics) Add ¶
func (p Periodics) Add(job prowconfig.Periodic, sourceType SourceType)
Add adds a job from a different instance. The method assumes two jobs with a matching name are identical, so if a periodic with a given name already exists, it is overridden.
func (Periodics) AddAll ¶
func (p Periodics) AddAll(jobs Periodics, sourceType SourceType)
AddAll adds all jobs from a different instance. The method assumes two jobs with a matching name are identical, so if a periodic with a given name already exists, it is overridden.
type Presubmits ¶
type Presubmits map[string][]prowconfig.Presubmit
func (Presubmits) Add ¶
func (p Presubmits) Add(repo string, job prowconfig.Presubmit, sourceType SourceType)
Add a presubmit for a given repo. The method assumes two jobs with a matching name are identical, so if a presubmit with a given name already exists, it is kept as is.
func (Presubmits) AddAll ¶
func (p Presubmits) AddAll(jobs Presubmits, sourceType SourceType)
AddAll adds all jobs from a different instance. The method assumes two jobs with a matching name for the same repository are identical, so if a presubmit with a given name already exists, it is kept as is.
type Prowgen ¶
type Prowgen struct { // Private indicates that generated jobs should be marked as hidden // from display in deck and that they should mount appropriate git credentials // to clone the repository under test. Private bool `json:"private,omitempty"` // Expose declares that jobs should not be hidden from view in deck if they // are private. // This field has no effect if private is not set. Expose bool `json:"expose,omitempty"` // Rehearsals declares any disabled rehearsals for jobs Rehearsals Rehearsals `json:"rehearsals,omitempty"` // SlackReporterConfigs defines all desired slack reporter info for included jobs SlackReporterConfigs []SlackReporterConfig `json:"slack_reporter,omitempty"` }
Prowgen holds the information of the prowgen's configuration file.
func LoadProwgenConfig ¶
func (*Prowgen) GetSlackReporterConfigForTest ¶
func (p *Prowgen) GetSlackReporterConfigForTest(test, variant string) *SlackReporterConfig
func (*Prowgen) MergeDefaults ¶
type Rehearsals ¶
type Rehearsals struct { // DisableAll indicates that all jobs will not have their "can-be-rehearsed" label set // and therefore will not be picked up for rehearsals. DisableAll bool `json:"disable_all,omitempty"` // DisabledRehearsals contains a list of jobs that will not have their "can-be-rehearsed" label set // and therefore will not be picked up for rehearsals. DisabledRehearsals []string `json:"disabled_rehearsals,omitempty"` }
type ReleaseRepoConfig ¶
type ReleaseRepoConfig struct { Prow *prowconfig.Config CiOperator DataByFilename }
ReleaseRepoConfig contains all configuration present in release repo (usually openshift/release)
func GetAllConfigs ¶
func GetAllConfigs(releaseRepoPath string) (*ReleaseRepoConfig, error)
GetAllConfigs loads all configuration from the working copy of the release repo (usually openshift/release). When an error occurs during some config loading, the error will be propagated, however the returned struct field will also have a nil value in the appropriate field.
func GetAllConfigsFromSHA ¶
func GetAllConfigsFromSHA(releaseRepoPath, sha string) (*ReleaseRepoConfig, error)
GetAllConfigsFromSHA loads all configuration from given SHA revision of the release repo (usually openshift/release). This method checks out the given revision before the configuration is loaded, and then checks out back the saved revision that was checked out in the working copy when this method was called. Errors occurred during these git manipulations are propagated in the error return value. Errors occurred during the actual config loading are not propagated, but the returned struct field will have a nil value in the appropriate field. The error is only logged.
type SlackReporterConfig ¶
type SlackReporterConfig struct { Channel string `json:"channel,omitempty"` JobStatesToReport []prowv1.ProwJobState `json:"job_states_to_report,omitempty"` ReportTemplate string `json:"report_template,omitempty"` JobNames []string `json:"job_names,omitempty"` // ExcludedVariants lists job variants that this config will not apply to ExcludedVariants []string `json:"excluded_variants,omitempty"` }
SlackReporterConfig groups test names to a channel to report; mimicking Prow's version, with some unnecessary fields removed
type SourceType ¶
type SourceType string
func GetSourceType ¶
func GetSourceType(labels map[string]string) SourceType
func (SourceType) GetDisplayText ¶
func (sourceType SourceType) GetDisplayText() string
type WhitelistConfig ¶
WhitelistConfig holds a list of repositories mapped by organization
func (*WhitelistConfig) IsWhitelisted ¶
func (w *WhitelistConfig) IsWhitelisted(info *Info) bool
type WhitelistOptions ¶
type WhitelistOptions struct { WhitelistConfig WhitelistConfig // contains filtered or unexported fields }
WhitelistOptions holds the required flags to load the whitelist configuration
func (*WhitelistOptions) Bind ¶
func (o *WhitelistOptions) Bind(fs *flag.FlagSet)
func (*WhitelistOptions) Validate ¶
func (o *WhitelistOptions) Validate() error
Validate validates if the whitelist cofiguration file actual exists.