From 7320446bff4eb743c56d3a9ddbb7f0c62ea973a0 Mon Sep 17 00:00:00 2001 From: Jan Sykora Date: Mon, 15 Apr 2024 09:50:39 +0200 Subject: [PATCH] fix: nil pointer in advanced config --- castai/resource_eviction_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/castai/resource_eviction_config.go b/castai/resource_eviction_config.go index 95af9c26..37465267 100644 --- a/castai/resource_eviction_config.go +++ b/castai/resource_eviction_config.go @@ -498,7 +498,7 @@ func flattenPodSelector(ps *sdk.CastaiEvictorV1PodSelector) []map[string]any { if ps.Namespace != nil { out[FieldPodSelectorNamespace] = *ps.Namespace } - if ps.LabelSelector.MatchLabels != nil { + if ps.LabelSelector != nil && ps.LabelSelector.MatchLabels != nil { out[FieldMatchLabels] = ps.LabelSelector.MatchLabels.AdditionalProperties } if ps.LabelSelector.MatchExpressions != nil {