Skip to content

Commit

Permalink
fix: 2nd nil pointer in advanced config (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
jansyk13 authored Apr 15, 2024
1 parent 2875bfe commit ba01814
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions castai/resource_eviction_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,13 @@ func flattenPodSelector(ps *sdk.CastaiEvictorV1PodSelector) []map[string]any {
if ps.Namespace != nil {
out[FieldPodSelectorNamespace] = *ps.Namespace
}
if ps.LabelSelector != nil && ps.LabelSelector.MatchLabels != nil {
out[FieldMatchLabels] = ps.LabelSelector.MatchLabels.AdditionalProperties
}
if ps.LabelSelector.MatchExpressions != nil {
out[FieldMatchExpressions] = flattenMatchExpressions(*ps.LabelSelector.MatchExpressions)
if ps.LabelSelector != nil {
if ps.LabelSelector.MatchLabels != nil {
out[FieldMatchLabels] = ps.LabelSelector.MatchLabels.AdditionalProperties
}
if ps.LabelSelector.MatchExpressions != nil {
out[FieldMatchExpressions] = flattenMatchExpressions(*ps.LabelSelector.MatchExpressions)
}
}
return []map[string]any{out}
}
Expand Down

0 comments on commit ba01814

Please sign in to comment.