-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Handle incompatible automount token setting in service account YAML (#4651) #4757
Conversation
Hey @han-so1omon, Thanks for working on this! The inject test seems to fail because we were trying to de-reference a nil value which can be fixed by having a conditional check as in
but doing the above means that we would be setting the default value as false which was causing other problems. So, Rather than doing that we can store the pointer itself so that we can check for nil value directly as in https://github.com/linkerd/linkerd2/blob/main/pkg/inject/report.go#L93
|
@Pothulapati good point. I'll implement that today. |
@ihcsim @mayankshah1607 #4651 review this please |
@han-so1omon the changes look good, thanks for submitting this PR. Would you mind amending your commit to include a signature for the DCO? The contribution details for the DCO are here and you can read the statement here |
Following @alpeb 's comment - #4346 (comment) , do we want to issue a warning in this case instead of outright failing it? |
Do you think it is the responsibility of linkerd to validate unrelated service accounts for this commit? Since I do not see a simple way to perform a full validation of service accounts given the current
For With 2), I think that it is more clear that it is the responsibility of the program owner to correctly configure service accounts. If they will validate a service account with |
Hey @han-so1omon, I haven't looked the code in your PR but I did have some thoughts on the underlying issue that will probably affect how we want to proceed here. Take a look at #4651 (comment) and let me know what you think. |
@adleong I've responded in the thread you linked. Maybe switch this to a warning for now as suggested by @mayankshah1607 and @alpeb ? In the meantime of a more useful fix, a warning could be helpful. |
Handle incompatible automount token setting in service account YAML (#4651)
Following #4145 the
inject
command will return an error with pods YAML that has theautomountServiceAccountToken
property set tofalse
. The same validation should be applied to service accounts YAML. E.g.,linkerd inject
should return an error with the following YAML:Now instead of skipping service account YAML,
inject
throws an error whenautomountServiceAccountToken
isfalse
. Using the YAML above:Fixes #4651