Skip to content

Commit cf67864

Browse files
Merge pull request #17790 from deads2k/rebase-06-nodewiring
Automatic merge from submit-queue (batch tested with PRs 17762, 17790, 17772, 17653, 17655). rebase comments on node wiring These came out of non-blocking comments on the rebase
2 parents 01fdac4 + b5886e7 commit cf67864

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ const minimumDockerAPIVersionWithPullByID = "1.22"
3333
// EnsureKubeletAccess performs a number of test operations that the Kubelet requires to properly function.
3434
// All errors here are fatal.
3535
func (c *NodeConfig) EnsureKubeletAccess() {
36-
if _, err := os.Stat("/var/lib/docker"); os.IsPermission(err) {
37-
glog.Fatal("Unable to view the /var/lib/docker directory - are you running as root?")
38-
}
3936
if c.Containerized {
4037
if _, err := os.Stat("/rootfs"); os.IsPermission(err) || os.IsNotExist(err) {
4138
glog.Fatal("error: Running in containerized mode, but cannot find the /rootfs directory - be sure to mount the host filesystem at /rootfs (read-only) in the container.")
@@ -82,6 +79,9 @@ func (c *NodeConfig) EnsureDocker(docker *dockerutil.Helper) {
8279
if c.KubeletServer.ContainerRuntime != "docker" {
8380
return
8481
}
82+
if _, err := os.Stat("/var/lib/docker"); os.IsPermission(err) {
83+
glog.Fatal("Unable to view the /var/lib/docker directory - are you running as root?")
84+
}
8585

8686
var endpoint string
8787
if len(os.Getenv("DOCKER_HOST")) > 0 {

pkg/cmd/server/kubernetes/node/node_config_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ func TestKubeletDefaults(t *testing.T) {
4242
CloudProvider: "", // now disabled
4343
RootDirectory: "/var/lib/kubelet",
4444
CertDirectory: "/var/lib/kubelet/pki",
45-
RegisterNode: true, // this looks suspicious
45+
RegisterNode: true,
4646
RemoteRuntimeEndpoint: "unix:///var/run/dockershim.sock", // overridden
47+
Containerized: false, // overridden based on OPENSHIFT_CONTAINERIZED
4748
VolumePluginDir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
4849
SeccompProfileRoot: "/var/lib/kubelet/seccomp",
4950
MaxContainerCount: -1,
@@ -147,7 +148,7 @@ func TestKubeletDefaults(t *testing.T) {
147148
}
148149

149150
if goruntime.GOOS == "darwin" {
150-
//expectedDefaults.KubeletConfiguration.RemoteRuntimeEndpoint = ""
151+
expectedDefaults.KubeletFlags.RemoteRuntimeEndpoint = ""
151152
}
152153

153154
if !reflect.DeepEqual(defaults, expectedDefaults) {

0 commit comments

Comments
 (0)