File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ func (s *Service) reconcileOIDCProvider(cluster *eks.Cluster) error {
5252 return errors .Wrap (err , "failed to create OIDC provider" )
5353 }
5454 s .scope .ControlPlane .Status .OIDCProvider .ARN = oidcProvider
55+ anno := s .scope .ControlPlane .GetAnnotations ()
56+ anno ["aws.spectrocloud.com/oidcProviderArn" ] = oidcProvider
57+ s .scope .ControlPlane .SetAnnotations (anno )
5558 if err := s .scope .PatchObject (); err != nil {
5659 return errors .Wrap (err , "failed to update control plane with OIDC provider ARN" )
5760 }
@@ -134,11 +137,18 @@ func (s *Service) reconcileTrustPolicy() error {
134137}
135138
136139func (s * Service ) deleteOIDCProvider () error {
137- if ! s .scope .ControlPlane .Spec .AssociateOIDCProvider || s .scope .ControlPlane .Status .OIDCProvider .ARN == "" {
140+ anno := s .scope .ControlPlane .GetAnnotations ()
141+ arn := anno ["aws.spectrocloud.com/oidcProviderArn" ]
142+
143+ if arn == "" {
144+ arn = s .scope .ControlPlane .Status .OIDCProvider .ARN
145+ }
146+
147+ if ! s .scope .ControlPlane .Spec .AssociateOIDCProvider || arn == "" {
138148 return nil
139149 }
140150
141- providerARN := s . scope . ControlPlane . Status . OIDCProvider . ARN
151+ providerARN := arn
142152 if err := s .DeleteOIDCProvider (& providerARN ); err != nil {
143153 return errors .Wrap (err , "failed to delete OIDC provider" )
144154 }
You can’t perform that action at this time.
0 commit comments