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

Feat: Support Running Sidecar with a Command. #2449

Merged
merged 4 commits into from
Dec 23, 2024

Conversation

tabbyl21
Copy link
Contributor

This PR addresses issue #2448 . Some containers may not have entry points, if this is the case they would need to be run using a command. This change extends the definition of sidecar so that there is an optional command field. If the field is present then the container will be run using that command. This is a two line change that is fully backward compatible.

This PR addresses issue zalando#2448 . Some containers may not have entry points, if this is the case they would need to be run using a command. This change extends the definition of sidecar so that there is an optional command field. If the field is present then the container will be run using that command. This is a two line change that is fully backward compatible.
@tabbyl21
Copy link
Contributor Author

Hi @Jan-M @jopadi ,

I am wondering what I need to do to get this PR accepted into your project! I believe I have followed the guidelines from the ReadME to the extent its applicable! Please let me know if there is anything else I need to add!

Thank you for your time,
Tabatha

@AleksandrPaul
Copy link

Hi @Jan-M , @sdudoladov , @FxKu , @idanovinda , @hughcapet, @jopadi

Could you please review this PR?

@sgielen
Copy link

sgielen commented Aug 6, 2024

Hi @FxKu could you please review this PR? It is similar to a PR you recently reviewed. Thanks

@tabbyl21 tabbyl21 changed the title Feat: Support Running Sidecar with a Command. minor: Support Running Sidecar with a Command. Sep 13, 2024
@tabbyl21 tabbyl21 changed the title minor: Support Running Sidecar with a Command. Feat: Support Running Sidecar with a Command. Sep 13, 2024
@kamenskiyyyy
Copy link

Any updates?

@@ -220,6 +220,7 @@ type Sidecar struct {
DockerImage string `json:"image,omitempty"`
Ports []v1.ContainerPort `json:"ports,omitempty"`
Env []v1.EnvVar `json:"env,omitempty"`
Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"`
Copy link
Member

Choose a reason for hiding this comment

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

why is protobuf:"bytes,3,rep,name=command" necessary? We have it nowhere else. Is it similar to filter inputs using pattern in the CRD schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies just seeing this comment. I can remove that part

@FxKu
Copy link
Member

FxKu commented Nov 4, 2024

@tabbyl21 sorry for not reacting for a looong time. We are usually a bit reluctant to changes that offer more config mean and adding complexity. After taking a closer look I get now why this change is needed. Being able to run any command via sidecar just sounded too scary to me first (well, maybe because it is). If you could answer my one question we could merge it then.

Try to run codegen (./hack/update-codegen.sh) to see if something changes.

@FxKu FxKu added the minor label Nov 4, 2024
@FxKu FxKu added this to the 1.14.0 milestone Nov 4, 2024
@icc-garciaju
Copy link

One question here.
Why only "command" and not include "args" too?

@sgielen
Copy link

sgielen commented Dec 16, 2024

One question here. Why only "command" and not include "args" too?

It is a []string so it includes the args, too

@tabbyl21
Copy link
Contributor Author

@FxKu apologies didn't see your repsonses! I have addressed your comment! Let me know what changes need to be made to merge this in!

@tabbyl21 tabbyl21 requested a review from FxKu December 16, 2024 21:04
@FxKu
Copy link
Member

FxKu commented Dec 17, 2024

Thanks @tabbyl21 for coming back. Can you check if the new field can be covered by a unit test? I'm not sure how much coverage we have there for sidecars. And it would be nice if the new command possibility can be included in our sidecar documentation.

@hughcapet
Copy link
Member

👍

@FxKu
Copy link
Member

FxKu commented Dec 23, 2024

👍

@FxKu FxKu merged commit b276cd2 into zalando:master Dec 23, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants