Repository navigation
Conversation
…E nodes - Ask service-discover service pending-setup about every script before running it: when service-discover registers the service itself (SPIRE nodes) the script is not run; exit status 10, or a service-discover without the command, runs the script as before. - Ask for the cluster credentials only when a script that runs needs them, since SPIRE agents have none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: CO-4843 / CO-4837. Companion of zextras/service-discover#190.
Problem
On SPIRE agents (joined without the cluster credentials) there is no bootstrap token:
pending-setupscalledservice-discover bootstrap-token --setupupfront and exited on failure, and the package scripts use the root token to create policies and tokens.Choice
Packages and their scripts are unchanged. service-discover now registers the services centrally, so the fix is in this wrapper and decided by service-discover:
service-discover service pending-setup <script>: exit 0 = handled (the script is moved todone/without running), exit 10 = run the script as before, other = failure (the script is kept);set-*, need no cluster credentials);--help) or the node doesn't use SPIRE, the behaviour is the old one.This was preferred over detecting SPIRE here (duplicates service-discover's knowledge of which scripts it replaces) or over making
bootstrap-tokensucceed on agents (would leak the problem into the scripts).Checks
shellcheck package/pending-setups.shclean. Exercisedexecute_scriptwith a stubbedservice-discover: handled (0, not run, moved), run (10, ran with token, moved), failure (3, kept), old binary without the command (ran with token, moved). Not run on a real node. Side effect: the credentials prompt now appears when the first script that needs it runs, not before the menu.