Skip to content

Commit 0c4900a

Browse files
authoredNov 20, 2017
Merge pull request #17385 from liggitt/fail-on-swap
Automatic merge from submit-queue (batch tested with PRs 17395, 17385). Limit fail-on-swap override to cluster-up Follow up from rebase. Ansible disables swap, so we only need to prevent the "crash on start" behavior for cluster-up
2 parents 5809056 + d8265d0 commit 0c4900a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
 

‎pkg/cmd/server/kubernetes/node/options/options.go

-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ func Build(options configapi.NodeConfig) (*kubeletoptions.KubeletServer, error)
8282
server.RemoteImageEndpoint = options.DockerConfig.DockerShimSocket
8383
server.DockershimRootDirectory = options.DockerConfig.DockershimRootDirectory
8484

85-
// TODO: check/warn/fail in setup instead?
86-
// allows kubelet to continue to start in swap environments
87-
server.FailSwapOn = false
88-
8985
// prevents kube from generating certs
9086
server.TLSCertFile = options.ServingInfo.ServerCert.CertFile
9187
server.TLSPrivateKeyFile = options.ServingInfo.ServerCert.KeyFile

‎pkg/oc/bootstrap/docker/openshift/helper.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,9 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error {
887887
nodeCfg.DNSIP = ""
888888
}
889889
nodeCfg.DNSBindAddress = ""
890+
if nodeCfg.KubeletArguments == nil {
891+
nodeCfg.KubeletArguments = configapi.ExtendedArguments{}
892+
}
890893

891894
if h.supportsCgroupDriver() {
892895
// Set the cgroup driver from the current docker
@@ -895,11 +898,9 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error {
895898
return err
896899
}
897900
glog.V(5).Infof("cgroup driver from Docker: %s", cgroupDriver)
898-
if nodeCfg.KubeletArguments == nil {
899-
nodeCfg.KubeletArguments = configapi.ExtendedArguments{}
900-
}
901901
nodeCfg.KubeletArguments["cgroup-driver"] = []string{cgroupDriver}
902902
}
903+
nodeCfg.KubeletArguments["fail-swap-on"] = []string{"false"}
903904

904905
cfgBytes, err = configapilatest.WriteYAML(nodeCfg)
905906
if err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.