Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions overlays/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,17 @@ final: prev:
];
}
);

yq-go = prev.yq-go.overrideAttrs (
finalAttrs: _prevAttrs: {
version = "4.53.2";
src = final.fetchFromGitHub {
owner = "mikefarah";
repo = "yq";
rev = "v${finalAttrs.version}";
hash = "sha256-So0yUblAxLgbw1/BrOp6zj9wGMTtsspjk2UQaBIBIYE=";
};
vendorHash = "sha256-t+u3rJNbe8JcfWBb+jMaZuTcSWYmhMiCeKbI2noVaCo=";
}
);
}
8 changes: 4 additions & 4 deletions packages/cleanup-bare-metal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
fi
echo "Using containerd config file: ${configFile}"

configVersion=$(dasel --file "${configFile}" --read toml version)
configVersion=$(yq -p toml -o yaml '.version' "${configFile}")
if [[ ${configVersion} != "2" && ${configVersion} != "3" ]]; then
echo "Unsupported containerd config version: ${configVersion}. Exiting."
exit 1
Expand Down Expand Up @@ -81,14 +81,14 @@ for runtimeClass in "${unusedRuntimeClasses[@]}"; do
echo "Removing ${runtimeClass} from ${configFile} ..."
case "${configVersion}" in
"2")
dasel delete --file "${configFile}" --indent 0 --read toml --write toml "plugins.io\.containerd\.grpc\.v1\.cri.containerd.runtimes.${runtimeClass}" || true
yq -i -p toml -o toml "del(.plugins[\"io.containerd.grpc.v1.cri\"].containerd.runtimes[\"${runtimeClass}\"])" "${configFile}" || true
;;
"3")
dasel delete --file "${configFile}" --indent 0 --read toml --write toml "plugins.io\.containerd\.cri\.v1\.runtime.containerd.runtimes.${runtimeClass}" || true
yq -i -p toml -o toml "del(.plugins[\"io.containerd.cri.v1.runtime\"].containerd.runtimes[\"${runtimeClass}\"])" "${configFile}" || true
;;
esac

dasel delete --file "${configFile}" --indent 0 --read toml --write toml "proxy_plugins.${SNAPSHOTTER}-${runtimeClass}" 2>/dev/null || true
yq -i -p toml -o toml "del(.proxy_plugins[\"${SNAPSHOTTER}-${runtimeClass}\"])" "${configFile}" 2>/dev/null || true
done

echo "Cleanup finished"
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ lib.makeScope pkgs.newScope (scripts: {
runtimeInputs = with pkgs; [
busybox
kubectl
dasel
yq-go
scripts.cleanup-images
];
text = builtins.readFile ./cleanup-bare-metal.sh;
Expand Down
2 changes: 2 additions & 0 deletions tools/bm-maintenance/cleanup-containerd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
metadata:
name: containerd-cleanup-maintenance
spec:
nodeSelector:
ci.contrast.edgeless.systems/main-runner: "true"
containers:
- name: cleanup
image: "@@REPLACE_IMAGE@@"
Expand Down
2 changes: 2 additions & 0 deletions tools/bm-maintenance/cleanup-namespaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ spec:
spec:
template:
spec:
nodeSelector:
ci.contrast.edgeless.systems/main-runner: "true"
serviceAccountName: namespace-cleanup-sa
containers:
- name: namespace-cleanup
Expand Down
2 changes: 2 additions & 0 deletions tools/bm-maintenance/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ spec:
metadata:
name: cleanup-maintenance
spec:
nodeSelector:
ci.contrast.edgeless.systems/main-runner: "true"
serviceAccountName: cleanup-sa
hostPID: true
containers:
Expand Down
2 changes: 2 additions & 0 deletions tools/bm-maintenance/nix-gc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
metadata:
name: nix-garbage-collection
spec:
nodeSelector:
ci.contrast.edgeless.systems/main-runner: "true"
hostPID: true
containers:
- name: nix-garbage-collection
Expand Down