Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Dry run option #145

Closed
mariusgrigoriu opened this issue Jun 20, 2018 · 9 comments
Closed

Dry run option #145

mariusgrigoriu opened this issue Jun 20, 2018 · 9 comments

Comments

@mariusgrigoriu
Copy link
Contributor

I'm wondering if there's interest (or opposition) to an optional parameter to k8s_object that would set the --dry-run flag to kubectl. This flag would be useful to validate your objects early in a long-running pipeline, so you don't have to wait until all your infrastructure is up only to find out you have malformed YAML or JSON.

@Globegitter
Copy link
Contributor

Yeah it would be nice to have the option for a dry-run, but I wonder if that would be nicer to just be able to pass on at the end of bazel run. So bazel run :target.apply -- --dry-run, otherwise one would have to modify the BUILD file all the time, or have one target for a dry-run and another one for the real apply.

@chrislovecnm
Copy link
Contributor

I would rather not modify a BUILD file to get this to run ...

@mariusgrigoriu
Copy link
Contributor Author

Definitely not expecting to modify BUILD file every time you want to turn dry runs on/off. The original idea was to connect the arg to a make variable, but I do like @Globegitter's idea.

@mariusgrigoriu
Copy link
Contributor Author

Oh and there's a new dry-run feature coming in kubectl

@chrislovecnm
Copy link
Contributor

This PR will allow us to pass in arbitrary commands #174

Would that help us out??

@Globegitter
Copy link
Contributor

Yep #174 could indeed fix the issue - I left a comment: #174 (comment) as the $@ in the apply.sh.tpl would have to be moved after the apply keyword. But then it does indeed work very nicely.

@chrislovecnm
Copy link
Contributor

Can we override arg in a build file rather than a $@?

@Globegitter
Copy link
Contributor

Globegitter commented Oct 29, 2018

@chrislovecnm I just mentioned it in #209 if we name the attribute args then we can set it both in the build file (and bazel will apply the flags at runtime) and via the cli at the end as I showed above.

@chrislovecnm
Copy link
Contributor

Closing, as we have this in master now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants