From b8c63458fddf1fb0af6c5278ce7cb0cb85de37ff Mon Sep 17 00:00:00 2001
From: kaiyou <dev@kaiyou.fr>
Date: Thu, 26 Jan 2023 15:38:12 +0100
Subject: [PATCH] Move hacks docs to go.mod directly

---
 HACKS.md | 21 ---------------------
 go.mod   | 18 ++++++++++++++----
 2 files changed, 14 insertions(+), 25 deletions(-)
 delete mode 100644 HACKS.md

diff --git a/HACKS.md b/HACKS.md
deleted file mode 100644
index 900c003..0000000
--- a/HACKS.md
+++ /dev/null
@@ -1,21 +0,0 @@
-Bundling together vanilla kubernetes, containerd, vanilla CNI, and a full
-featured CNI requires some level of quirks due to conflicting dependencies
-mostly.
-
-We try and use the most up to date version of each dependency while upstreaming
-patches required for interoperability. Remaining quirks are listed below.
-
-# CNI plugins forked by Rancher
-
-containernetworking/plugins does not expose its main functions for plugins,
-which eventually prevents from using them as reexec targets and bundling them
-in a single binary.
-
-Rancher forked the project to build a single CNI binary, which we currently
-reuse to bundle them in the main binary instead.
-
-Forked is located at: github.com/rancher/plugins
-
-# Gojose pinned to v2.2.2
-
-Simple API incompatibility with vanilla kubernetes code.
diff --git a/go.mod b/go.mod
index 9de16cc..cbbac15 100644
--- a/go.mod
+++ b/go.mod
@@ -3,15 +3,25 @@ module forge.tedomum.net/acides/hepto
 go 1.19
 
 replace (
-	// containerd implemented checkpoint cri api in main
+	// containerd implemented checkpoint cri api in main, which will be released in v1.7, however 1.7 is still
+  // incompatible with vanilla k8s, especially it explicitely depends on cri v1alpha2 which was dropped after
+  // k8s 1.26
 	github.com/containerd/containerd => github.com/containerd/containerd v1.7.0-beta.0.0.20221122101828-ed3a49c0e6b8
-	// rancher fork exposes main properly
+	// rancher fork exposes main as a public method, which makes it available for an external single binary
+  // An issue was open upstream, it was since deleted, this should still be contributed upstream instead of
+  // maintaining it in a dedicated fork
 	github.com/containernetworking/plugins => github.com/rancher/plugins v1.1.1-k3s1
-	// temporary fork
+	// This is a temporary fork to apply a given pull request on top of runc since it was not yet merged
+  // upstream in any branch
 	github.com/opencontainers/runc => github.com/kaiyou/runc v1.1.5-0.20221023174418-d6cd4e53783a
-	// issue with NumericDate API changes
+  // Runtime-tools have various dependency issues, including one on go-118-fuzz-build, which fails to resolve
+  // the dep graph, more recent versions have hard dependencies on too recent containerd versions however, so
+  // we are pinning a reasonable commit
 	github.com/opencontainers/runtime-tools => github.com/opencontainers/runtime-tools v0.9.1-0.20230110161035-a6a073817ab0
+	// issue with NumericDate API changes, pinning an old version of the json API
 	gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.2.2
+  // This is not a hack, but the recommended way of pinning kubernetes as an external dependency for
+  // building vanilla (since those reference themselves as v0.0.0 internally)
 	k8s.io/api => k8s.io/api v0.26.1
 	k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.1
 	k8s.io/apimachinery => k8s.io/apimachinery v0.26.1
-- 
GitLab