From b41c6445ca2dc66bfef7eb4833154c8867595b8d Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Wed, 20 Mar 2024 09:39:55 +0100 Subject: [PATCH] manifests: schedparams: fix JSON serialization Fix JSON struct tags to proper (de)serialization, mostly for better test troubleshoot experience. Signed-off-by: Francesco Romani --- pkg/manifests/schedparams.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/manifests/schedparams.go b/pkg/manifests/schedparams.go index 435350ff..ffd06a99 100644 --- a/pkg/manifests/schedparams.go +++ b/pkg/manifests/schedparams.go @@ -157,10 +157,11 @@ func SetDefaultsLeaderElection(lep *LeaderElectionParams) { } type ConfigParams struct { - ProfileName string // can't be empty, so no need for pointer - Cache *ConfigCacheParams - ScoringStrategy *ScoringStrategyParams - LeaderElection *LeaderElectionParams + // can't be empty, so no need for pointer + ProfileName string `json:"profileName"` + Cache *ConfigCacheParams `json:"cache"` + ScoringStrategy *ScoringStrategyParams `json:"scoringStrategy,omitempty"` + LeaderElection *LeaderElectionParams `json:"leaderElection"` } func DecodeSchedulerProfilesFromData(data []byte) ([]ConfigParams, error) {