-
Notifications
You must be signed in to change notification settings - Fork 43
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
Warnings about ignored settings when daemon_mode=false #254
Merged
Conversation
This file contains 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
e813483
to
01da7bd
Compare
Presently spiffe-helper ignores the settings cmd, pid_file_name and renew_signal silently if daemon_mode=false. This could lead to misconfiguration where the helper is not doing what the user expects. It also makes it more difficult to give these options a meaning in non-daemon (one-shot) mode in future, if existing user configurations might contain invalid uses of them that presently have no effect. Raise an error if pid_file_name is configured with daemon_mode=false. This option is new and isn't documented yet so the risk of people having configurations that set it and daemon_mode=false is minimal. For cmd and renew_signal, log a warning if daemon_mode=false instead. There could be existing misconfigurations for these in the wild that we don't want to break by making working-but-incorrect configuration fail with a fatal validation error instead.
01da7bd
to
4e96a59
Compare
faisal-memon
reviewed
Feb 4, 2025
faisal-memon
reviewed
Feb 4, 2025
faisal-memon
reviewed
Feb 4, 2025
faisal-memon
reviewed
Feb 4, 2025
Thanks @ringerc for catching these. |
Signed-off-by: Faisal Memon <[email protected]>
Signed-off-by: Faisal Memon <[email protected]>
Signed-off-by: Faisal Memon <[email protected]>
Signed-off-by: Faisal Memon <[email protected]>
faisal-memon
approved these changes
Feb 9, 2025
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.
Presently
spiffe-helper
ignores the settingscmd
,pid_file_name
andrenew_signal
silently ifdaemon_mode=false
.This could lead to mis-configuration where the helper is not doing what the user expects. It also makes it more difficult to give these options a meaning in non-daemon (one-shot) mode in future, if existing user configurations might contain invalid uses of them that presently have no effect.
Raise an error if
pid_file_name
is configured withdaemon_mode=false
. This option is new and isn't documented yet so the risk of people having configurations that set it anddaemon_mode=false
is minimal.For
cmd
andrenew_signal
, log a warning ifdaemon_mode=false
instead. There could be existing mis-configurations for these in the wild that we don't want to break by making working-but-incorrect configuration fail with a fatal validation error instead.The docs PR #243 adds documentation for the various run modes, including that
cmd
,pid_file_name
andrenew_signal
are nonsensical whendaemon_mode=false
.Test
Unit test cover added for
pid_file_name
nonempty +renew_signal
nonempty configuration indaemon_mode=true
(default) to show this wasn't broken by these changespid_file_name
nonempty andrenew_signal
empty raises errorpid_file_name
empty andrenew_signal
nonempty is not an error because it could be used forcmd
A warning is emitted when
cmd
and/orrenew_signal
are set in !daemon_mode but execution continues (until it can't reach the agent since I'm not running one):Setting
pid_file_name
with !daemon_mode becomes a fatal error as shown in the updated unit test cover, andI did not add unit test cover for the new log messages, as the existing unit tests don't capture logs and I wasn't sure how best to do that. But the error has test cover.