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 18, 2023
1 parent 26a0a6f commit c59ba68
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 40 deletions.
31 changes: 0 additions & 31 deletions cmd/virtual-kubelet/context.go

This file was deleted.

7 changes: 4 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 @@ -224,10 +225,10 @@ func main() {

if vkVersion {
p, err := azproviderv2.NewACIProvider(ctx, cfgPath, azConfig, azACIAPIs, cfg, os.Getenv("VKUBELET_POD_IP"), int32(listenPort), operatingSystem, clusterDomain)
return p, p, err
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 pkg/provider/aci.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,6 @@ func (p *ACIProvider) Ping(ctx context.Context) error {
return nil
}

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

func (p *ACIProvider) getImagePullSecrets(pod *v1.Pod) (*[]azaci.ImageRegistryCredential, error) {
ips := make([]azaci.ImageRegistryCredential, 0, len(pod.Spec.ImagePullSecrets))
for _, ref := range pod.Spec.ImagePullSecrets {
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 c59ba68

Please sign in to comment.