69
vendor/sigs.k8s.io/controller-tools/pkg/crd/gen.go
generated
vendored
69
vendor/sigs.k8s.io/controller-tools/pkg/crd/gen.go
generated
vendored
@@ -84,6 +84,9 @@ type Generator struct {
|
||||
// You'll need to use "v1" to get support for features like defaulting,
|
||||
// along with an API server that supports it (Kubernetes 1.16+).
|
||||
CRDVersions []string `marker:"crdVersions,optional"`
|
||||
|
||||
// GenerateEmbeddedObjectMeta specifies if any embedded ObjectMeta in the CRD should be generated
|
||||
GenerateEmbeddedObjectMeta *bool `marker:",optional"`
|
||||
}
|
||||
|
||||
func (Generator) CheckFilter() loader.NodeFilter {
|
||||
@@ -98,6 +101,8 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error {
|
||||
Checker: ctx.Checker,
|
||||
// Perform defaulting here to avoid ambiguity later
|
||||
AllowDangerousTypes: g.AllowDangerousTypes != nil && *g.AllowDangerousTypes == true,
|
||||
// Indicates the parser on whether to register the ObjectMeta type or not
|
||||
GenerateEmbeddedObjectMeta: g.GenerateEmbeddedObjectMeta != nil && *g.GenerateEmbeddedObjectMeta == true,
|
||||
}
|
||||
|
||||
AddKnownTypes(parser)
|
||||
@@ -129,6 +134,9 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error {
|
||||
crdRaw := parser.CustomResourceDefinitions[groupKind]
|
||||
addAttribution(&crdRaw)
|
||||
|
||||
// Prevent the top level metadata for the CRD to be generate regardless of the intention in the arguments
|
||||
FixTopLevelMetadata(crdRaw)
|
||||
|
||||
versionedCRDs := make([]interface{}, len(crdVersions))
|
||||
for i, ver := range crdVersions {
|
||||
conv, err := AsVersion(crdRaw, schema.GroupVersion{Group: apiext.SchemeGroupVersion.Group, Version: ver})
|
||||
@@ -161,10 +169,14 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error {
|
||||
}
|
||||
|
||||
for i, crd := range versionedCRDs {
|
||||
// defaults are not allowed to be specified in v1beta1 CRDs, so strip them
|
||||
// before writing to a file
|
||||
// defaults are not allowed to be specified in v1beta1 CRDs and
|
||||
// decriptions are not allowed on the metadata regardless of version
|
||||
// strip them before writing to a file
|
||||
if crdVersions[i] == "v1beta1" {
|
||||
removeDefaultsFromSchemas(crd.(*apiextlegacy.CustomResourceDefinition))
|
||||
removeDescriptionFromMetadataLegacy(crd.(*apiextlegacy.CustomResourceDefinition))
|
||||
} else {
|
||||
removeDescriptionFromMetadata(crd.(*apiext.CustomResourceDefinition))
|
||||
}
|
||||
var fileName string
|
||||
if i == 0 {
|
||||
@@ -181,6 +193,47 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func removeDescriptionFromMetadata(crd *apiext.CustomResourceDefinition) {
|
||||
for _, versionSpec := range crd.Spec.Versions {
|
||||
if versionSpec.Schema != nil {
|
||||
removeDescriptionFromMetadataProps(versionSpec.Schema.OpenAPIV3Schema)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func removeDescriptionFromMetadataProps(v *apiext.JSONSchemaProps) {
|
||||
if m, ok := v.Properties["metadata"]; ok {
|
||||
meta := &m
|
||||
if meta.Description != "" {
|
||||
meta.Description = ""
|
||||
v.Properties["metadata"] = m
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func removeDescriptionFromMetadataLegacy(crd *apiextlegacy.CustomResourceDefinition) {
|
||||
if crd.Spec.Validation != nil {
|
||||
removeDescriptionFromMetadataPropsLegacy(crd.Spec.Validation.OpenAPIV3Schema)
|
||||
}
|
||||
for _, versionSpec := range crd.Spec.Versions {
|
||||
if versionSpec.Schema != nil {
|
||||
removeDescriptionFromMetadataPropsLegacy(versionSpec.Schema.OpenAPIV3Schema)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func removeDescriptionFromMetadataPropsLegacy(v *apiextlegacy.JSONSchemaProps) {
|
||||
if m, ok := v.Properties["metadata"]; ok {
|
||||
meta := &m
|
||||
if meta.Description != "" {
|
||||
meta.Description = ""
|
||||
v.Properties["metadata"] = m
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// removeDefaultsFromSchemas will remove all instances of default values being
|
||||
// specified across all defined API versions
|
||||
func removeDefaultsFromSchemas(crd *apiextlegacy.CustomResourceDefinition) {
|
||||
@@ -224,6 +277,18 @@ func removeDefaultsFromSchemaProps(v *apiextlegacy.JSONSchemaProps) {
|
||||
}
|
||||
}
|
||||
|
||||
// FixTopLevelMetadata resets the schema for the top-level metadata field which is needed for CRD validation
|
||||
func FixTopLevelMetadata(crd apiext.CustomResourceDefinition) {
|
||||
for _, v := range crd.Spec.Versions {
|
||||
if v.Schema != nil && v.Schema.OpenAPIV3Schema != nil && v.Schema.OpenAPIV3Schema.Properties != nil {
|
||||
schemaProperties := v.Schema.OpenAPIV3Schema.Properties
|
||||
if _, ok := schemaProperties["metadata"]; ok {
|
||||
schemaProperties["metadata"] = apiext.JSONSchemaProps{Type: "object"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// toTrivialVersions strips out all schemata except for the storage schema,
|
||||
// and moves that up into the root object. This makes the CRD compatible
|
||||
// with pre 1.13 clusters.
|
||||
|
||||
55
vendor/sigs.k8s.io/controller-tools/pkg/crd/known_types.go
generated
vendored
55
vendor/sigs.k8s.io/controller-tools/pkg/crd/known_types.go
generated
vendored
@@ -34,8 +34,6 @@ var KnownPackages = map[string]PackageOverride{
|
||||
},
|
||||
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1": func(p *Parser, pkg *loader.Package) {
|
||||
// ObjectMeta is managed by the Kubernetes API server, so no need to
|
||||
// generate validation for it.
|
||||
p.Schemata[TypeIdent{Name: "ObjectMeta", Package: pkg}] = apiext.JSONSchemaProps{
|
||||
Type: "object",
|
||||
}
|
||||
@@ -113,6 +111,53 @@ var KnownPackages = map[string]PackageOverride{
|
||||
},
|
||||
}
|
||||
|
||||
// ObjectMetaPackages overrides the ObjectMeta in all types
|
||||
var ObjectMetaPackages = map[string]PackageOverride{
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1": func(p *Parser, pkg *loader.Package) {
|
||||
// execute the KnowPackages for `k8s.io/apimachinery/pkg/apis/meta/v1` if any
|
||||
if f, ok := KnownPackages["k8s.io/apimachinery/pkg/apis/meta/v1"]; ok {
|
||||
f(p, pkg)
|
||||
}
|
||||
// This is an allow-listed set of properties of ObjectMeta, other runtime properties are not part of this list
|
||||
// See more discussion: https://github.com/kubernetes-sigs/controller-tools/pull/395#issuecomment-691919433
|
||||
p.Schemata[TypeIdent{Name: "ObjectMeta", Package: pkg}] = apiext.JSONSchemaProps{
|
||||
Type: "object",
|
||||
Properties: map[string]apiext.JSONSchemaProps{
|
||||
"name": {
|
||||
Type: "string",
|
||||
},
|
||||
"namespace": {
|
||||
Type: "string",
|
||||
},
|
||||
"annotations": {
|
||||
Type: "object",
|
||||
AdditionalProperties: &apiext.JSONSchemaPropsOrBool{
|
||||
Schema: &apiext.JSONSchemaProps{
|
||||
Type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
"labels": {
|
||||
Type: "object",
|
||||
AdditionalProperties: &apiext.JSONSchemaPropsOrBool{
|
||||
Schema: &apiext.JSONSchemaProps{
|
||||
Type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
"finalizers": {
|
||||
Type: "array",
|
||||
Items: &apiext.JSONSchemaPropsOrArray{
|
||||
Schema: &apiext.JSONSchemaProps{
|
||||
Type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func boolPtr(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
@@ -125,4 +170,10 @@ func AddKnownTypes(parser *Parser) {
|
||||
for pkgName, override := range KnownPackages {
|
||||
parser.PackageOverrides[pkgName] = override
|
||||
}
|
||||
// if we want to generate the embedded ObjectMeta in the CRD we need to add the ObjectMetaPackages
|
||||
if parser.GenerateEmbeddedObjectMeta {
|
||||
for pkgName, override := range ObjectMetaPackages {
|
||||
parser.PackageOverrides[pkgName] = override
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/crd.go
generated
vendored
29
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/crd.go
generated
vendored
@@ -48,6 +48,9 @@ var CRDMarkers = []*definitionWithHelp{
|
||||
|
||||
must(markers.MakeDefinition("kubebuilder:unservedversion", markers.DescribesType, UnservedVersion{})).
|
||||
WithHelp(UnservedVersion{}.Help()),
|
||||
|
||||
must(markers.MakeDefinition("kubebuilder:deprecatedversion", markers.DescribesType, DeprecatedVersion{})).
|
||||
WithHelp(DeprecatedVersion{}.Help()),
|
||||
}
|
||||
|
||||
// TODO: categories and singular used to be annotations types
|
||||
@@ -316,3 +319,29 @@ func (s UnservedVersion) ApplyToCRD(crd *apiext.CustomResourceDefinitionSpec, ve
|
||||
}
|
||||
|
||||
// NB(directxman12): singular was historically distinct, so we keep it here for backwards compat
|
||||
|
||||
// +controllertools:marker:generateHelp:category=CRD
|
||||
|
||||
// DeprecatedVersion marks this version as deprecated.
|
||||
type DeprecatedVersion struct {
|
||||
// Warning message to be shown on the deprecated version
|
||||
Warning *string `marker:",optional"`
|
||||
}
|
||||
|
||||
func (s DeprecatedVersion) ApplyToCRD(crd *apiext.CustomResourceDefinitionSpec, version string) error {
|
||||
if version == "" {
|
||||
// single-version, do nothing
|
||||
return nil
|
||||
}
|
||||
// multi-version
|
||||
for i := range crd.Versions {
|
||||
ver := &crd.Versions[i]
|
||||
if ver.Name != version {
|
||||
continue
|
||||
}
|
||||
ver.Deprecated = true
|
||||
ver.DeprecationWarning = s.Warning
|
||||
break
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
17
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/validation.go
generated
vendored
17
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/validation.go
generated
vendored
@@ -26,6 +26,10 @@ import (
|
||||
"sigs.k8s.io/controller-tools/pkg/markers"
|
||||
)
|
||||
|
||||
const (
|
||||
SchemalessName = "kubebuilder:validation:Schemaless"
|
||||
)
|
||||
|
||||
// ValidationMarkers lists all available markers that affect CRD schema generation,
|
||||
// except for the few that don't make sense as type-level markers (see FieldOnlyMarkers).
|
||||
// All markers start with `+kubebuilder:validation:`, and continue with their type name.
|
||||
@@ -82,6 +86,9 @@ var FieldOnlyMarkers = []*definitionWithHelp{
|
||||
|
||||
must(markers.MakeDefinition("kubebuilder:validation:EmbeddedResource", markers.DescribesField, XEmbeddedResource{})).
|
||||
WithHelp(XEmbeddedResource{}.Help()),
|
||||
|
||||
must(markers.MakeDefinition(SchemalessName, markers.DescribesField, Schemaless{})).
|
||||
WithHelp(Schemaless{}.Help()),
|
||||
}
|
||||
|
||||
// ValidationIshMarkers are field-and-type markers that don't fall under the
|
||||
@@ -225,6 +232,16 @@ type XPreserveUnknownFields struct{}
|
||||
// field, yet it is possible. This can be combined with PreserveUnknownFields.
|
||||
type XEmbeddedResource struct{}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// Schemaless marks a field as being a schemaless object.
|
||||
//
|
||||
// Schemaless objects are not introspected, so you must provide
|
||||
// any type and validation information yourself. One use for this
|
||||
// tag is for embedding fields that hold JSONSchema typed objects.
|
||||
// Because this field disables all type checking, it is recommended
|
||||
// to be used only as a last resort.
|
||||
type Schemaless struct{}
|
||||
|
||||
func (m Maximum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "integer" {
|
||||
return fmt.Errorf("must apply maximum to an integer")
|
||||
|
||||
57
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/zz_generated.markerhelp.go
generated
vendored
57
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/zz_generated.markerhelp.go
generated
vendored
@@ -32,7 +32,7 @@ func (Default) Help() *markers.DefinitionHelp {
|
||||
Details: "A default value will be accepted as any value valid for the field. Formatting for common types include: boolean: `true`, string: `Cluster`, numerical: `1.24`, array: `{1,2}`, object: `{policy: \"delete\"}`). Defaults should be defined in pruned form, and only best-effort validation will be performed. Full validation of a default requires submission of the containing CRD to an apiserver.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Value": markers.DetailedHelp{
|
||||
"Value": {
|
||||
Summary: "",
|
||||
Details: "",
|
||||
},
|
||||
@@ -40,6 +40,22 @@ func (Default) Help() *markers.DefinitionHelp {
|
||||
}
|
||||
}
|
||||
|
||||
func (DeprecatedVersion) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "marks this version as deprecated.",
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Warning": markers.DetailedHelp{
|
||||
Summary: "message to be shown on the deprecated version",
|
||||
Details: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (Enum) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD validation",
|
||||
@@ -246,27 +262,27 @@ func (PrintColumn) Help() *markers.DefinitionHelp {
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Name": markers.DetailedHelp{
|
||||
"Name": {
|
||||
Summary: "specifies the name of the column.",
|
||||
Details: "",
|
||||
},
|
||||
"Type": markers.DetailedHelp{
|
||||
"Type": {
|
||||
Summary: "indicates the type of the column. ",
|
||||
Details: "It may be any OpenAPI data type listed at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types.",
|
||||
},
|
||||
"JSONPath": markers.DetailedHelp{
|
||||
"JSONPath": {
|
||||
Summary: "specifies the jsonpath expression used to extract the value of the column.",
|
||||
Details: "",
|
||||
},
|
||||
"Description": markers.DetailedHelp{
|
||||
"Description": {
|
||||
Summary: "specifies the help/description for this column.",
|
||||
Details: "",
|
||||
},
|
||||
"Format": markers.DetailedHelp{
|
||||
"Format": {
|
||||
Summary: "specifies the format of the column. ",
|
||||
Details: "It may be any OpenAPI data format corresponding to the type, listed at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types.",
|
||||
},
|
||||
"Priority": markers.DetailedHelp{
|
||||
"Priority": {
|
||||
Summary: "indicates how important it is that this column be displayed. ",
|
||||
Details: "Lower priority (*higher* numbered) columns will be hidden if the terminal width is too small.",
|
||||
},
|
||||
@@ -282,23 +298,23 @@ func (Resource) Help() *markers.DefinitionHelp {
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Path": markers.DetailedHelp{
|
||||
"Path": {
|
||||
Summary: "specifies the plural \"resource\" for this CRD. ",
|
||||
Details: "It generally corresponds to a plural, lower-cased version of the Kind. See https://book.kubebuilder.io/cronjob-tutorial/gvks.html.",
|
||||
},
|
||||
"ShortName": markers.DetailedHelp{
|
||||
"ShortName": {
|
||||
Summary: "specifies aliases for this CRD. ",
|
||||
Details: "Short names are often used when people have work with your resource over and over again. For instance, \"rs\" for \"replicaset\" or \"crd\" for customresourcedefinition.",
|
||||
},
|
||||
"Categories": markers.DetailedHelp{
|
||||
"Categories": {
|
||||
Summary: "specifies which group aliases this resource is part of. ",
|
||||
Details: "Group aliases are used to work with groups of resources at once. The most common one is \"all\" which covers about a third of the base resources in Kubernetes, and is generally used for \"user-facing\" resources.",
|
||||
},
|
||||
"Singular": markers.DetailedHelp{
|
||||
"Singular": {
|
||||
Summary: "overrides the singular form of your resource. ",
|
||||
Details: "The singular form is otherwise defaulted off the plural (path).",
|
||||
},
|
||||
"Scope": markers.DetailedHelp{
|
||||
"Scope": {
|
||||
Summary: "overrides the scope of the CRD (Cluster vs Namespaced). ",
|
||||
Details: "Scope defaults to \"Namespaced\". Cluster-scoped (\"Cluster\") resources don't exist in namespaces.",
|
||||
},
|
||||
@@ -306,6 +322,17 @@ func (Resource) Help() *markers.DefinitionHelp {
|
||||
}
|
||||
}
|
||||
|
||||
func (Schemaless) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD validation",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "marks a field as being a schemaless object. ",
|
||||
Details: "Schemaless objects are not introspected, so you must provide any type and validation information yourself. One use for this tag is for embedding fields that hold JSONSchema typed objects. Because this field disables all type checking, it is recommended to be used only as a last resort.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
}
|
||||
}
|
||||
|
||||
func (SkipVersion) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD",
|
||||
@@ -347,15 +374,15 @@ func (SubresourceScale) Help() *markers.DefinitionHelp {
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"SpecPath": markers.DetailedHelp{
|
||||
"SpecPath": {
|
||||
Summary: "specifies the jsonpath to the replicas field for the scale's spec.",
|
||||
Details: "",
|
||||
},
|
||||
"StatusPath": markers.DetailedHelp{
|
||||
"StatusPath": {
|
||||
Summary: "specifies the jsonpath to the replicas field for the scale's status.",
|
||||
Details: "",
|
||||
},
|
||||
"SelectorPath": markers.DetailedHelp{
|
||||
"SelectorPath": {
|
||||
Summary: "specifies the jsonpath to the pod label selector field for the scale's status. ",
|
||||
Details: "The selector field must be the *string* form (serialized form) of a selector. Setting a pod label selector is necessary for your type to work with the HorizontalPodAutoscaler.",
|
||||
},
|
||||
|
||||
3
vendor/sigs.k8s.io/controller-tools/pkg/crd/parser.go
generated
vendored
3
vendor/sigs.k8s.io/controller-tools/pkg/crd/parser.go
generated
vendored
@@ -86,6 +86,9 @@ type Parser struct {
|
||||
// because the implementation is too difficult/clunky to promote them to category 3.
|
||||
// TODO: Should we have a more formal mechanism for putting "type patterns" in each of the above categories?
|
||||
AllowDangerousTypes bool
|
||||
|
||||
// GenerateEmbeddedObjectMeta specifies if any embedded ObjectMeta should be generated
|
||||
GenerateEmbeddedObjectMeta bool
|
||||
}
|
||||
|
||||
func (p *Parser) init() {
|
||||
|
||||
8
vendor/sigs.k8s.io/controller-tools/pkg/crd/schema.go
generated
vendored
8
vendor/sigs.k8s.io/controller-tools/pkg/crd/schema.go
generated
vendored
@@ -23,6 +23,7 @@ import (
|
||||
"strings"
|
||||
|
||||
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
crdmarkers "sigs.k8s.io/controller-tools/pkg/crd/markers"
|
||||
|
||||
"sigs.k8s.io/controller-tools/pkg/loader"
|
||||
"sigs.k8s.io/controller-tools/pkg/markers"
|
||||
@@ -378,7 +379,12 @@ func structToSchema(ctx *schemaContext, structType *ast.StructType) *apiext.JSON
|
||||
}
|
||||
}
|
||||
|
||||
propSchema := typeToSchema(ctx.ForInfo(&markers.TypeInfo{}), field.RawField.Type)
|
||||
var propSchema *apiext.JSONSchemaProps
|
||||
if field.Markers.Get(crdmarkers.SchemalessName) != nil {
|
||||
propSchema = &apiext.JSONSchemaProps{}
|
||||
} else {
|
||||
propSchema = typeToSchema(ctx.ForInfo(&markers.TypeInfo{}), field.RawField.Type)
|
||||
}
|
||||
propSchema.Description = field.Doc
|
||||
|
||||
applyMarkers(ctx, field.Markers, propSchema, field.RawField)
|
||||
|
||||
2
vendor/sigs.k8s.io/controller-tools/pkg/crd/spec.go
generated
vendored
2
vendor/sigs.k8s.io/controller-tools/pkg/crd/spec.go
generated
vendored
@@ -55,7 +55,7 @@ func (p *Parser) NeedCRDFor(groupKind schema.GroupKind, maxDescLen *int) {
|
||||
packages = append(packages, pkg)
|
||||
}
|
||||
|
||||
defaultPlural := flect.Pluralize(strings.ToLower(groupKind.Kind))
|
||||
defaultPlural := strings.ToLower(flect.Pluralize(groupKind.Kind))
|
||||
crd := apiext.CustomResourceDefinition{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: apiext.SchemeGroupVersion.String(),
|
||||
|
||||
14
vendor/sigs.k8s.io/controller-tools/pkg/crd/zz_generated.markerhelp.go
generated
vendored
14
vendor/sigs.k8s.io/controller-tools/pkg/crd/zz_generated.markerhelp.go
generated
vendored
@@ -32,26 +32,30 @@ func (Generator) Help() *markers.DefinitionHelp {
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"TrivialVersions": markers.DetailedHelp{
|
||||
"TrivialVersions": {
|
||||
Summary: "indicates that we should produce a single-version CRD. ",
|
||||
Details: "Single \"trivial-version\" CRDs are compatible with older (pre 1.13) Kubernetes API servers. The storage version's schema will be used as the CRD's schema. \n Only works with the v1beta1 CRD version.",
|
||||
},
|
||||
"PreserveUnknownFields": markers.DetailedHelp{
|
||||
"PreserveUnknownFields": {
|
||||
Summary: "indicates whether or not we should turn off pruning. ",
|
||||
Details: "Left unspecified, it'll default to true when only a v1beta1 CRD is generated (to preserve compatibility with older versions of this tool), or false otherwise. \n It's required to be false for v1 CRDs.",
|
||||
},
|
||||
"AllowDangerousTypes": markers.DetailedHelp{
|
||||
"AllowDangerousTypes": {
|
||||
Summary: "allows types which are usually omitted from CRD generation because they are not recommended. ",
|
||||
Details: "Currently the following additional types are allowed when this is true: float32 float64 \n Left unspecified, the default is false",
|
||||
},
|
||||
"MaxDescLen": markers.DetailedHelp{
|
||||
"MaxDescLen": {
|
||||
Summary: "specifies the maximum description length for fields in CRD's OpenAPI schema. ",
|
||||
Details: "0 indicates drop the description for all fields completely. n indicates limit the description to at most n characters and truncate the description to closest sentence boundary if it exceeds n characters.",
|
||||
},
|
||||
"CRDVersions": markers.DetailedHelp{
|
||||
"CRDVersions": {
|
||||
Summary: "specifies the target API versions of the CRD type itself to generate. Defaults to v1. ",
|
||||
Details: "The first version listed will be assumed to be the \"default\" version and will not get a version suffix in the output filename. \n You'll need to use \"v1\" to get support for features like defaulting, along with an API server that supports it (Kubernetes 1.16+).",
|
||||
},
|
||||
"GenerateEmbeddedObjectMeta": {
|
||||
Summary: "specifies if any embedded ObjectMeta in the CRD should be generated",
|
||||
Details: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user