File tree 2 files changed +6
-5
lines changed
pkg/cmd/server/kubernetes/node
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,6 @@ const minimumDockerAPIVersionWithPullByID = "1.22"
33
33
// EnsureKubeletAccess performs a number of test operations that the Kubelet requires to properly function.
34
34
// All errors here are fatal.
35
35
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
- }
39
36
if c .Containerized {
40
37
if _ , err := os .Stat ("/rootfs" ); os .IsPermission (err ) || os .IsNotExist (err ) {
41
38
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) {
82
79
if c .KubeletServer .ContainerRuntime != "docker" {
83
80
return
84
81
}
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
+ }
85
85
86
86
var endpoint string
87
87
if len (os .Getenv ("DOCKER_HOST" )) > 0 {
Original file line number Diff line number Diff line change @@ -42,8 +42,9 @@ func TestKubeletDefaults(t *testing.T) {
42
42
CloudProvider : "" , // now disabled
43
43
RootDirectory : "/var/lib/kubelet" ,
44
44
CertDirectory : "/var/lib/kubelet/pki" ,
45
- RegisterNode : true , // this looks suspicious
45
+ RegisterNode : true ,
46
46
RemoteRuntimeEndpoint : "unix:///var/run/dockershim.sock" , // overridden
47
+ Containerized : false , // overridden based on OPENSHIFT_CONTAINERIZED
47
48
VolumePluginDir : "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/" ,
48
49
SeccompProfileRoot : "/var/lib/kubelet/seccomp" ,
49
50
MaxContainerCount : - 1 ,
@@ -147,7 +148,7 @@ func TestKubeletDefaults(t *testing.T) {
147
148
}
148
149
149
150
if goruntime .GOOS == "darwin" {
150
- // expectedDefaults.KubeletConfiguration .RemoteRuntimeEndpoint = ""
151
+ expectedDefaults .KubeletFlags .RemoteRuntimeEndpoint = ""
151
152
}
152
153
153
154
if ! reflect .DeepEqual (defaults , expectedDefaults ) {
You can’t perform that action at this time.
0 commit comments