File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ type Minimum float64
10
10
func (m Minimum ) Value () float64 {
11
11
return float64 (m )
12
12
}
13
+
14
+ //nolint:unparam
13
15
func (m Minimum ) ApplyToSchema (schema * apiext.JSONSchemaProps ) error {
14
16
val := m .Value ()
15
17
schema .Minimum = & val
@@ -21,6 +23,8 @@ type Maximum float64
21
23
func (m Maximum ) Value () float64 {
22
24
return float64 (m )
23
25
}
26
+
27
+ //nolint:unparam
24
28
func (m Maximum ) ApplyToSchema (schema * apiext.JSONSchemaProps ) error {
25
29
val := m .Value ()
26
30
schema .Maximum = & val
@@ -29,17 +33,18 @@ func (m Maximum) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
29
33
30
34
// kubebuilder Min Max markers are broken with type aliases
31
35
func registerMarkerOverrides (into * markers.Registry ) {
32
- min , _ := markers .MakeDefinition (
36
+ minMarker , _ := markers .MakeDefinition (
33
37
"kubebuilder:validation:Minimum" ,
34
38
markers .DescribesField ,
35
39
Minimum (0 ),
36
40
)
37
41
38
- max , _ := markers .MakeDefinition (
42
+ maxMarker , _ := markers .MakeDefinition (
39
43
"kubebuilder:validation:Maximum" ,
40
44
markers .DescribesField ,
41
45
Maximum (0 ),
42
46
)
43
- into .Register (min )
44
- into .Register (max )
47
+
48
+ into .Register (minMarker ) //nolint:errcheck
49
+ into .Register (maxMarker ) //nolint:errcheck
45
50
}
You can’t perform that action at this time.
0 commit comments