Skip to content

Commit

Permalink
manifests: schedparams: fix JSON serialization
Browse files Browse the repository at this point in the history
Fix JSON struct tags to proper (de)serialization,
mostly for better test troubleshoot experience.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Mar 20, 2024
1 parent bdb83e7 commit b41c644
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/manifests/schedparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b41c644

Please sign in to comment.