-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add support for signaling an external process via pid file #118
base: main
Are you sure you want to change the base?
Conversation
Hi @kfox1111 Thanks for the submission. The linter is complaining about |
pkg/sidecar/sidecar.go
Outdated
@@ -153,6 +155,22 @@ func (s *Sidecar) updateCertificates(svidResponse *workloadapi.X509Context) { | |||
// signalProcess sends the configured Renew signal to the process running the proxy | |||
// to reload itself so that the proxy uses the new SVID | |||
func (s *Sidecar) signalProcess() (err error) { | |||
if s.config.PidFileName != "" { | |||
atomic.StoreInt32(&s.processRunning, 1) |
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.
why 1 is required inside processRunning?
it looks like it is to avoid if that is set bellow,
if that is the case I think we msut avoid this in order to simply the code and add this if as part of the switch, and run a signal there...
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.
Yeah. Really wasn't sure how to redo that switch, when honestly I wasn't exactly sure how it was working to begin with. Setting it to 1 let it fall through to the right path.
How should this be reworked?
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.
I took a stab at reworking it.
pkg/sidecar/sidecar.go
Outdated
err = cmd.Start() | ||
if err != nil { | ||
return fmt.Errorf("error executing process: %v\n%w", s.config.Cmd, err) | ||
if s.config.Cmd != "" { |
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.
Move inside case nil
Checking back in on this functionality. How do we get it moving again? |
@kfox1111 Sorry for letting this slip.
|
e689b7f
to
cbe340b
Compare
Signed-off-by: Kevin Fox <[email protected]>
cbe340b
to
8742213
Compare
Signed-off-by: Faisal Memon <[email protected]>
Signed-off-by: Faisal Memon <[email protected]>
Partially implements: #115