Added migrations.d
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
monov1alpha1 "example.com/monok8s/pkg/apis/monok8s/v1alpha1"
|
||||
"example.com/monok8s/pkg/controller/osimage"
|
||||
)
|
||||
@@ -26,7 +28,7 @@ func ReleaseControlGate(ctx context.Context, nctx *NodeContext) error {
|
||||
gateFile := filepath.Join(monov1alpha1.EnvConfigDir, ".control-gate")
|
||||
|
||||
if err := os.Remove(gateFile); err != nil {
|
||||
return fmt.Errorf("relate control gate: %w", err)
|
||||
return fmt.Errorf("release control gate: %w", err)
|
||||
}
|
||||
|
||||
return WriteLastState(ctx, nctx)
|
||||
@@ -46,6 +48,8 @@ func WriteLastState(ctx context.Context, nctx *NodeContext) error {
|
||||
return fmt.Errorf("BOOT_PART missing")
|
||||
}
|
||||
|
||||
klog.Infof("Writing last state: %+v", bootPart)
|
||||
|
||||
tmp := stBootPart + ".tmp"
|
||||
if err := os.WriteFile(tmp, []byte(bootPart+"\n"), 0o644); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user