-
Notifications
You must be signed in to change notification settings - Fork 40k
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 directory as option for createall command #2326
Add directory as option for createall command #2326
Conversation
@mfojtik what do you think about this implementation? |
@ghodss had started working on this as well (the object stream work) - I don't know how far he's gotten, but it would be useful to converge between you two. |
|
||
JSON and YAML formats are accepted. | ||
|
||
Examples: | ||
$ kubectl createall -d configs/ | ||
<creates all resources listed in JSON files under the configs directory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we support json or yaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. My first draft was with YAML also. I will update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be made clear in the documentation whether the search for files in the directory is recursive or not.
} | ||
} | ||
}, | ||
} | ||
cmd.Flags().StringP("directory", "d", "", "Directory of JSON files to use to update the resource") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON/YAML distinction should be updated here as well.
I think createall needs to be merged back into create relatively soon, with the create command expanding to support an arbitrary number and type of objects. In the mean time this seems like a reasonable addition, but this will likely get rewritten (or at least, moved) when we have a core library that gathers objects from an arbitrary selector (file, directory, etc.) and puts them into an object stream. But I don't see any issues with adding this for now, as long as we don't mind refactoring the interface shortly. |
e6249df
to
874ce5d
Compare
I updated the PR. Thanks for the feedback. |
LGTM. |
…ject-streams Add directory as option for createall command
Hrm - I just realized that we added |
Related with #1958 - #1958 (comment)