func (o PruneImagesOptions) Validate() error {
	if o.PruneOverSizeLimit != nil && (o.KeepYoungerThan != nil || o.KeepTagRevisions != nil) {
		return fmt.Errorf("--prune-over-size-limit cannot be specified with --keep-tag-revisions nor --keep-younger-than")
	}
	if o.KeepYoungerThan != nil && *o.KeepYoungerThan < 0 {
		return fmt.Errorf("--keep-younger-than must be greater than or equal to 0")
	}
	if o.KeepTagRevisions != nil && *o.KeepTagRevisions < 0 {
		return fmt.Errorf("--keep-tag-revisions must be greater than or equal to 0")
	}
	if err := validateRegistryURL(o.RegistryUrlOverride); len(o.RegistryUrlOverride) > 0 && err != nil {
		return fmt.Errorf("invalid --registry-url flag: %v", err)
	}
	if o.ForceInsecure && len(o.CABundle) > 0 {
		return fmt.Errorf("--certificate-authority cannot be specified with --force-insecure")
	}
	if len(o.CABundle) > 0 && strings.HasPrefix(o.RegistryUrlOverride, "http://") {
		return fmt.Errorf("--cerificate-authority cannot be specified for insecure http protocol")
	}
	return nil
}
// Validate ensures that a PruneImagesOptions is valid and can be used to execute pruning.
Validate ensures that a PruneImagesOptions is valid and can be used to execute pruning.
// Validate ensures that a PruneImagesOptions is valid and can be used to execute pruning .
func (o PruneImagesOptions) Validate() error {
	if o.PruneOverSizeLimit != nil && (o.KeepYoungerThan != nil || o.KeepTagRevisions != nil) {
		return fmt.Errorf("--prune-over-size-limit cannot be specified with --keep-tag-revisions nor --keep-younger-than")
	}
	if o.KeepYoungerThan != nil && *o.KeepYoungerThan < 0 {
		return fmt.Errorf("--keep-younger-than must be greater than or equal to 0")
	}
	if o.KeepTagRevisions != nil && *o.KeepTagRevisions < 0 {
		return fmt.Errorf("--keep-tag-revisions must be greater than or equal to 0")
	}
	if err := validateRegistryURL(o.RegistryUrlOverride); len(o.RegistryUrlOverride) > 0 && err != nil {
		return fmt.Errorf("invalid --registry-url flag: %v", err)
	}
	if o.ForceInsecure && len(o.CABundle) > 0 {
		return fmt.Errorf("--certificate-authority cannot be specified with --force-insecure")
	}
	if len(o.CABundle) > 0 && strings.HasPrefix(o.RegistryUrlOverride, "http://") {
		return fmt.Errorf("--cerificate-authority cannot be specified for insecure http protocol")
	}
	return nil
}
func ( o PruneImagesOptions ) Validate ( ) error { if o . PruneOverSizeLimit != nil && ( o . KeepYoungerThan != nil || o . KeepTagRevisions != nil ) { return fmt . Errorf ( " " ) } if o . KeepYoungerThan != nil && * o . KeepYoungerThan < 0 { return fmt . Errorf ( " " ) } if o . KeepTagRevisions != nil && * o . KeepTagRevisions < 0 { return fmt . Errorf ( " " ) } if err := validateRegistryURL ( o . RegistryUrlOverride ) ; len ( o . RegistryUrlOverride ) > 0 && err != nil { return fmt . Errorf ( " " , err ) } if o . ForceInsecure && len ( o . CABundle ) > 0 { return fmt . Errorf ( " " ) } if len ( o . CABundle ) > 0 && strings . HasPrefix ( o . RegistryUrlOverride , " " ) { return fmt . Errorf ( " " ) } return nil }
Validate ensures that a PruneImagesOptions is valid and can be used to execute pruning.
Validate ensures that a PruneImagesOptions is valid and can be used to execute pruning .