From 189999f193ad471fdb0627ba4e5a4a890c358f8d Mon Sep 17 00:00:00 2001
From: kaiyou <dev@kaiyou.fr>
Date: Sat, 21 Oct 2023 13:34:06 +0200
Subject: [PATCH] Special argv-based hooks are not needed anymore

---
 cmd/hepto.go | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/cmd/hepto.go b/cmd/hepto.go
index fea4e06..2e4ba98 100644
--- a/cmd/hepto.go
+++ b/cmd/hepto.go
@@ -11,22 +11,8 @@ import (
 func main() {
 	fn := hepto.Hepto
 	program := filepath.Base(os.Args[0])
-	hook, ok := hepto.Hooks[program]
-	switch {
-	case ok:
+	if hook, ok := hepto.Hooks[program]; ok {
 		fn = hook
-	case len(os.Args) <= 1:
-		break
-	// Containerd is often called back, especially by runc shim
-	// to communicate about the shim status, except it gets its own
-	// name from `os.Executable`, which returns `hepto` and does not
-	// call into `containerd`. Thus, we match on very specific command
-	// line arguments to guess whether this is a callback to containerd
-	case os.Args[1] == "publish":
-		fn = hepto.Containerd
-	// Same behavior for the shim itself
-	case os.Args[1] == "-namespace":
-		fn = hepto.Shim
 	}
 	err := fn()
 	if err != nil {
-- 
GitLab