Skip to content

Commit

Permalink
Incorperate feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Fox <[email protected]>
  • Loading branch information
kfox1111 committed Dec 21, 2023
1 parent 2a8054b commit c928888
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pkg/sidecar/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func (s *Sidecar) updateCertificates(svidResponse *workloadapi.X509Context) {
// 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)
byts, err := os.ReadFile(s.config.PidFileName)
if err != nil {
return fmt.Errorf("failed to read pid file: %s\n%w", s.config.PidFileName, err)
Expand All @@ -172,9 +171,9 @@ func (s *Sidecar) signalProcess() (err error) {
}
}
// TODO: is ReloadExternalProcess still used?
if s.config.Cmd != "" {
switch s.config.ReloadExternalProcess {
case nil:
switch s.config.ReloadExternalProcess {
case nil:
if s.config.Cmd != "" {
if atomic.LoadInt32(&s.processRunning) == 0 {
cmdArgs, err := getCmdArgs(s.config.CmdArgs)
if err != nil {
Expand All @@ -195,10 +194,10 @@ func (s *Sidecar) signalProcess() (err error) {
return err
}
}
default:
if err = s.config.ReloadExternalProcess(); err != nil {
return fmt.Errorf("error reloading external process: %w", err)
}
}
default:
if err = s.config.ReloadExternalProcess(); err != nil {
return fmt.Errorf("error reloading external process: %w", err)
}
}

Expand Down

0 comments on commit c928888

Please sign in to comment.