art: Write only version to VERSION in os-release

Add FLAVOR and VARIANT to handle those separately, this should also fix upgrades.

Fixes https://github.com/c3os-io/c3os/issues/80
This commit is contained in:
Ettore Di Giacinto 2022-08-17 08:02:18 +00:00 committed by Itxaka
parent 4bd6a5a8d5
commit db2bcc0451

View File

@ -2,7 +2,6 @@ package agent
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
@ -27,16 +26,11 @@ func Upgrade(version, image string, force bool) error {
return nil return nil
} }
flavor := utils.Flavor()
if flavor == "" {
return errors.New("no flavor detected")
}
registry, err := utils.OSRelease("IMAGE_REPO") registry, err := utils.OSRelease("IMAGE_REPO")
if err != nil { if err != nil {
return err return err
} }
img := fmt.Sprintf("%s:%s-%s", registry, flavor, version) img := fmt.Sprintf("%s:%s", registry, version)
if image != "" { if image != "" {
img = image img = image
} }