Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cloud/scope/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ func sessionForClusterWithRegion(k8sClient client.Client, clusterScoper cloud.Cl
_, err := providers[0].Retrieve()
if err != nil {
conditions.MarkUnknown(clusterScoper.InfraCluster(), infrav1.PrincipalCredentialRetrievedCondition, infrav1.CredentialProviderBuildFailedReason, err.Error())

// delete the existing session from cache. Otherwise, we give back a defective session on next method invocation with same cluster scope
sessionCache.Delete(getSessionName(region, clusterScoper))

return nil, nil, errors.Wrap(err, "Failed to retrieve identity credentials")
}
awsConfig = awsConfig.WithCredentials(credentials.NewChainCredentials(awsProviders))
Expand Down