commit f8db036a5fe544e0e0372ffeb7c2d55c8a6a45c7097b40bf7cba8b125336f915
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-04-05T08:37:41Z |
| subject | Split action into kubectl |
commit f8db036a5fe544e0e0372ffeb7c2d55c8a6a45c7097b40bf7cba8b125336f915
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-04-05T08:37:41Z
Split action into kubectl
---
clitools/pkg/controller/osupgrade/bootenv.go | 37 ----------------------------
1 file changed, 37 deletions(-)
diff --git a/clitools/pkg/controller/osupgrade/bootenv.go b/clitools/pkg/controller/osupgrade/bootenv.go
deleted file mode 100644
index b632694..0000000
--- a/clitools/pkg/controller/osupgrade/bootenv.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package osupgrade
-
-import (
- "context"
- "fmt"
- "os/exec"
-)
-
-type NextBootConfig struct {
- Key string
- Value string
-}
-
-func SetNextBootEnv(ctx context.Context, cfg NextBootConfig) error {
- if cfg.Key == "" {
- return fmt.Errorf("boot env key is empty")
- }
- if cfg.Value == "" {
- return fmt.Errorf("boot env value is empty")
- }
-
- cmd := exec.CommandContext(
- ctx,
- "/proc/self/exe",
- "internal",
- "fw-setenv",
- "--key", cfg.Key,
- "--value", cfg.Value,
- )
-
- out, err := cmd.CombinedOutput()
- if err != nil {
- return fmt.Errorf("invoke internal fw-setenv: %w: %s", err, string(out))
- }
-
- return nil
-}