mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 22:05:23 +02:00
feat(helm): use helm upgrade for install [r8s-258] (#568)
This commit is contained in:
parent
e68bd53e30
commit
0ebfe047d1
19 changed files with 613 additions and 150 deletions
|
@ -73,6 +73,11 @@ func (hpm *helmMockPackageManager) Install(installOpts options.InstallOptions) (
|
|||
return newMockRelease(releaseElement), nil
|
||||
}
|
||||
|
||||
// Upgrade a helm chart (not thread safe)
|
||||
func (hpm *helmMockPackageManager) Upgrade(upgradeOpts options.InstallOptions) (*release.Release, error) {
|
||||
return hpm.Install(upgradeOpts)
|
||||
}
|
||||
|
||||
// Show values/readme/chart etc
|
||||
func (hpm *helmMockPackageManager) Show(showOpts options.ShowOptions) ([]byte, error) {
|
||||
switch showOpts.OutputFormat {
|
||||
|
|
26
pkg/libhelm/test/values.go
Normal file
26
pkg/libhelm/test/values.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package test
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// CreateValuesFile creates a temporary file with the given content for testing
|
||||
func CreateValuesFile(values string) (string, error) {
|
||||
file, err := os.CreateTemp("", "helm-values")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
_, err = file.WriteString(values)
|
||||
if err != nil {
|
||||
file.Close()
|
||||
return "", err
|
||||
}
|
||||
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return file.Name(), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue