diff --git a/cmd/hepto.go b/cmd/hepto.go index fea4e064760f9a451421e5aef2a62e469facfb27..2e4ba98fa894ed0e22c6b8582b1e8afc5864a0e6 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 {