Skip to content

Commit

Permalink
Update azure-aci to use nodeutil instead of node-cli
Browse files Browse the repository at this point in the history
Signed-off-by: Heba Elayoty <[email protected]>
  • Loading branch information
helayoty committed Jan 5, 2023
1 parent 396507d commit d5d857d
Show file tree
Hide file tree
Showing 28 changed files with 757 additions and 376 deletions.
31 changes: 31 additions & 0 deletions cmd/virtual-kubelet/context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the Apache 2.0 license.
*/
package main

import (
"context"
"os"
"os/signal"
)

func BaseContext(ctx context.Context) (context.Context, func()) {
sigC := make(chan os.Signal, 1)
ctx, cancel := context.WithCancel(ctx)

go func() {
for {
select {
case <-ctx.Done():
signal.Stop(sigC)
return
case <-sigC:
cancel()
}
}
}()

signal.Notify(sigC, cancelSigs()...)
return ctx, cancel
}
Loading

0 comments on commit d5d857d

Please sign in to comment.