From 50ba8eda6a474bbec71ee4034a8392a38645f874 Mon Sep 17 00:00:00 2001 From: Amit Sahastrabuddhe Date: Sat, 16 Mar 2024 10:07:10 +0530 Subject: [PATCH] handle nil annotation --- pkg/cloud/services/eks/oidc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cloud/services/eks/oidc.go b/pkg/cloud/services/eks/oidc.go index ab23395b1f..2585237f84 100644 --- a/pkg/cloud/services/eks/oidc.go +++ b/pkg/cloud/services/eks/oidc.go @@ -53,6 +53,9 @@ func (s *Service) reconcileOIDCProvider(cluster *eks.Cluster) error { } s.scope.ControlPlane.Status.OIDCProvider.ARN = oidcProvider anno := s.scope.ControlPlane.GetAnnotations() + if anno == nil { + anno = make(map[string]string) + } anno["aws.spectrocloud.com/oidcProviderArn"] = oidcProvider s.scope.ControlPlane.SetAnnotations(anno) if err := s.scope.PatchObject(); err != nil {