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 <hebaelayoty@gmail.com>
  • Loading branch information
helayoty committed Jan 5, 2023
1 parent 396507d commit fcdb79b
Show file tree
Hide file tree
Showing 29 changed files with 777 additions and 383 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 fcdb79b

Please sign in to comment.