mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-08-17 15:57:46 +00:00
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:
parent
4bd6a5a8d5
commit
db2bcc0451
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user