1
0
Fork 0
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:
Ali 2025-03-26 11:32:26 +13:00 committed by GitHub
parent e68bd53e30
commit 0ebfe047d1
19 changed files with 613 additions and 150 deletions

View file

@ -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 {

View 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
}