-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't fail when unable to find default SA token secret #1634
Conversation
defaultSecret, err := findDefaultServiceAccount(ctx, sa, conn) | ||
if err != nil { | ||
return nil, fmt.Errorf("Failed to discover the default service account token: %s", err) | ||
log.Printf("[WARN] Failed to discover the default service account token: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps should be a warning diagnostic to tell the user this has happened, rather than simply a log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was also considering that as an option. Let's do that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arybolovlev This works great! thanks for picking this up!
Can't approve as I'm the one who created the PR. We need @jrhouston to have a look.
f4c68cf
to
1e165d9
Compare
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Both the
kubernetes_service_account
datasource and resource contain a conveniece attribute to expose the default service account created automatically by the cluster along with the SA. The check for the secret to be deemed the "default" one, includes a matching of the creation timestamps between the SA and the associated Secret.It's a valid scenario for the default token secret of a Service Account to be replaced throughout the lifecycle of the SA.
When this default secret is deleted, the cluster automatically generates a new one and updates the SA accordingly.
The provider should not fail when the default token is no longer available.
Description
Acceptance tests
Output from acceptance testing:
Release Note
Release note for CHANGELOG:
References
Fixes #1104
Community Note