prow/apis/prowjobs/v1/types.go
func (d *DecorationConfig) Validate() error {
	if d.UtilityImages == nil {
		return errors.New("utility image config is not specified")
	}
	var missing []string
	if d.UtilityImages.CloneRefs == "" {
		missing = append(missing, "clonerefs")
	}
	if d.UtilityImages.InitUpload == "" {
		missing = append(missing, "initupload")
	}
	if d.UtilityImages.Entrypoint == "" {
		missing = append(missing, "entrypoint")
	}
	if d.UtilityImages.Sidecar == "" {
		missing = append(missing, "sidecar")
	}
	if len(missing) > 0 {
		return fmt.Errorf("the following utility images are not specified: %q", missing)
	}

	if d.GCSConfiguration == nil {
		return errors.New("GCS upload configuration is not specified")
	}
	if d.GCSCredentialsSecret == "" {
		return errors.New("GCS upload credential secret is not specified")
	}
	if err := d.GCSConfiguration.Validate(); err != nil {
		return fmt.Errorf("GCS configuration is invalid: %v", err)
	}
	return nil
}
func (d *DecorationConfig) Validate() error {
	if d.UtilityImages == nil {
		return errors.New("utility image config is not specified")
	}
	var missing []string
	if d.UtilityImages.CloneRefs == "" {
		missing = append(missing, "clonerefs")
	}
	if d.UtilityImages.InitUpload == "" {
		missing = append(missing, "initupload")
	}
	if d.UtilityImages.Entrypoint == "" {
		missing = append(missing, "entrypoint")
	}
	if d.UtilityImages.Sidecar == "" {
		missing = append(missing, "sidecar")
	}
	if len(missing) > 0 {
		return fmt.Errorf("the following utility images are not specified: %q", missing)
	}

	if d.GCSConfiguration == nil {
		return errors.New("GCS upload configuration is not specified")
	}
	if d.GCSCredentialsSecret == "" {
		return errors.New("GCS upload credential secret is not specified")
	}
	if err := d.GCSConfiguration.Validate(); err != nil {
		return fmt.Errorf("GCS configuration is invalid: %v", err)
	}
	return nil
}
func ( d * DecorationConfig ) Validate ( ) error { if d . UtilityImages == nil { return errors . New ( " " ) } var missing [ ] string if d . UtilityImages . CloneRefs == " " { missing = append ( missing , " " ) } if d . UtilityImages . InitUpload == " " { missing = append ( missing , " " ) } if d . UtilityImages . Entrypoint == " " { missing = append ( missing , " " ) } if d . UtilityImages . Sidecar == " " { missing = append ( missing , " " ) } if len ( missing ) > 0 { return fmt . Errorf ( " " , missing ) } if d . GCSConfiguration == nil { return errors . New ( " " ) } if d . GCSCredentialsSecret == " " { return errors . New ( " " ) } if err := d . GCSConfiguration . Validate ( ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
// Validate ensures all the values set in the DecorationConfig are valid.
Validate ensures all the values set in the DecorationConfig are valid .