mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
640 B
30 lines
640 B
9 years ago
|
package kubectl
|
||
|
|
||
|
// Create uploads a chart to Kubernetes
|
||
|
func (r RealRunner) Create(stdin []byte, ns string) ([]byte, error) {
|
||
|
args := []string{"create", "-f", "-"}
|
||
|
|
||
|
if ns != "" {
|
||
|
args = append([]string{"--namespace=" + ns}, args...)
|
||
|
}
|
||
|
|
||
|
cmd := command(args...)
|
||
|
assignStdin(cmd, stdin)
|
||
|
|
||
|
return cmd.CombinedOutput()
|
||
|
}
|
||
|
|
||
|
// Create returns the commands to kubectl
|
||
|
func (r PrintRunner) Create(stdin []byte, ns string) ([]byte, error) {
|
||
|
args := []string{"create", "-f", "-"}
|
||
|
|
||
|
if ns != "" {
|
||
|
args = append([]string{"--namespace=" + ns}, args...)
|
||
|
}
|
||
|
|
||
|
cmd := command(args...)
|
||
|
assignStdin(cmd, stdin)
|
||
|
|
||
|
return []byte(cmd.String()), nil
|
||
|
}
|