Skip to content

Commit e53dccf

Browse files
author
sami-wazery
committed
fix tests
1 parent 909a650 commit e53dccf

File tree

14 files changed

+803
-614
lines changed

14 files changed

+803
-614
lines changed

pkg/crd/markers/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ var ValidationIshMarkers = []*definitionWithHelp{
127127
WithHelp(XPreserveUnknownFields{}.Help()),
128128
must(markers.MakeDefinition("kubebuilder:pruning:PreserveUnknownFields", markers.DescribesType, XPreserveUnknownFields{})).
129129
WithHelp(XPreserveUnknownFields{}.Help()),
130-
130+
131131
must(markers.MakeDefinition("kubebuilder:feature-gate", markers.DescribesField, FeatureGate(""))).
132132
WithHelp(FeatureGate("").Help()),
133133
}

pkg/crd/markers/zz_generated.markerhelp.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: (devel)
7+
name: featuregatetests.
8+
spec:
9+
group: ""
10+
names:
11+
kind: FeatureGateTest
12+
listKind: FeatureGateTestList
13+
plural: featuregatetests
14+
singular: featuregatetest
15+
scope: Namespaced
16+
versions:
17+
- name: ""
18+
schema:
19+
openAPIV3Schema:
20+
description: FeatureGateTest is the Schema for testing feature gates
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: FeatureGateTestSpec defines the desired state with feature-gated
41+
fields
42+
properties:
43+
alphaFeature:
44+
description: Alpha-gated field - only included when alpha gate is
45+
enabled
46+
type: string
47+
name:
48+
description: Standard field - always included
49+
type: string
50+
required:
51+
- name
52+
type: object
53+
status:
54+
description: FeatureGateTestStatus defines the observed state with feature-gated
55+
fields
56+
properties:
57+
alphaStatus:
58+
description: Alpha-gated status field
59+
type: string
60+
ready:
61+
description: Standard status field
62+
type: boolean
63+
required:
64+
- ready
65+
type: object
66+
type: object
67+
served: true
68+
storage: true
69+
subresources:
70+
status: {}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: (devel)
7+
name: featuregatetests.
8+
spec:
9+
group: ""
10+
names:
11+
kind: FeatureGateTest
12+
listKind: FeatureGateTestList
13+
plural: featuregatetests
14+
singular: featuregatetest
15+
scope: Namespaced
16+
versions:
17+
- name: ""
18+
schema:
19+
openAPIV3Schema:
20+
description: FeatureGateTest is the Schema for testing feature gates
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: FeatureGateTestSpec defines the desired state with feature-gated
41+
fields
42+
properties:
43+
betaFeature:
44+
description: Beta-gated field - only included when beta gate is enabled
45+
type: string
46+
name:
47+
description: Standard field - always included
48+
type: string
49+
required:
50+
- name
51+
type: object
52+
status:
53+
description: FeatureGateTestStatus defines the observed state with feature-gated
54+
fields
55+
properties:
56+
betaStatus:
57+
description: Beta-gated status field
58+
type: string
59+
ready:
60+
description: Standard status field
61+
type: boolean
62+
required:
63+
- ready
64+
type: object
65+
type: object
66+
served: true
67+
storage: true
68+
subresources:
69+
status: {}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: (devel)
7+
name: featuregatetests.
8+
spec:
9+
group: ""
10+
names:
11+
kind: FeatureGateTest
12+
listKind: FeatureGateTestList
13+
plural: featuregatetests
14+
singular: featuregatetest
15+
scope: Namespaced
16+
versions:
17+
- name: ""
18+
schema:
19+
openAPIV3Schema:
20+
description: FeatureGateTest is the Schema for testing feature gates
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: FeatureGateTestSpec defines the desired state with feature-gated
41+
fields
42+
properties:
43+
alphaFeature:
44+
description: Alpha-gated field - only included when alpha gate is
45+
enabled
46+
type: string
47+
betaFeature:
48+
description: Beta-gated field - only included when beta gate is enabled
49+
type: string
50+
name:
51+
description: Standard field - always included
52+
type: string
53+
required:
54+
- name
55+
type: object
56+
status:
57+
description: FeatureGateTestStatus defines the observed state with feature-gated
58+
fields
59+
properties:
60+
alphaStatus:
61+
description: Alpha-gated status field
62+
type: string
63+
betaStatus:
64+
description: Beta-gated status field
65+
type: string
66+
ready:
67+
description: Standard status field
68+
type: boolean
69+
required:
70+
- ready
71+
type: object
72+
type: object
73+
served: true
74+
storage: true
75+
subresources:
76+
status: {}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: (devel)
7+
name: featuregatetests.
8+
spec:
9+
group: ""
10+
names:
11+
kind: FeatureGateTest
12+
listKind: FeatureGateTestList
13+
plural: featuregatetests
14+
singular: featuregatetest
15+
scope: Namespaced
16+
versions:
17+
- name: ""
18+
schema:
19+
openAPIV3Schema:
20+
description: FeatureGateTest is the Schema for testing feature gates
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: FeatureGateTestSpec defines the desired state with feature-gated
41+
fields
42+
properties:
43+
name:
44+
description: Standard field - always included
45+
type: string
46+
required:
47+
- name
48+
type: object
49+
status:
50+
description: FeatureGateTestStatus defines the observed state with feature-gated
51+
fields
52+
properties:
53+
ready:
54+
description: Standard status field
55+
type: boolean
56+
required:
57+
- ready
58+
type: object
59+
type: object
60+
served: true
61+
storage: true
62+
subresources:
63+
status: {}

pkg/crd/testdata/featuregates/types.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//go:generate ../../../../.run-controller-gen.sh crd:featureGates=alpha=true paths=. output:dir=./output_alpha
18-
//go:generate ../../../../.run-controller-gen.sh crd:featureGates=beta=true paths=. output:dir=./output_beta
17+
//go:generate ../../../../.run-controller-gen.sh crd:featureGates="alpha=true" paths=. output:dir=./output_alpha
18+
//go:generate ../../../../.run-controller-gen.sh crd:featureGates="beta=true" paths=. output:dir=./output_beta
19+
//go:generate ../../../../.run-controller-gen.sh crd:featureGates="alpha=true,beta=true" paths=. output:dir=./output_both
1920
//go:generate ../../../../.run-controller-gen.sh crd paths=. output:dir=./output_none
2021

2122
package featuregates
2223

2324
import (
24-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2526
)
2627

2728
// FeatureGateTestSpec defines the desired state with feature-gated fields
@@ -33,7 +34,7 @@ type FeatureGateTestSpec struct {
3334
// +kubebuilder:feature-gate=alpha
3435
AlphaFeature *string `json:"alphaFeature,omitempty"`
3536

36-
// Beta-gated field - only included when beta gate is enabled
37+
// Beta-gated field - only included when beta gate is enabled
3738
// +kubebuilder:feature-gate=beta
3839
BetaFeature *string `json:"betaFeature,omitempty"`
3940
}

pkg/crd/zz_generated.markerhelp.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)