From d382ab39d26f994721468a7e4f3d3085a80e2000 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 20 Jan 2025 15:45:20 +0100 Subject: [PATCH] Re-add pid in runtime config This is so we can support downgrades, eg run old k0s binary against newer k0s runtime config. Probably meaningless because we don't really support downgrading to older version(?) Signed-off-by: Natanael Copa --- pkg/config/runtime.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/config/runtime.go b/pkg/config/runtime.go index 0ba11b0df8ea..9bdef9a5822e 100644 --- a/pkg/config/runtime.go +++ b/pkg/config/runtime.go @@ -56,6 +56,7 @@ type RuntimeConfig struct { type RuntimeConfigSpec struct { NodeConfig *v1beta1.ClusterConfig `json:"nodeConfig"` K0sVars *CfgVars `json:"k0sVars"` + Pid int `json:"pid"` // unused. Delete lockFile *os.File } @@ -136,6 +137,7 @@ func NewRuntimeConfig(k0sVars *CfgVars) (*RuntimeConfig, error) { Spec: &RuntimeConfigSpec{ NodeConfig: nodeConfig, K0sVars: k0sVars, + Pid: os.Getpid(), lockFile: lockFile, }, }