Reduce the number of bootenv vars
This commit is contained in:
@@ -3,6 +3,7 @@ package osupgrade
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/klog/v2"
|
||||
@@ -12,6 +13,7 @@ import (
|
||||
"example.com/monok8s/pkg/catalog"
|
||||
"example.com/monok8s/pkg/controller/osimage"
|
||||
"example.com/monok8s/pkg/kube"
|
||||
"example.com/monok8s/pkg/node/uboot"
|
||||
)
|
||||
|
||||
func HandleOSUpgrade(ctx context.Context, clients *kube.Clients,
|
||||
@@ -89,7 +91,7 @@ func HandleOSUpgrade(ctx context.Context, clients *kube.Clients,
|
||||
|
||||
imageOptions := osimage.ApplyOptions{
|
||||
URL: first.URL,
|
||||
TargetPath: "./out/flash.img",
|
||||
TargetPath: "/dev/sda?",
|
||||
ExpectedRawSHA256: imageSHA,
|
||||
ExpectedRawSize: first.Size,
|
||||
BufferSize: 6 * 1024 * 1024,
|
||||
@@ -128,10 +130,9 @@ func HandleOSUpgrade(ctx context.Context, clients *kube.Clients,
|
||||
}
|
||||
|
||||
klog.Info(result)
|
||||
if err := SetNextBootEnv(ctx, NextBootConfig{
|
||||
Key: "boot_part",
|
||||
Value: "B",
|
||||
}); err != nil {
|
||||
|
||||
cfgPath := os.Getenv("FW_ENV_CONFIG_FILE")
|
||||
if err := uboot.ConfigureNextBoot(ctx, cfgPath); err != nil {
|
||||
return failProgress(ctx, clients, osup, "set boot env", err)
|
||||
}
|
||||
|
||||
@@ -145,5 +146,8 @@ func HandleOSUpgrade(ctx context.Context, clients *kube.Clients,
|
||||
return fmt.Errorf("update progress status: %w", err)
|
||||
}
|
||||
|
||||
// TODO: Drain the node here
|
||||
// TODO: Issue Reboot
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user