update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
42
vendor/helm.sh/helm/v3/pkg/action/install.go
vendored
42
vendor/helm.sh/helm/v3/pkg/action/install.go
vendored
@@ -55,7 +55,7 @@ import (
|
||||
"helm.sh/helm/v3/pkg/storage/driver"
|
||||
)
|
||||
|
||||
// NOTESFILE_SUFFIX that we want to treat special. It goes through the templating engine
|
||||
// notesFileSuffix that we want to treat special. It goes through the templating engine
|
||||
// but it's not a yaml file (resource) hence can't have hooks, etc. And the user actually
|
||||
// wants to see this file after rendering in the status command. However, it must be a suffix
|
||||
// since there can be filepath in front of it.
|
||||
@@ -69,11 +69,14 @@ type Install struct {
|
||||
|
||||
ChartPathOptions
|
||||
|
||||
ClientOnly bool
|
||||
Force bool
|
||||
CreateNamespace bool
|
||||
DryRun bool
|
||||
DryRunOption string
|
||||
ClientOnly bool
|
||||
Force bool
|
||||
CreateNamespace bool
|
||||
DryRun bool
|
||||
DryRunOption string
|
||||
// HideSecret can be set to true when DryRun is enabled in order to hide
|
||||
// Kubernetes Secrets in the output. It cannot be used outside of DryRun.
|
||||
HideSecret bool
|
||||
DisableHooks bool
|
||||
Replace bool
|
||||
Wait bool
|
||||
@@ -90,6 +93,8 @@ type Install struct {
|
||||
Atomic bool
|
||||
SkipCRDs bool
|
||||
SubNotes bool
|
||||
HideNotes bool
|
||||
SkipSchemaValidation bool
|
||||
DisableOpenAPIValidation bool
|
||||
IncludeCRDs bool
|
||||
Labels map[string]string
|
||||
@@ -105,7 +110,9 @@ type Install struct {
|
||||
// Used by helm template to add the release as part of OutputDir path
|
||||
// OutputDir/<ReleaseName>
|
||||
UseReleaseName bool
|
||||
PostRenderer postrender.PostRenderer
|
||||
// TakeOwnership will ignore the check for helm annotations and take ownership of the resources.
|
||||
TakeOwnership bool
|
||||
PostRenderer postrender.PostRenderer
|
||||
// Lock to control raceconditions when the process receives a SIGTERM
|
||||
Lock sync.Mutex
|
||||
}
|
||||
@@ -230,6 +237,11 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma
|
||||
}
|
||||
}
|
||||
|
||||
// HideSecret must be used with dry run. Otherwise, return an error.
|
||||
if !i.isDryRun() && i.HideSecret {
|
||||
return nil, errors.New("Hiding Kubernetes secrets requires a dry-run mode")
|
||||
}
|
||||
|
||||
if err := i.availableName(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -289,19 +301,19 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma
|
||||
IsInstall: !isUpgrade,
|
||||
IsUpgrade: isUpgrade,
|
||||
}
|
||||
valuesToRender, err := chartutil.ToRenderValues(chrt, vals, options, caps)
|
||||
valuesToRender, err := chartutil.ToRenderValuesWithSchemaValidation(chrt, vals, options, caps, i.SkipSchemaValidation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if driver.ContainsSystemLabels(i.Labels) {
|
||||
return nil, fmt.Errorf("user suplied labels contains system reserved label name. System labels: %+v", driver.GetSystemLabels())
|
||||
return nil, fmt.Errorf("user supplied labels contains system reserved label name. System labels: %+v", driver.GetSystemLabels())
|
||||
}
|
||||
|
||||
rel := i.createRelease(chrt, vals, i.Labels)
|
||||
|
||||
var manifestDoc *bytes.Buffer
|
||||
rel.Hooks, manifestDoc, rel.Info.Notes, err = i.cfg.renderResources(chrt, valuesToRender, i.ReleaseName, i.OutputDir, i.SubNotes, i.UseReleaseName, i.IncludeCRDs, i.PostRenderer, interactWithRemote, i.EnableDNS)
|
||||
rel.Hooks, manifestDoc, rel.Info.Notes, err = i.cfg.renderResources(chrt, valuesToRender, i.ReleaseName, i.OutputDir, i.SubNotes, i.UseReleaseName, i.IncludeCRDs, i.PostRenderer, interactWithRemote, i.EnableDNS, i.HideSecret)
|
||||
// Even for errors, attach this if available
|
||||
if manifestDoc != nil {
|
||||
rel.Manifest = manifestDoc.String()
|
||||
@@ -335,7 +347,11 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma
|
||||
// deleting the release because the manifest will be pointing at that
|
||||
// resource
|
||||
if !i.ClientOnly && !isUpgrade && len(resources) > 0 {
|
||||
toBeAdopted, err = existingResourceConflict(resources, rel.Name, rel.Namespace)
|
||||
if i.TakeOwnership {
|
||||
toBeAdopted, err = requireAdoption(resources)
|
||||
} else {
|
||||
toBeAdopted, err = existingResourceConflict(resources, rel.Name, rel.Namespace)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Unable to continue with install")
|
||||
}
|
||||
@@ -373,7 +389,7 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma
|
||||
}
|
||||
}
|
||||
|
||||
// If Replace is true, we need to supercede the last release.
|
||||
// If Replace is true, we need to supersede the last release.
|
||||
if i.Replace {
|
||||
if err := i.replaceRelease(rel); err != nil {
|
||||
return nil, err
|
||||
@@ -615,7 +631,7 @@ func createOrOpenFile(filename string, append bool) (*os.File, error) {
|
||||
return os.Create(filename)
|
||||
}
|
||||
|
||||
// check if the directory exists to create file. creates if don't exists
|
||||
// check if the directory exists to create file. creates if doesn't exist
|
||||
func ensureDirectoryForFile(file string) error {
|
||||
baseDir := path.Dir(file)
|
||||
_, err := os.Stat(baseDir)
|
||||
|
||||
Reference in New Issue
Block a user