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(cli): skip export dir-empty check #314

Merged
merged 2 commits into from
Jul 6, 2020
Merged

feat(cli): skip export dir-empty check #314

merged 2 commits into from
Jul 6, 2020

Conversation

sh0rez
Copy link
Member

@sh0rez sh0rez commented Jul 6, 2020

Adds a --force flag to tk export to skip the check that makes sure
the output dir is empty.

This can be used to merge resources of multiple environments into a
single tree

Adds a `--force` flag to `tk export` to skip the check that makes sure
the output dir is empty.

This can be used to merge resources of multiple environments into a
single tree
@sh0rez sh0rez added kind/feature Something new should be added component/cli Command Line Interface labels Jul 6, 2020
@sh0rez sh0rez requested a review from captncraig July 6, 2020 20:18
@captncraig
Copy link
Contributor

It is possible there is a case for slightly more nuanced checks here:

Assume I am exporting a bunch of different environments into a tree like {cluster}/{namespace}/{kind}-{name}.yml

What should export do if multiple environments try to make the same file? I can see 3 options (there may be more):

  1. Silently write the file, overwriting anything there (this PR currently)
  2. Error if a specific file already exists (enforces that only one env can create each object)
  3. Error if the file already exists, and the contents are different than what I want to write there (multiple envs can manage the same object, but must all be the same).

I think number 3 is probably madness. 2 Could be a nice safety net to enforce 1 env per object.

@sh0rez sh0rez merged commit a1df9fa into master Jul 6, 2020
@sh0rez sh0rez deleted the joined-export branch July 6, 2020 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cli Command Line Interface kind/feature Something new should be added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants