Skip to content

Commit

Permalink
Modify hook-injector plugin to monitor directories to match cri-o
Browse files Browse the repository at this point in the history
Signed-off-by: AbdelrahmanElawady <[email protected]>
  • Loading branch information
AbdelrahmanElawady committed May 21, 2024
1 parent fa64d11 commit b122b2d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions plugins/hook-injector/hook-injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ func main() {
}
p.mgr = mgr

for _, dir := range dirs {
if err = os.MkdirAll(dir, 0755); err != nil {
log.Errorf("failed to create directory %q: %v", dir, err)
os.Exit(1)
}
}

sync := make(chan error, 2)
go mgr.Monitor(ctx, sync)

err = <-sync
if err != nil {
log.Errorf("failed to monitor hook directories: %v", err)
os.Exit(1)
}

err = p.stub.Run(ctx)
if err != nil {
log.Errorf("plugin exited with error %v", err)
Expand Down

0 comments on commit b122b2d

Please sign in to comment.