prow/config/config.go
func (c *Config) validateComponentConfig() error {
	if c.Plank.JobURLPrefix != "" && c.Plank.JobURLPrefixConfig["*"] != "" {
		return errors.New(`Planks job_url_prefix must be unset when job_url_prefix_config["*"] is set. The former is deprecated, use the latter`)
	}
	for k, v := range c.Plank.JobURLPrefixConfig {
		if _, err := url.Parse(v); err != nil {
			return fmt.Errorf(`Invalid value for Planks job_url_prefix_config["%s"]: %v`, k, err)
		}
	}

	if c.SlackReporter != nil {
		if err := c.SlackReporter.DefaultAndValidate(); err != nil {
			return fmt.Errorf("failed to validate slackreporter config: %v", err)
		}
	}
	return nil
}
func (c *Config) validateComponentConfig() error {
	if c.Plank.JobURLPrefix != "" && c.Plank.JobURLPrefixConfig["*"] != "" {
		return errors.New(`Planks job_url_prefix must be unset when job_url_prefix_config["*"] is set. The former is deprecated, use the latter`)
	}
	for k, v := range c.Plank.JobURLPrefixConfig {
		if _, err := url.Parse(v); err != nil {
			return fmt.Errorf(`Invalid value for Planks job_url_prefix_config["%s"]: %v`, k, err)
		}
	}

	if c.SlackReporter != nil {
		if err := c.SlackReporter.DefaultAndValidate(); err != nil {
			return fmt.Errorf("failed to validate slackreporter config: %v", err)
		}
	}
	return nil
}
func ( c * Config ) validateComponentConfig ( ) error { if c . Plank . JobURLPrefix != " " && c . Plank . JobURLPrefixConfig [ " " ] != " " { return errors . New ( `Planks job_url_prefix must be unset when job_url_prefix_config["*"] is set. The former is deprecated, use the latter` ) } for k , v := range c . Plank . JobURLPrefixConfig { if _ , err := url . Parse ( v ) ; err != nil { return fmt . Errorf ( `Invalid value for Planks job_url_prefix_config["%s"]: %v` , k , err ) } } if c . SlackReporter != nil { if err := c . SlackReporter . DefaultAndValidate ( ) ; err != nil { return fmt . Errorf ( " " , err ) } } return nil }
// validateComponentConfig validates the infrastructure component configuration
validateComponentConfig validates the infrastructure component configuration