"description":"AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.",
"description":"AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. Optional, the global columns for all versions. Top-level and per-version columns are mutually exclusive.",
"description":"Subresources describes the subresources for CustomResources",
"description":"Subresources describes the subresources for CustomResource Optional, the global subresources for all versions. Top-level and per-version subresources are mutually exclusive.",
"description":"Validation describes the validation methods for CustomResources",
"description":"Validation describes the validation methods for CustomResources Optional, the global validation schema for all versions. Top-level and per-version schemas are mutually exclusive.",
"description":"AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. Top-level and per-version columns are mutually exclusive. Per-version columns must not all be set to identical values (top-level columns should be used instead) This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must be explicitly set to null",
"description":"Name is the version name, e.g. “v1”, “v2beta1”, etc.",
"type":"string"
},
"schema":{
"description":"Schema describes the schema for CustomResource used in validation, pruning, and defaulting. Top-level and per-version schemas are mutually exclusive. Per-version schemas must not all be set to identical values (top-level validation schema should be used instead) This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.",
"description":"Served is a flag enabling/disabling this version from being served via REST APIs",
"type":"boolean"
...
...
@@ -92073,6 +92084,10 @@
"storage":{
"description":"Storage flags the version as storage version. There must be exactly one flagged as storage version.",
"type":"boolean"
},
"subresources":{
"description":"Subresources describes the subresources for CustomResource Top-level and per-version subresources are mutually exclusive. Per-version subresources must not all be set to identical values (top-level subresources should be used instead) This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.",
allErrs=append(allErrs,field.Forbidden(fldPath.Child("additionalPrinterColumns"),"top-level and per-version additionalPrinterColumns are mutually exclusive"))
}
// Per-version fields may not all be set to identical values (top-level field should be used instead)
ifhasIdenticalPerVersionSchema(spec.Versions){
allErrs=append(allErrs,field.Invalid(fldPath.Child("versions"),spec.Versions,"per-version schemas may not all be set to identical values (top-level validation should be used instead)"))
allErrs=append(allErrs,field.Invalid(fldPath.Child("versions"),spec.Versions,"per-version subresources may not all be set to identical values (top-level subresources should be used instead)"))
}
ifhasIdenticalPerVersionColumns(spec.Versions){
allErrs=append(allErrs,field.Invalid(fldPath.Child("versions"),spec.Versions,"per-version additionalPrinterColumns may not all be set to identical values (top-level additionalPrinterColumns should be used instead)"))
}
if!uniqueNames{
allErrs=append(allErrs,field.Invalid(fldPath.Child("versions"),spec.Versions,"must contain unique version names"))
returnnil,fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version subresources must be mutual exclusive",crd.Name,version)
}
for_,v:=rangecrd.Spec.Versions{
ifversion==v.Name{
returnv.Subresources,nil
}
}
returnnil,fmt.Errorf("version %s not found in CustomResourceDefinition: %v",version,crd.Name)
}
// getColumnsForVersion returns the columns for given version in given CRD.
// NOTE: the newly logically-defaulted columns is not pointing to the original CRD object.
// One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through
returnnil,fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version additionalPrinterColumns must be mutual exclusive",crd.Name,version)
returnnil,fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version subresources must be mutual exclusive",crd.Name,version)
}
for_,v:=rangecrd.Spec.Versions{
ifversion==v.Name{
returnv.Subresources,nil
}
}
returnnil,fmt.Errorf("version %s not found in CustomResourceDefinition: %v",version,crd.Name)
}
// getColumnsForVersion returns the columns for given version in given CRD.
// NOTE: the newly logically-defaulted columns is not pointing to the original CRD object.
// One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through
returnnil,fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version additionalPrinterColumns must be mutual exclusive",crd.Name,version)