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

Add an option to exit on success #116

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Conversation

kfox1111
Copy link
Contributor

This PR allows the spiffe-helper to exit 0 after certificates have been retrieved. This can be used in conjunction with Kubernetes initContainers to ensure certificates are retrieved before running the spiffe-helper as a sidecar container.

Partially implements: #115

Signed-off-by: Kevin Fox <Kevin.Fox@pnnl.gov>
@faisal-memon
Copy link
Collaborator

Hi @kfox1111 Thanks for the submission. This covers the x509 case. Should the jwt path also have the exit on success?

@faisal-memon faisal-memon added this to the 0.8.0 milestone Dec 20, 2023
@kfox1111
Copy link
Contributor Author

Hi @kfox1111 Thanks for the submission. This covers the x509 case. Should the jwt path also have the exit on success?

Oh, that would be useful too, yeah. I'll see if I can find the other path and update it.

@kfox1111
Copy link
Contributor Author

Actually, I'm confused by how the jwt stuff is working...

I only see one exec.Command used:

$ grep -r exec.Command
pkg/sidecar/sidecar.go:			cmd := exec.Command(s.config.Cmd, cmdArgs...) // #nosec

In the signalProcess method. Which seems to only ever be called in method:

func (s *Sidecar) updateCertificates(svidResponse *workloadapi.X509Context) {

Does the jwt support not support cmds/signals?

@faisal-memon faisal-memon modified the milestones: 0.8.0, 0.9.0 Dec 20, 2023
@keeganwitt
Copy link
Contributor

Maybe we should have separate exit configs (one for JWT and one for X509) for now?

@keeganwitt
Copy link
Contributor

Maybe we should have separate exit configs (one for JWT and one for X509) for now?

It was decided in discussions not to hold this MR up for this and handle separately. Created #121 for this.

@faisal-memon faisal-memon merged commit d2ba9a2 into spiffe:main Dec 20, 2023
12 checks passed
@keeganwitt
Copy link
Contributor

The README never got updated for this feature.

@kfox1111 kfox1111 mentioned this pull request Dec 22, 2023
@kfox1111 kfox1111 deleted the exit-when-ready branch January 10, 2024 16:09
@faisal-memon faisal-memon removed this from the 0.9.0 milestone Nov 21, 2024
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.

3 participants