Skip to content

Commit

Permalink
use NotifyContext and remove NotifyNodeStatus
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 24, 2023
1 parent b886eb7 commit 76025e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
31 changes: 0 additions & 31 deletions cmd/virtual-kubelet/context.go

This file was deleted.

6 changes: 3 additions & 3 deletions cmd/virtual-kubelet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"net/http"
"os"
"os/signal"
"path/filepath"
"strconv"
"strings"
Expand Down Expand Up @@ -51,7 +52,7 @@ var (
)

func main() {
ctx, cancel := BaseContext(context.Background())
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()

binaryName := filepath.Base(os.Args[0])
Expand Down Expand Up @@ -227,11 +228,10 @@ func main() {

if vkVersion {
p, err := azproviderv2.NewACIProvider(ctx, cfgPath, azConfig, azACIAPIs, cfg, os.Getenv("VKUBELET_POD_IP"), int32(listenPort), operatingSystem, clusterDomain)
// azproviderv2.NewACIProvider(ctx, cfg.ConfigPath, azConfig, azACIAPIs, cfg.ResourceManager, cfg.NodeName, cfg.OperatingSystem, cfg.InternalIP, cfg.DaemonPort, cfg.KubeClusterDomain)
return p, nil, err
} else {
p, err := azproviderv1.NewACIProvider(cfgPath, cfg, os.Getenv("VKUBELET_POD_IP"), int32(listenPort), operatingSystem, clusterDomain)
return p, p, err
return p, nil, err
}
},
withConfigureRoutes,
Expand Down
3 changes: 0 additions & 3 deletions provider/aci.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,9 +1233,6 @@ func (p *ACIProvider) Ping(ctx context.Context) error {
return nil
}

func (p *ACIProvider) NotifyNodeStatus(ctx context.Context, cb func(*v1.Node)) {
}

// getContainerGroup returns a container group from ACI.
func (p *ACIProvider) getContainerGroup(ctx context.Context, namespace, name string) (*aci.ContainerGroup, error) {
cg, status, err := p.aciClient.GetContainerGroup(ctx, p.resourceGroup, fmt.Sprintf("%s-%s", namespace, name))
Expand Down

0 comments on commit 76025e7

Please sign in to comment.