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

Added Apply functions #21

Merged
merged 2 commits into from
Feb 25, 2022
Merged

Added Apply functions #21

merged 2 commits into from
Feb 25, 2022

Conversation

zv0n
Copy link
Contributor

@zv0n zv0n commented Feb 18, 2022

I have added Apply function to Kubernetes classes. This function tries to parse a provided YAML string and if the type of the parsed object is the same as the class, the function creates the object on the Kubernetes server.

I have added this change because I could not figure out how to pass Kubernetes objects to the Create function through javascript.

@javaducky
Copy link
Contributor

Hello @zv0n. Thank you so much for your contribution!

I'm taking a look at reviewing and wondered if you could do us the favor of including example scripts along with these changes?

Thank you!

@zv0n
Copy link
Contributor Author

zv0n commented Feb 25, 2022

Hi @javaducky, I've added the examples. I made a single js file for deployment, service, and ingress because to me it seemed to make more sense than creating e.g. an ingress without having an existing service. I can however split the file into 3 separate ones if you'd prefer that.

@javaducky
Copy link
Contributor

Thank you for adding that so quickly!

Having the combined examples are fine; no need to fully separate. In the future, we'll get some unit tests added around all this functionality which can have broken out test cases, but for now, this is awesome! Using the YAML config definitely feels more appropriate than attempting object creation with javascript syntax 😄.

Copy link
Contributor

@javaducky javaducky left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank you @zv0n for your initial contribution! This definitely makes it easier for folks to create necessary objects when running a test.

@javaducky javaducky merged commit 796492f into grafana:main Feb 25, 2022
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.

None yet

2 participants