|
|
@ -18,6 +18,7 @@ package chartutil
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
@ -468,6 +469,12 @@ spec:
|
|
|
|
restartPolicy: Never
|
|
|
|
restartPolicy: Never
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Stderr is an io.Writer to which error messages can be written
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// In Helm 4, this will be replaced. It is needed in Helm 3 to preserve API backward
|
|
|
|
|
|
|
|
// compatibility.
|
|
|
|
|
|
|
|
var Stderr io.Writer = os.Stderr
|
|
|
|
|
|
|
|
|
|
|
|
// CreateFrom creates a new chart, but scaffolds it from the src chart.
|
|
|
|
// CreateFrom creates a new chart, but scaffolds it from the src chart.
|
|
|
|
func CreateFrom(chartfile *chart.Metadata, dest, src string) error {
|
|
|
|
func CreateFrom(chartfile *chart.Metadata, dest, src string) error {
|
|
|
|
schart, err := loader.Load(src)
|
|
|
|
schart, err := loader.Load(src)
|
|
|
@ -601,8 +608,8 @@ func Create(name, dir string) (string, error) {
|
|
|
|
|
|
|
|
|
|
|
|
for _, file := range files {
|
|
|
|
for _, file := range files {
|
|
|
|
if _, err := os.Stat(file.path); err == nil {
|
|
|
|
if _, err := os.Stat(file.path); err == nil {
|
|
|
|
// File exists and is okay. Skip it.
|
|
|
|
// There is no handle to a preferred output stream here.
|
|
|
|
continue
|
|
|
|
fmt.Fprintf(Stderr, "WARNING: File %q already exists. Overwriting.\n", file.path)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if err := writeFile(file.path, file.content); err != nil {
|
|
|
|
if err := writeFile(file.path, file.content); err != nil {
|
|
|
|
return cdir, err
|
|
|
|
return cdir, err
|
|
|
|