Skip to content

Commit 7783a29

Browse files
committed
Fix PlacementDecision score field to use pointer type with omitempty
The Score field in ClusterDecision was defined as a bare int64 without omitempty, causing it to always serialize as score:0 even when unset. Change Score from int64 to *int64 with omitempty so the field is omitted from JSON when not explicitly set, consistent with other optional integer fields in the API (e.g. TolerationSeconds, NumberOfClusters). Signed-off-by: Mike Ng <ming@redhat.com>
1 parent 0bf966f commit 7783a29

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

cluster/v1beta1/types_placementdecision.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type ClusterDecision struct {
6161

6262
// Score is the computed score for the cluster based on configured prioritizers
6363
// +optional
64-
Score int64 `json:"score"`
64+
Score *int64 `json:"score,omitempty"`
6565
}
6666

6767
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

cluster/v1beta1/zz_generated.deepcopy.go

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)