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 ephemeral container to a running pod #34

Merged
merged 4 commits into from
Apr 25, 2022

Conversation

pablochacin
Copy link
Contributor

@pablochacin pablochacin commented Apr 21, 2022

Add function to Pods for creating an ephemeral container in a running pod.
Also added a function for creating a pod to facilitate testing.

Note: tested with K8s cluster 1.23.x. Previous versions may not work or may need enabling ephemeral containers feature gate

closes #30

Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@pablochacin pablochacin changed the title Add ephemeral container Add ephemeral container to a running pod Apr 21, 2022
@javaducky javaducky self-requested a review April 21, 2022 15:24
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@@ -17,12 +20,27 @@ func New(client *kubernetes.Clientset, metaOptions metav1.ListOptions, ctx conte
}
}

type ContainerOptions struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please include Go documentation on any public types and methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @javaducky I added some comments, but I'm not sure what conventions is the project following in this regard. Could you please point me to some examples I can use as a reference?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just standard documentation as described with godoc is fine. No need to worry about all the methods/types; just the new ones that you're adding.

We haven't been good at requiring this, but xk6-sql is an example where I added documentation. You can always use golint ./... to check your progress.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added documentation.

@javaducky
Copy link
Contributor

Confirmed create and add with Kube v1.22.7 (feature-gates=EphemeralContainers=true).

Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@javaducky javaducky merged commit 30a5c73 into grafana:main Apr 25, 2022
@javaducky
Copy link
Contributor

LGTM! Thank you @pablochacin .

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.

Add function to start an ephemeral container to a pod
2 participants