Skip to content

Commit 3fc03e3

Browse files
committed
fix: omit PlacementDecision score field when zero-valued
Add omitzero json tag to ClusterDecision.Score so that the default zero value is not serialized to JSON. The field remains int64 (non-pointer) and is only included when explicitly set to a non-zero value. Signed-off-by: Mike Ng <ming@redhat.com>
1 parent 0bf966f commit 3fc03e3

1 file changed

Lines changed: 1 addition & 1 deletion

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,omitzero"`
6565
}
6666

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

0 commit comments

Comments
 (0)