Skip to content

Commit

Permalink
Merge pull request #459 from Huang-Wei/feat/bump-controller-gen
Browse files Browse the repository at this point in the history
bump controller-gen to v0.9.2
  • Loading branch information
k8s-ci-robot authored Dec 16, 2022
2 parents 4f56158 + b29862d commit a64627b
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 50 deletions.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
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".
For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->
```release-note
```
12 changes: 6 additions & 6 deletions apis/scheduling/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"sigs.k8s.io/scheduler-plugins/apis/scheduling"
)

// ElasticQuota sets elastic quota restrictions per namespace
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName={eq,eqs}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ElasticQuota sets elastic quota restrictions per namespace
// +kubebuilder:subresource:status
type ElasticQuota struct {
metav1.TypeMeta `json:",inline"`

Expand Down Expand Up @@ -113,11 +113,11 @@ const (
PodGroupLabel = "pod-group." + scheduling.GroupName
)

// PodGroup is a collection of Pod; used for batch workload.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName={pg,pgs}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PodGroup is a collection of Pod; used for batch workload.
// +kubebuilder:subresource:status
type PodGroup struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
Expand Down
4 changes: 2 additions & 2 deletions hack/verify-crdgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ source "${SCRIPT_ROOT}/hack/lib/init.sh"

kube::golang::verify_go_version

CRD_OPTIONS="crd:trivialVersions=true,preserveUnknownFields=false"
CRD_OPTIONS="crd"

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

# Generate CRD
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/..."
Expand Down
9 changes: 1 addition & 8 deletions manifests/appgroup/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/432 # edited manually
controller-gen.kubebuilder.io/version: v0.6.2
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: appgroups.appgroup.diktyo.k8s.io
spec:
Expand Down Expand Up @@ -196,9 +195,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
11 changes: 3 additions & 8 deletions manifests/capacityscheduling/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/52 # edited manually
controller-gen.kubebuilder.io/version: v0.6.2
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: elasticquotas.scheduling.sigs.k8s.io
spec:
Expand Down Expand Up @@ -79,9 +78,5 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
subresources:
status: {}
11 changes: 3 additions & 8 deletions manifests/coscheduling/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/50 # edited manually
controller-gen.kubebuilder.io/version: v0.6.2
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: podgroups.scheduling.sigs.k8s.io
spec:
Expand Down Expand Up @@ -98,9 +97,5 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
subresources:
status: {}
9 changes: 1 addition & 8 deletions manifests/networktopology/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/scheduler-plugins/pull/432 # edited manually
controller-gen.kubebuilder.io/version: v0.6.2
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: networktopologies.networktopology.diktyo.k8s.io
spec:
Expand Down Expand Up @@ -147,9 +146,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions manifests/noderesourcetopology/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes/enhancements/pull/1870 # edited manually
controller-gen.kubebuilder.io/version: v0.6.2
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: noderesourcetopologies.topology.node.k8s.io
spec:
Expand Down Expand Up @@ -137,9 +136,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 1 addition & 1 deletion pkg/controller/elasticquota.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (ctrl *ElasticQuotaController) syncHandler(key string) error {
}
if _, err = ctrl.schedClient.SchedulingV1alpha1().ElasticQuotas(namespace).
Patch(context.TODO(), eq.Name, types.MergePatchType,
patch, metav1.PatchOptions{}); err != nil {
patch, metav1.PatchOptions{}, "status"); err != nil {
return err
}
ctrl.recorder.Event(eq, v1.EventTypeNormal, "Synced", fmt.Sprintf("Elastic Quota %s synced successfully", key))
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/podgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (ctrl *PodGroupController) patchPodGroup(old, new *schedv1alpha1.PodGroup)
}

_, err = ctrl.pgClient.SchedulingV1alpha1().PodGroups(old.Namespace).Patch(context.TODO(), old.Name, types.MergePatchType,
patch, metav1.PatchOptions{})
patch, metav1.PatchOptions{}, "status")
if err != nil {
return err
}
Expand Down

0 comments on commit a64627b

Please sign in to comment.