Skip to content

Commit

Permalink
fix: don't create empty labels selector object when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jansyk13 committed Apr 19, 2024
1 parent 7a0b7ef commit 8f9f077
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 16 deletions.
4 changes: 4 additions & 0 deletions castai/resource_eviction_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ func toPodSelector(in interface{}) (*sdk.CastaiEvictorV1PodSelector, error) {
return nil, err
}

if mls == nil || len(mls.AdditionalProperties) == 0 {
continue
}

if out.LabelSelector == nil {
out.LabelSelector = &sdk.CastaiEvictorV1LabelSelector{}
}
Expand Down
2 changes: 1 addition & 1 deletion castai/resource_rebalancing_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func getRebalancingJobByScheduleName(ctx context.Context, client *sdk.ClientWith
return nil, fmt.Errorf("getting schedule: %w", err)
}

resp, err := client.ScheduledRebalancingAPIListRebalancingJobsWithResponse(ctx, clusterID)
resp, err := client.ScheduledRebalancingAPIListRebalancingJobsWithResponse(ctx, clusterID, &sdk.ScheduledRebalancingAPIListRebalancingJobsParams{})
if checkErr := sdk.CheckOKResponse(resp, err); checkErr != nil {
return nil, checkErr
}
Expand Down
5 changes: 5 additions & 0 deletions castai/sdk/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 27 additions & 7 deletions castai/sdk/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions castai/sdk/mock/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8f9f077

Please sign in to comment.