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 directory as option for createall command #2326

Merged

Conversation

maria
Copy link
Contributor

@maria maria commented Nov 12, 2014

Related with #1958 - #1958 (comment)

@maria
Copy link
Contributor Author

maria commented Nov 12, 2014

@mfojtik what do you think about this implementation?

@smarterclayton
Copy link
Contributor

@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>
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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")
Copy link
Contributor

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.

@ghodss
Copy link
Contributor

ghodss commented Nov 12, 2014

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.

@maria maria force-pushed the read-json-directories-as-object-streams branch from e6249df to 874ce5d Compare November 12, 2014 22:53
@maria maria changed the title [WIP] Add directory as option for createall command Add directory as option for createall command Nov 12, 2014
@maria
Copy link
Contributor Author

maria commented Nov 12, 2014

I updated the PR. Thanks for the feedback.

@brendandburns
Copy link
Contributor

LGTM.

brendandburns added a commit that referenced this pull request Nov 17, 2014
…ject-streams

Add directory as option for createall command
@brendandburns brendandburns merged commit f05c4a6 into kubernetes:master Nov 17, 2014
@smarterclayton
Copy link
Contributor

Hrm - I just realized that we added -d in here. I don't think we need more than -f since we can tell whether it's a directory at that time. We can remove -d when sam's stream options become available.

@maria maria deleted the read-json-directories-as-object-streams branch November 19, 2014 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants