From 57a6319fac5a6f5cad60f90563323726f5547835 Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Tue, 14 Jul 2020 15:46:10 -0700 Subject: [PATCH] add protect-kernel-defaults to kubelet Signed-off-by: Brian Downs --- pkg/cli/agent/agent.go | 1 + pkg/cli/cmds/agent.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pkg/cli/agent/agent.go b/pkg/cli/agent/agent.go index a4520ac5dd..8e7e6de09d 100644 --- a/pkg/cli/agent/agent.go +++ b/pkg/cli/agent/agent.go @@ -56,6 +56,7 @@ func Run(ctx *cli.Context) error { cfg := cmds.AgentConfig cfg.Debug = ctx.Bool("debug") cfg.DataDir = dataDir + cfg.ProtectKernelDefaults = true contextCtx := signals.SetupSignalHandler(context.Background()) diff --git a/pkg/cli/cmds/agent.go b/pkg/cli/cmds/agent.go index a234d6ea2f..3b3984e923 100644 --- a/pkg/cli/cmds/agent.go +++ b/pkg/cli/cmds/agent.go @@ -36,6 +36,7 @@ type Agent struct { Labels []string Taints []string PrivateRegistry string + ProtectKernelDefaults bool AgentShared } @@ -136,6 +137,11 @@ var ( Hidden: true, Destination: &AgentConfig.DisableSELinux, } + ProtectKernelDefaultsFlag = cli.BoolFlag{ + Name: "protect-kernel-defaults", + Usage: "(agent/node) ", + Destination: &AgentConfig.ProtectKernelDefaults, + } ) func NewAgentCommand(action func(ctx *cli.Context) error) *cli.Command { @@ -192,6 +198,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) *cli.Command { &FlannelConfFlag, &ExtraKubeletArgs, &ExtraKubeProxyArgs, + &ProtectKernelDefaultsFlag, &cli.BoolFlag{ Name: "rootless", Usage: "(experimental) Run rootless",