Bump sigs.k8s.io/controller-tools from 0.6.2 to 0.11.1 (#5432)
This commit is contained in:
40
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/crd.go
generated
vendored
40
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/crd.go
generated
vendored
@@ -18,6 +18,7 @@ package markers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
|
||||
@@ -51,6 +52,9 @@ var CRDMarkers = []*definitionWithHelp{
|
||||
|
||||
must(markers.MakeDefinition("kubebuilder:deprecatedversion", markers.DescribesType, DeprecatedVersion{})).
|
||||
WithHelp(DeprecatedVersion{}.Help()),
|
||||
|
||||
must(markers.MakeDefinition("kubebuilder:metadata", markers.DescribesType, Metadata{})).
|
||||
WithHelp(Metadata{}.Help()),
|
||||
}
|
||||
|
||||
// TODO: categories and singular used to be annotations types
|
||||
@@ -345,3 +349,39 @@ func (s DeprecatedVersion) ApplyToCRD(crd *apiext.CustomResourceDefinitionSpec,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// +controllertools:marker:generateHelp:category=CRD
|
||||
|
||||
// Metadata configures the additional annotations or labels for this CRD.
|
||||
// For example adding annotation "api-approved.kubernetes.io" for a CRD with Kubernetes groups,
|
||||
// or annotation "cert-manager.io/inject-ca-from-secret" for a CRD that needs CA injection.
|
||||
type Metadata struct {
|
||||
// Annotations will be added into the annotations of this CRD.
|
||||
Annotations []string `marker:",optional"`
|
||||
// Labels will be added into the labels of this CRD.
|
||||
Labels []string `marker:",optional"`
|
||||
}
|
||||
|
||||
func (s Metadata) ApplyToCRD(crd *apiext.CustomResourceDefinition, version string) error {
|
||||
if len(s.Annotations) > 0 {
|
||||
if crd.Annotations == nil {
|
||||
crd.Annotations = map[string]string{}
|
||||
}
|
||||
for _, str := range s.Annotations {
|
||||
kv := strings.SplitN(str, "=", 2)
|
||||
crd.Annotations[kv[0]] = kv[1]
|
||||
}
|
||||
}
|
||||
|
||||
if len(s.Labels) > 0 {
|
||||
if crd.Labels == nil {
|
||||
crd.Labels = map[string]string{}
|
||||
}
|
||||
for _, str := range s.Labels {
|
||||
kv := strings.SplitN(str, "=", 2)
|
||||
crd.Labels[kv[0]] = kv[1]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
6
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/doc.go
generated
vendored
6
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/doc.go
generated
vendored
@@ -19,7 +19,7 @@ limitations under the License.
|
||||
//
|
||||
// All markers related to CRD generation live in AllDefinitions.
|
||||
//
|
||||
// Validation Markers
|
||||
// # Validation Markers
|
||||
//
|
||||
// Validation markers have values that implement ApplyToSchema
|
||||
// (crd.SchemaMarker). Any marker implementing this will automatically
|
||||
@@ -31,7 +31,7 @@ limitations under the License.
|
||||
// All validation markers start with "+kubebuilder:validation", and
|
||||
// have the same name as their type name.
|
||||
//
|
||||
// CRD Markers
|
||||
// # CRD Markers
|
||||
//
|
||||
// Markers that modify anything in the CRD itself *except* for the schema
|
||||
// implement ApplyToCRD (crd.CRDMarker). They are expected to detect whether
|
||||
@@ -39,7 +39,7 @@ limitations under the License.
|
||||
// them), or to the root-level CRD for legacy cases. They are applied *after*
|
||||
// the rest of the CRD is computed.
|
||||
//
|
||||
// Misc
|
||||
// # Misc
|
||||
//
|
||||
// This package also defines the "+groupName" and "+versionName" package-level
|
||||
// markers, for defining package<->group-version mappings.
|
||||
|
||||
46
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/topology.go
generated
vendored
46
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/topology.go
generated
vendored
@@ -28,12 +28,20 @@ import (
|
||||
var TopologyMarkers = []*definitionWithHelp{
|
||||
must(markers.MakeDefinition("listMapKey", markers.DescribesField, ListMapKey(""))).
|
||||
WithHelp(ListMapKey("").Help()),
|
||||
must(markers.MakeDefinition("listMapKey", markers.DescribesType, ListMapKey(""))).
|
||||
WithHelp(ListMapKey("").Help()),
|
||||
must(markers.MakeDefinition("listType", markers.DescribesField, ListType(""))).
|
||||
WithHelp(ListType("").Help()),
|
||||
must(markers.MakeDefinition("listType", markers.DescribesType, ListType(""))).
|
||||
WithHelp(ListType("").Help()),
|
||||
must(markers.MakeDefinition("mapType", markers.DescribesField, MapType(""))).
|
||||
WithHelp(MapType("").Help()),
|
||||
must(markers.MakeDefinition("mapType", markers.DescribesType, MapType(""))).
|
||||
WithHelp(MapType("").Help()),
|
||||
must(markers.MakeDefinition("structType", markers.DescribesField, StructType(""))).
|
||||
WithHelp(StructType("").Help()),
|
||||
must(markers.MakeDefinition("structType", markers.DescribesType, StructType(""))).
|
||||
WithHelp(StructType("").Help()),
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -47,15 +55,15 @@ func init() {
|
||||
//
|
||||
// Possible data-structure types of a list are:
|
||||
//
|
||||
// - "map": it needs to have a key field, which will be used to build an
|
||||
// associative list. A typical example is a the pod container list,
|
||||
// which is indexed by the container name.
|
||||
// - "map": it needs to have a key field, which will be used to build an
|
||||
// associative list. A typical example is a the pod container list,
|
||||
// which is indexed by the container name.
|
||||
//
|
||||
// - "set": Fields need to be "scalar", and there can be only one
|
||||
// occurrence of each.
|
||||
// - "set": Fields need to be "scalar", and there can be only one
|
||||
// occurrence of each.
|
||||
//
|
||||
// - "atomic": All the fields in the list are treated as a single value,
|
||||
// are typically manipulated together by the same actor.
|
||||
// - "atomic": All the fields in the list are treated as a single value,
|
||||
// are typically manipulated together by the same actor.
|
||||
type ListType string
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD processing"
|
||||
@@ -75,12 +83,12 @@ type ListMapKey string
|
||||
//
|
||||
// Possible values:
|
||||
//
|
||||
// - "granular": items in the map are independent of each other,
|
||||
// and can be manipulated by different actors.
|
||||
// This is the default behavior.
|
||||
// - "granular": items in the map are independent of each other,
|
||||
// and can be manipulated by different actors.
|
||||
// This is the default behavior.
|
||||
//
|
||||
// - "atomic": all fields are treated as one unit.
|
||||
// Any changes have to replace the entire map.
|
||||
// - "atomic": all fields are treated as one unit.
|
||||
// Any changes have to replace the entire map.
|
||||
type MapType string
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD processing"
|
||||
@@ -91,17 +99,17 @@ type MapType string
|
||||
//
|
||||
// Possible values:
|
||||
//
|
||||
// - "granular": fields in the struct are independent of each other,
|
||||
// and can be manipulated by different actors.
|
||||
// This is the default behavior.
|
||||
// - "granular": fields in the struct are independent of each other,
|
||||
// and can be manipulated by different actors.
|
||||
// This is the default behavior.
|
||||
//
|
||||
// - "atomic": all fields are treated as one unit.
|
||||
// Any changes have to replace the entire struct.
|
||||
// - "atomic": all fields are treated as one unit.
|
||||
// Any changes have to replace the entire struct.
|
||||
type StructType string
|
||||
|
||||
func (l ListType) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "array" {
|
||||
return fmt.Errorf("must apply listType to an array")
|
||||
return fmt.Errorf("must apply listType to an array, found %s", schema.Type)
|
||||
}
|
||||
if l != "map" && l != "atomic" && l != "set" {
|
||||
return fmt.Errorf(`ListType must be either "map", "set" or "atomic"`)
|
||||
@@ -115,7 +123,7 @@ func (l ListType) ApplyFirst() {}
|
||||
|
||||
func (l ListMapKey) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "array" {
|
||||
return fmt.Errorf("must apply listMapKey to an array")
|
||||
return fmt.Errorf("must apply listMapKey to an array, found %s", schema.Type)
|
||||
}
|
||||
if schema.XListType == nil || *schema.XListType != "map" {
|
||||
return fmt.Errorf("must apply listMapKey to an associative-list")
|
||||
|
||||
131
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/validation.go
generated
vendored
131
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/validation.go
generated
vendored
@@ -17,9 +17,9 @@ limitations under the License.
|
||||
package markers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
|
||||
@@ -37,7 +37,7 @@ const (
|
||||
// reusable and writing complex validations on slice items.
|
||||
var ValidationMarkers = mustMakeAllWithPrefix("kubebuilder:validation", markers.DescribesField,
|
||||
|
||||
// integer markers
|
||||
// numeric markers
|
||||
|
||||
Maximum(0),
|
||||
Minimum(0),
|
||||
@@ -66,6 +66,8 @@ var ValidationMarkers = mustMakeAllWithPrefix("kubebuilder:validation", markers.
|
||||
Type(""),
|
||||
XPreserveUnknownFields{},
|
||||
XEmbeddedResource{},
|
||||
XIntOrString{},
|
||||
XValidation{},
|
||||
)
|
||||
|
||||
// FieldOnlyMarkers list field-specific validation markers (i.e. those markers that don't make
|
||||
@@ -121,11 +123,19 @@ func init() {
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// Maximum specifies the maximum numeric value that this field can have.
|
||||
type Maximum int
|
||||
type Maximum float64
|
||||
|
||||
func (m Maximum) Value() float64 {
|
||||
return float64(m)
|
||||
}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// Minimum specifies the minimum numeric value that this field can have. Negative integers are supported.
|
||||
type Minimum int
|
||||
// Minimum specifies the minimum numeric value that this field can have. Negative numbers are supported.
|
||||
type Minimum float64
|
||||
|
||||
func (m Minimum) Value() float64 {
|
||||
return float64(m)
|
||||
}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// ExclusiveMinimum indicates that the minimum is "up to" but not including that value.
|
||||
@@ -137,7 +147,11 @@ type ExclusiveMaximum bool
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// MultipleOf specifies that this field must have a numeric value that's a multiple of this one.
|
||||
type MultipleOf int
|
||||
type MultipleOf float64
|
||||
|
||||
func (m MultipleOf) Value() float64 {
|
||||
return float64(m)
|
||||
}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// MaxLength specifies the maximum length for this string.
|
||||
@@ -232,6 +246,14 @@ type XPreserveUnknownFields struct{}
|
||||
// field, yet it is possible. This can be combined with PreserveUnknownFields.
|
||||
type XEmbeddedResource struct{}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// IntOrString marks a fields as an IntOrString.
|
||||
//
|
||||
// This is required when applying patterns or other validations to an IntOrString
|
||||
// field. Knwon information about the type is applied during the collapse phase
|
||||
// and as such is not normally available during marker application.
|
||||
type XIntOrString struct{}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// Schemaless marks a field as being a schemaless object.
|
||||
//
|
||||
@@ -242,41 +264,80 @@ type XEmbeddedResource struct{}
|
||||
// to be used only as a last resort.
|
||||
type Schemaless struct{}
|
||||
|
||||
func hasNumericType(schema *apiext.JSONSchemaProps) bool {
|
||||
return schema.Type == "integer" || schema.Type == "number"
|
||||
}
|
||||
|
||||
func isIntegral(value float64) bool {
|
||||
return value == math.Trunc(value) && !math.IsNaN(value) && !math.IsInf(value, 0)
|
||||
}
|
||||
|
||||
// +controllertools:marker:generateHelp:category="CRD validation"
|
||||
// XValidation marks a field as requiring a value for which a given
|
||||
// expression evaluates to true.
|
||||
//
|
||||
// This marker may be repeated to specify multiple expressions, all of
|
||||
// which must evaluate to true.
|
||||
type XValidation struct {
|
||||
Rule string
|
||||
Message string `marker:",optional"`
|
||||
}
|
||||
|
||||
func (m Maximum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "integer" {
|
||||
return fmt.Errorf("must apply maximum to an integer")
|
||||
if !hasNumericType(schema) {
|
||||
return fmt.Errorf("must apply maximum to a numeric value, found %s", schema.Type)
|
||||
}
|
||||
val := float64(m)
|
||||
|
||||
if schema.Type == "integer" && !isIntegral(m.Value()) {
|
||||
return fmt.Errorf("cannot apply non-integral maximum validation (%v) to integer value", m.Value())
|
||||
}
|
||||
|
||||
val := m.Value()
|
||||
schema.Maximum = &val
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m Minimum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "integer" {
|
||||
return fmt.Errorf("must apply minimum to an integer")
|
||||
if !hasNumericType(schema) {
|
||||
return fmt.Errorf("must apply minimum to a numeric value, found %s", schema.Type)
|
||||
}
|
||||
val := float64(m)
|
||||
|
||||
if schema.Type == "integer" && !isIntegral(m.Value()) {
|
||||
return fmt.Errorf("cannot apply non-integral minimum validation (%v) to integer value", m.Value())
|
||||
}
|
||||
|
||||
val := m.Value()
|
||||
schema.Minimum = &val
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m ExclusiveMaximum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "integer" {
|
||||
return fmt.Errorf("must apply exclusivemaximum to an integer")
|
||||
if !hasNumericType(schema) {
|
||||
return fmt.Errorf("must apply exclusivemaximum to a numeric value, found %s", schema.Type)
|
||||
}
|
||||
schema.ExclusiveMaximum = bool(m)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m ExclusiveMinimum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "integer" {
|
||||
return fmt.Errorf("must apply exclusiveminimum to an integer")
|
||||
if !hasNumericType(schema) {
|
||||
return fmt.Errorf("must apply exclusiveminimum to a numeric value, found %s", schema.Type)
|
||||
}
|
||||
|
||||
schema.ExclusiveMinimum = bool(m)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MultipleOf) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "integer" {
|
||||
return fmt.Errorf("must apply multipleof to an integer")
|
||||
if !hasNumericType(schema) {
|
||||
return fmt.Errorf("must apply multipleof to a numeric value, found %s", schema.Type)
|
||||
}
|
||||
val := float64(m)
|
||||
|
||||
if schema.Type == "integer" && !isIntegral(m.Value()) {
|
||||
return fmt.Errorf("cannot apply non-integral multipleof validation (%v) to integer value", m.Value())
|
||||
}
|
||||
|
||||
val := m.Value()
|
||||
schema.MultipleOf = &val
|
||||
return nil
|
||||
}
|
||||
@@ -289,6 +350,7 @@ func (m MaxLength) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.MaxLength = &val
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MinLength) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "string" {
|
||||
return fmt.Errorf("must apply minlength to a string")
|
||||
@@ -297,9 +359,13 @@ func (m MinLength) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.MinLength = &val
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m Pattern) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "string" {
|
||||
return fmt.Errorf("must apply pattern to a string")
|
||||
// Allow string types or IntOrStrings. An IntOrString will still
|
||||
// apply the pattern validation when a string is detected, the pattern
|
||||
// will not apply to ints though.
|
||||
if schema.Type != "string" && !schema.XIntOrString {
|
||||
return fmt.Errorf("must apply pattern to a `string` or `IntOrString`")
|
||||
}
|
||||
schema.Pattern = string(m)
|
||||
return nil
|
||||
@@ -313,6 +379,7 @@ func (m MaxItems) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.MaxItems = &val
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MinItems) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "array" {
|
||||
return fmt.Errorf("must apply minitems to an array")
|
||||
@@ -321,6 +388,7 @@ func (m MinItems) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.MinItems = &val
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m UniqueItems) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
if schema.Type != "array" {
|
||||
return fmt.Errorf("must apply uniqueitems to an array")
|
||||
@@ -364,6 +432,7 @@ func (m Enum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.Enum = vals
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m Format) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.Format = string(m)
|
||||
return nil
|
||||
@@ -406,3 +475,21 @@ func (m XEmbeddedResource) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.XEmbeddedResource = true
|
||||
return nil
|
||||
}
|
||||
|
||||
// NB(JoelSpeed): we use this property in other markers here,
|
||||
// which means the "XIntOrString" marker *must* be applied first.
|
||||
|
||||
func (m XIntOrString) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.XIntOrString = true
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m XIntOrString) ApplyFirst() {}
|
||||
|
||||
func (m XValidation) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
|
||||
schema.XValidations = append(schema.XValidations, apiext.ValidationRule{
|
||||
Rule: m.Rule,
|
||||
Message: m.Message,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
62
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/zz_generated.markerhelp.go
generated
vendored
62
vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/zz_generated.markerhelp.go
generated
vendored
@@ -1,3 +1,4 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
@@ -48,7 +49,7 @@ func (DeprecatedVersion) Help() *markers.DefinitionHelp {
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Warning": markers.DetailedHelp{
|
||||
"Warning": {
|
||||
Summary: "message to be shown on the deprecated version",
|
||||
Details: "",
|
||||
},
|
||||
@@ -116,7 +117,7 @@ func (ListType) Help() *markers.DefinitionHelp {
|
||||
Category: "CRD processing",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "specifies the type of data-structure that the list represents (map, set, atomic). ",
|
||||
Details: "Possible data-structure types of a list are: \n - \"map\": it needs to have a key field, which will be used to build an associative list. A typical example is a the pod container list, which is indexed by the container name. \n - \"set\": Fields need to be \"scalar\", and there can be only one occurrence of each. \n - \"atomic\": All the fields in the list are treated as a single value, are typically manipulated together by the same actor.",
|
||||
Details: "Possible data-structure types of a list are: \n - \"map\": it needs to have a key field, which will be used to build an associative list. A typical example is a the pod container list, which is indexed by the container name. \n - \"set\": Fields need to be \"scalar\", and there can be only one occurrence of each. \n - \"atomic\": All the fields in the list are treated as a single value, are typically manipulated together by the same actor.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
}
|
||||
@@ -127,7 +128,7 @@ func (MapType) Help() *markers.DefinitionHelp {
|
||||
Category: "CRD processing",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "specifies the level of atomicity of the map; i.e. whether each item in the map is independent of the others, or all fields are treated as a single unit. ",
|
||||
Details: "Possible values: \n - \"granular\": items in the map are independent of each other, and can be manipulated by different actors. This is the default behavior. \n - \"atomic\": all fields are treated as one unit. Any changes have to replace the entire map.",
|
||||
Details: "Possible values: \n - \"granular\": items in the map are independent of each other, and can be manipulated by different actors. This is the default behavior. \n - \"atomic\": all fields are treated as one unit. Any changes have to replace the entire map.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
}
|
||||
@@ -177,6 +178,26 @@ func (Maximum) Help() *markers.DefinitionHelp {
|
||||
}
|
||||
}
|
||||
|
||||
func (Metadata) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "configures the additional annotations or labels for this CRD. For example adding annotation \"api-approved.kubernetes.io\" for a CRD with Kubernetes groups, or annotation \"cert-manager.io/inject-ca-from-secret\" for a CRD that needs CA injection.",
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Annotations": {
|
||||
Summary: "will be added into the annotations of this CRD.",
|
||||
Details: "",
|
||||
},
|
||||
"Labels": {
|
||||
Summary: "will be added into the labels of this CRD.",
|
||||
Details: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (MinItems) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD validation",
|
||||
@@ -214,7 +235,7 @@ func (Minimum) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD validation",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "specifies the minimum numeric value that this field can have. Negative integers are supported.",
|
||||
Summary: "specifies the minimum numeric value that this field can have. Negative numbers are supported.",
|
||||
Details: "",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
@@ -360,7 +381,7 @@ func (StructType) Help() *markers.DefinitionHelp {
|
||||
Category: "CRD processing",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "specifies the level of atomicity of the struct; i.e. whether each field in the struct is independent of the others, or all fields are treated as a single unit. ",
|
||||
Details: "Possible values: \n - \"granular\": fields in the struct are independent of each other, and can be manipulated by different actors. This is the default behavior. \n - \"atomic\": all fields are treated as one unit. Any changes have to replace the entire struct.",
|
||||
Details: "Possible values: \n - \"granular\": fields in the struct are independent of each other, and can be manipulated by different actors. This is the default behavior. \n - \"atomic\": all fields are treated as one unit. Any changes have to replace the entire struct.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
}
|
||||
@@ -445,6 +466,17 @@ func (XEmbeddedResource) Help() *markers.DefinitionHelp {
|
||||
}
|
||||
}
|
||||
|
||||
func (XIntOrString) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD validation",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "IntOrString marks a fields as an IntOrString. ",
|
||||
Details: "This is required when applying patterns or other validations to an IntOrString field. Knwon information about the type is applied during the collapse phase and as such is not normally available during marker application.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
}
|
||||
}
|
||||
|
||||
func (XPreserveUnknownFields) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD processing",
|
||||
@@ -455,3 +487,23 @@ func (XPreserveUnknownFields) Help() *markers.DefinitionHelp {
|
||||
FieldHelp: map[string]markers.DetailedHelp{},
|
||||
}
|
||||
}
|
||||
|
||||
func (XValidation) Help() *markers.DefinitionHelp {
|
||||
return &markers.DefinitionHelp{
|
||||
Category: "CRD validation",
|
||||
DetailedHelp: markers.DetailedHelp{
|
||||
Summary: "marks a field as requiring a value for which a given expression evaluates to true. ",
|
||||
Details: "This marker may be repeated to specify multiple expressions, all of which must evaluate to true.",
|
||||
},
|
||||
FieldHelp: map[string]markers.DetailedHelp{
|
||||
"Rule": {
|
||||
Summary: "",
|
||||
Details: "",
|
||||
},
|
||||
"Message": {
|
||||
Summary: "",
|
||||
Details: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user