Skip to content

Commit a64627b

Browse files
authored
Merge pull request #459 from Huang-Wei/feat/bump-controller-gen
bump controller-gen to v0.9.2
2 parents 4f56158 + b29862d commit a64627b

File tree

10 files changed

+30
-50
lines changed

10 files changed

+30
-50
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,14 @@ Fixes #
3737

3838
#### Special notes for your reviewer:
3939

40+
#### Does this PR introduce a user-facing change?
41+
<!--
42+
If no, just write "NONE" in the release-note block below.
43+
If yes, a release note is required:
44+
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
45+
46+
For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
47+
-->
48+
```release-note
49+
50+
```

apis/scheduling/v1alpha1/types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import (
2222
"sigs.k8s.io/scheduler-plugins/apis/scheduling"
2323
)
2424

25+
// ElasticQuota sets elastic quota restrictions per namespace
26+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2527
// +kubebuilder:object:root=true
2628
// +kubebuilder:resource:shortName={eq,eqs}
27-
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
28-
29-
// ElasticQuota sets elastic quota restrictions per namespace
29+
// +kubebuilder:subresource:status
3030
type ElasticQuota struct {
3131
metav1.TypeMeta `json:",inline"`
3232

@@ -113,11 +113,11 @@ const (
113113
PodGroupLabel = "pod-group." + scheduling.GroupName
114114
)
115115

116+
// PodGroup is a collection of Pod; used for batch workload.
117+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
116118
// +kubebuilder:object:root=true
117119
// +kubebuilder:resource:shortName={pg,pgs}
118-
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
119-
120-
// PodGroup is a collection of Pod; used for batch workload.
120+
// +kubebuilder:subresource:status
121121
type PodGroup struct {
122122
metav1.TypeMeta `json:",inline"`
123123
// Standard object's metadata.

hack/verify-crdgen.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ source "${SCRIPT_ROOT}/hack/lib/init.sh"
2323

2424
kube::golang::verify_go_version
2525

26-
CRD_OPTIONS="crd:trivialVersions=true,preserveUnknownFields=false"
26+
CRD_OPTIONS="crd"
2727

2828
# Download controller-gen locally
2929
CONTROLLER_GEN="${GOPATH}/bin/controller-gen"
30-
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2
30+
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2
3131

3232
# Generate CRD
3333
api_paths="./apis/scheduling/v1alpha1/...;./vendor/github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/apis/...;./vendor/github.com/diktyo-io/appgroup-api/pkg/apis/...;./vendor/github.com/diktyo-io/networktopology-api/pkg/apis/..."

manifests/appgroup/crd.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
76
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/432 # edited manually
8-
controller-gen.kubebuilder.io/version: v0.6.2
7+
controller-gen.kubebuilder.io/version: v0.9.2
98
creationTimestamp: null
109
name: appgroups.appgroup.diktyo.k8s.io
1110
spec:
@@ -196,9 +195,3 @@ spec:
196195
type: object
197196
served: true
198197
storage: true
199-
status:
200-
acceptedNames:
201-
kind: ""
202-
plural: ""
203-
conditions: []
204-
storedVersions: []

manifests/capacityscheduling/crd.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
76
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/52 # edited manually
8-
controller-gen.kubebuilder.io/version: v0.6.2
7+
controller-gen.kubebuilder.io/version: v0.9.2
98
creationTimestamp: null
109
name: elasticquotas.scheduling.sigs.k8s.io
1110
spec:
@@ -79,9 +78,5 @@ spec:
7978
type: object
8079
served: true
8180
storage: true
82-
status:
83-
acceptedNames:
84-
kind: ""
85-
plural: ""
86-
conditions: []
87-
storedVersions: []
81+
subresources:
82+
status: {}

manifests/coscheduling/crd.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
76
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/50 # edited manually
8-
controller-gen.kubebuilder.io/version: v0.6.2
7+
controller-gen.kubebuilder.io/version: v0.9.2
98
creationTimestamp: null
109
name: podgroups.scheduling.sigs.k8s.io
1110
spec:
@@ -98,9 +97,5 @@ spec:
9897
type: object
9998
served: true
10099
storage: true
101-
status:
102-
acceptedNames:
103-
kind: ""
104-
plural: ""
105-
conditions: []
106-
storedVersions: []
100+
subresources:
101+
status: {}

manifests/networktopology/crd.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
76
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/432 # edited manually
8-
controller-gen.kubebuilder.io/version: v0.6.2
7+
controller-gen.kubebuilder.io/version: v0.9.2
98
creationTimestamp: null
109
name: networktopologies.networktopology.diktyo.k8s.io
1110
spec:
@@ -147,9 +146,3 @@ spec:
147146
type: object
148147
served: true
149148
storage: true
150-
status:
151-
acceptedNames:
152-
kind: ""
153-
plural: ""
154-
conditions: []
155-
storedVersions: []

manifests/noderesourcetopology/crd.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
76
api-approved.kubernetes.io: https://github.com/kubernetes/enhancements/pull/1870 # edited manually
8-
controller-gen.kubebuilder.io/version: v0.6.2
7+
controller-gen.kubebuilder.io/version: v0.9.2
98
creationTimestamp: null
109
name: noderesourcetopologies.topology.node.k8s.io
1110
spec:
@@ -137,9 +136,3 @@ spec:
137136
type: object
138137
served: true
139138
storage: true
140-
status:
141-
acceptedNames:
142-
kind: ""
143-
plural: ""
144-
conditions: []
145-
storedVersions: []

pkg/controller/elasticquota.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (ctrl *ElasticQuotaController) syncHandler(key string) error {
202202
}
203203
if _, err = ctrl.schedClient.SchedulingV1alpha1().ElasticQuotas(namespace).
204204
Patch(context.TODO(), eq.Name, types.MergePatchType,
205-
patch, metav1.PatchOptions{}); err != nil {
205+
patch, metav1.PatchOptions{}, "status"); err != nil {
206206
return err
207207
}
208208
ctrl.recorder.Event(eq, v1.EventTypeNormal, "Synced", fmt.Sprintf("Elastic Quota %s synced successfully", key))

pkg/controller/podgroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (ctrl *PodGroupController) patchPodGroup(old, new *schedv1alpha1.PodGroup)
280280
}
281281

282282
_, err = ctrl.pgClient.SchedulingV1alpha1().PodGroups(old.Namespace).Patch(context.TODO(), old.Name, types.MergePatchType,
283-
patch, metav1.PatchOptions{})
283+
patch, metav1.PatchOptions{}, "status")
284284
if err != nil {
285285
return err
286286
}

0 commit comments

Comments
 (0)