Skip to content

Commit

Permalink
fix opts in vk main
Browse files Browse the repository at this point in the history
  • Loading branch information
dciangot authored Apr 15, 2024
1 parent 72da39b commit 2f705ba
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/virtual-kubelet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func main() {
defer cancel()
nodename := flag.String("nodename", "", "The name of the node")
configpath := flag.String("configpath", "", "Path to the VK config")
flag.Parse()
flag.Parse()
err := NewOpts(*nodename, *configpath)
if err != nil {
panic(err)
Expand Down Expand Up @@ -205,16 +205,14 @@ func main() {

http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}

log.G(ctx).Debug(*opts)

dport, err := strconv.ParseInt(os.Getenv("KUBELET_PORT"), 10, 32)
if err != nil {
log.G(ctx).Fatal(err)
}

cfg := Config{
ConfigPath: opts.ConfigPath,
NodeName: opts.NodeName,
ConfigPath: configpath,

Check failure on line 214 in cmd/virtual-kubelet/main.go

View workflow job for this annotation

GitHub Actions / goreleaser

cannot use configpath (variable of type *string) as string value in struct literal
NodeName: nodename,

Check failure on line 215 in cmd/virtual-kubelet/main.go

View workflow job for this annotation

GitHub Actions / goreleaser

cannot use nodename (variable of type *string) as string value in struct literal
OperatingSystem: "Linux",
// https://github.com/liqotech/liqo/blob/d8798732002abb7452c2ff1c99b3e5098f848c93/deployments/liqo/templates/liqo-gateway-deployment.yaml#L69
InternalIP: os.Getenv("POD_IP"),
Expand Down Expand Up @@ -296,14 +294,14 @@ func main() {

eb := record.NewBroadcaster()

EventRecorder := eb.NewRecorder(scheme.Scheme, v1.EventSource{Component: path.Join(opts.NodeName, "pod-controller")})
EventRecorder := eb.NewRecorder(scheme.Scheme, v1.EventSource{Component: path.Join(cfg.NodeName, "pod-controller")})

resync, err := time.ParseDuration("30s")

podInformerFactory := informers.NewSharedInformerFactoryWithOptions(
localClient,
resync,
PodInformerFilter(opts.NodeName),
PodInformerFilter(cfg.NodeName),
)

scmInformerFactory := informers.NewSharedInformerFactoryWithOptions(
Expand Down

0 comments on commit 2f705ba

Please sign in to comment.