Skip to content
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

agent: Fix assignment of error when auto-reloading cert and key file changes. #15769

Merged
merged 2 commits into from
Dec 12, 2022

Conversation

jmurret
Copy link
Member

@jmurret jmurret commented Dec 12, 2022

Description

For both the key and cert file watcher code, a call to a.configFileWatcher.Replace() is made but the error returned from this called is not used...but a check is right below it like this:

				a.configFileWatcher.Replace(f.oldCfg.KeyFile, f.newCfg.KeyFile)
				if err != nil {
					return err
				}

This seems to be an omission rather than strategic. In its current case, this will either check on a previous error, or will never get triggered because a previous check would have exited.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • not a security concern

@jmurret jmurret mentioned this pull request Dec 12, 2022
26 tasks
@jmurret jmurret changed the title Adding the setting of errors missing in config file watcher code in agent. Adding the setting of errors missing in key and cert file watcher code in agent. Dec 12, 2022
@jmurret jmurret changed the title Adding the setting of errors missing in key and cert file watcher code in agent. agent: Fix assignment of error when auto-reloading cert and key file changes. Dec 12, 2022
@jmurret jmurret marked this pull request as ready for review December 12, 2022 18:50
Copy link
Collaborator

@dhiaayachi dhiaayachi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for extracting this @jmurret, LGTM!

Do you think we should backport this to 1.14,1.13 and 1.12? I think it's self contained enough to be considered.

@jmurret
Copy link
Member Author

jmurret commented Dec 12, 2022

@dhiaayachi Agree. Will backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants