Skip to content

Commit

Permalink
[engine-1.21] updating to new signals package in wrangler (k3s-io#4434)
Browse files Browse the repository at this point in the history
* updating to new signals package in wrangler

Signed-off-by: Luther Monson <luther.monson@gmail.com>
  • Loading branch information
luthermonson authored Nov 9, 2021
1 parent 14cf963 commit 67d079e
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TARGETS := $(shell ls scripts | grep -v \\.sh)

.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/v0.5.1/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
@curl -sL https://releases.rancher.com/dapper/v0.5.7/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ require (
github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08
github.com/rancher/remotedialer v0.2.0
github.com/rancher/wharfie v0.3.4
github.com/rancher/wrangler v0.8.5
github.com/rancher/wrangler v0.8.8
github.com/robfig/cron/v3 v3.0.1
github.com/rootless-containers/rootlesskit v0.14.0
github.com/sirupsen/logrus v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ github.com/rancher/wharfie v0.3.4 h1:wVqFW1cyRA20zY90Z56VrjG0lWg3oFmf/4ryr5Dkkis
github.com/rancher/wharfie v0.3.4/go.mod h1:cb8mSczpmw7ItbPF3K1W7crWuJLVdyV49sZZuaY4BS8=
github.com/rancher/wrangler v0.4.0/go.mod h1:1cR91WLhZgkZ+U4fV9nVuXqKurWbgXcIReU4wnQvTN8=
github.com/rancher/wrangler v0.8.3/go.mod h1:dKEaHNB4izxmPUtpq1Hvr3z3Oh+9k5pCZyFO9sUhlaY=
github.com/rancher/wrangler v0.8.5 h1:aHUVvJrOhD6CGrAELWKDpo1MBDC8vKtEQZvjMPnw2cs=
github.com/rancher/wrangler v0.8.5/go.mod h1:dKEaHNB4izxmPUtpq1Hvr3z3Oh+9k5pCZyFO9sUhlaY=
github.com/rancher/wrangler v0.8.8 h1:3EEQmfUqZ/UG4hERHhihB+Q2F1s/W4CmfsPmXv17wS8=
github.com/rancher/wrangler v0.8.8/go.mod h1:dKEaHNB4izxmPUtpq1Hvr3z3Oh+9k5pCZyFO9sUhlaY=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/robfig/cron v1.1.0 h1:jk4/Hud3TTdcrJgUOBgsqrZBarcxl6ADIjSC2iniwLY=
github.com/robfig/cron v1.1.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/containerd/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Run(ctx context.Context, cfg *config.Node) error {
}

logrus.Infof("Running containerd %s", config.ArgString(args[1:]))
cmd := exec.Command(args[0], args[1:]...)
cmd := exec.CommandContext(ctx, args[0], args[1:]...)
cmd.Stdout = stdOut
cmd.Stderr = stdErr
cmd.Env = env
Expand Down
3 changes: 1 addition & 2 deletions pkg/cli/agent/agent.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package agent

import (
"context"
"fmt"
"os"
"runtime"
Expand Down Expand Up @@ -73,7 +72,7 @@ func Run(ctx *cli.Context) error {
cfg.Debug = ctx.GlobalBool("debug")
cfg.DataDir = dataDir

contextCtx := signals.SetupSignalHandler(context.Background())
contextCtx := signals.SetupSignalContext()

return agent.Run(contextCtx, cfg)
}
9 changes: 4 additions & 5 deletions pkg/cli/etcdsnapshot/etcd_snapshot.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package etcdsnapshot

import (
"context"
"errors"
"fmt"
"os"
Expand Down Expand Up @@ -82,7 +81,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {
serverConfig.ControlConfig.Runtime.ClientETCDKey = filepath.Join(dataDir, "tls", "etcd", "client.key")
serverConfig.ControlConfig.Runtime.KubeConfigAdmin = filepath.Join(dataDir, "cred", "admin.kubeconfig")

ctx := signals.SetupSignalHandler(context.Background())
ctx := signals.SetupSignalContext()
e := etcd.NewETCD()
e.SetControlConfig(&serverConfig.ControlConfig)

Expand Down Expand Up @@ -132,7 +131,7 @@ func delete(app *cli.Context, cfg *cmds.Server) error {
serverConfig.ControlConfig.DataDir = dataDir
serverConfig.ControlConfig.Runtime.KubeConfigAdmin = filepath.Join(dataDir, "cred", "admin.kubeconfig")

ctx := signals.SetupSignalHandler(context.Background())
ctx := signals.SetupSignalContext()
e := etcd.NewETCD()
e.SetControlConfig(&serverConfig.ControlConfig)

Expand Down Expand Up @@ -162,7 +161,7 @@ func list(app *cli.Context, cfg *cmds.Server) error {

serverConfig.ControlConfig.DataDir = dataDir

ctx := signals.SetupSignalHandler(context.Background())
ctx := signals.SetupSignalContext()
e := etcd.NewETCD()
e.SetControlConfig(&serverConfig.ControlConfig)

Expand Down Expand Up @@ -203,7 +202,7 @@ func prune(app *cli.Context, cfg *cmds.Server) error {
serverConfig.ControlConfig.DataDir = dataDir
serverConfig.ControlConfig.EtcdSnapshotRetention = cfg.EtcdSnapshotRetention

ctx := signals.SetupSignalHandler(context.Background())
ctx := signals.SetupSignalContext()
e := etcd.NewETCD()
e.SetControlConfig(&serverConfig.ControlConfig)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont

notifySocket := os.Getenv("NOTIFY_SOCKET")

ctx := signals.SetupSignalHandler(context.Background())
ctx := signals.SetupSignalContext()

if err := server.StartServer(ctx, &serverConfig, cfg); err != nil {
return err
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions vendor/github.com/rancher/wrangler/pkg/apply/desiredset_process.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 31 additions & 9 deletions vendor/github.com/rancher/wrangler/pkg/signals/signal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ github.com/rancher/remotedialer
# github.com/rancher/wharfie v0.3.4
## explicit
github.com/rancher/wharfie/pkg/registries
# github.com/rancher/wrangler v0.8.5
# github.com/rancher/wrangler v0.8.8
## explicit
github.com/rancher/wrangler/pkg/apply
github.com/rancher/wrangler/pkg/apply/injectors
Expand Down

0 comments on commit 67d079e

Please sign in to comment.