Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hepto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hepto
Commits
189999f1
Commit
189999f1
authored
1 year ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Special argv-based hooks are not needed anymore
parent
7efd137d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/hepto.go
+1
-15
1 addition, 15 deletions
cmd/hepto.go
with
1 addition
and
15 deletions
cmd/hepto.go
+
1
−
15
View file @
189999f1
...
@@ -11,22 +11,8 @@ import (
...
@@ -11,22 +11,8 @@ import (
func
main
()
{
func
main
()
{
fn
:=
hepto
.
Hepto
fn
:=
hepto
.
Hepto
program
:=
filepath
.
Base
(
os
.
Args
[
0
])
program
:=
filepath
.
Base
(
os
.
Args
[
0
])
hook
,
ok
:=
hepto
.
Hooks
[
program
]
if
hook
,
ok
:=
hepto
.
Hooks
[
program
];
ok
{
switch
{
case
ok
:
fn
=
hook
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
()
err
:=
fn
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment