fix: use target field manager for hwlab node apply (#581)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -1802,7 +1802,8 @@ function applyScript(yaml: string, node: ControlPlaneNodeSpec, target: ControlPl
|
||||
set +e
|
||||
manifest=$(mktemp /tmp/hwlab-node-infra.XXXXXX.yaml)
|
||||
printf %s ${shQuote(encoded)} | base64 -d >"$manifest"
|
||||
kubectl apply --server-side --field-manager=unidesk-hwlab-node-control-plane -f "$manifest" >/tmp/hwlab-node-infra-apply.out 2>/tmp/hwlab-node-infra-apply.err
|
||||
field_manager=${shQuote(controlPlaneFieldManager(target))}
|
||||
kubectl apply --server-side --field-manager="$field_manager" -f "$manifest" >/tmp/hwlab-node-infra-apply.out 2>/tmp/hwlab-node-infra-apply.err
|
||||
kubectl_rc=$?
|
||||
${k3sApplyScriptFragment(node.k3s, target)}
|
||||
python3 - "$kubectl_rc" "$k3s_report_file" <<'PY'
|
||||
@@ -1822,6 +1823,10 @@ exit "$k3s_rc"
|
||||
`;
|
||||
}
|
||||
|
||||
function controlPlaneFieldManager(target: ControlPlaneTargetSpec): string {
|
||||
return `unidesk-hwlab-${target.node.toLowerCase()}-${target.lane}-control-plane`;
|
||||
}
|
||||
|
||||
function k3sApplyScriptFragment(spec: ControlPlaneK3sNodeSpec | null, target: ControlPlaneTargetSpec): string {
|
||||
if (spec === null) {
|
||||
return `
|
||||
|
||||
Reference in New Issue
Block a user