Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
09285864
Unverified
Commit
09285864
authored
Apr 07, 2016
by
Cesar Wong
Committed by
Paulo Pires
Oct 31, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial windows container runtime
parent
dad0445b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
67 deletions
+132
-67
cadvisor_stub.go
pkg/kubelet/cadvisor/cadvisor_stub.go
+74
-0
container_manager_stub.go
pkg/kubelet/cm/container_manager_stub.go
+2
-2
container_manager_unsupported.go
pkg/kubelet/cm/container_manager_unsupported.go
+0
-64
docker_manager.go
pkg/kubelet/dockertools/docker_manager.go
+0
-0
volume.go
pkg/volume/volume.go
+56
-1
No files found.
pkg/kubelet/cadvisor/cadvisor_stub.go
0 → 100644
View file @
09285864
// +build darwin windows
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
cadvisor
import
(
"github.com/google/cadvisor/events"
cadvisorapi
"github.com/google/cadvisor/info/v1"
cadvisorapiv2
"github.com/google/cadvisor/info/v2"
)
type
cadvisorStub
struct
{
}
var
_
Interface
=
new
(
cadvisorStub
)
func
New
(
port
uint
,
runtime
string
)
(
Interface
,
error
)
{
return
&
cadvisorStub
{},
nil
}
func
(
cu
*
cadvisorStub
)
Start
()
error
{
return
nil
}
func
(
cu
*
cadvisorStub
)
DockerContainer
(
name
string
,
req
*
cadvisorapi
.
ContainerInfoRequest
)
(
cadvisorapi
.
ContainerInfo
,
error
)
{
return
cadvisorapi
.
ContainerInfo
{},
nil
}
func
(
cu
*
cadvisorStub
)
ContainerInfo
(
name
string
,
req
*
cadvisorapi
.
ContainerInfoRequest
)
(
*
cadvisorapi
.
ContainerInfo
,
error
)
{
return
&
cadvisorapi
.
ContainerInfo
{},
nil
}
func
(
cu
*
cadvisorStub
)
ContainerInfoV2
(
name
string
,
options
cadvisorapiv2
.
RequestOptions
)
(
map
[
string
]
cadvisorapiv2
.
ContainerInfo
,
error
)
{
return
make
(
map
[
string
]
cadvisorapiv2
.
ContainerInfo
),
nil
}
func
(
cu
*
cadvisorStub
)
SubcontainerInfo
(
name
string
,
req
*
cadvisorapi
.
ContainerInfoRequest
)
(
map
[
string
]
*
cadvisorapi
.
ContainerInfo
,
error
)
{
return
nil
,
nil
}
func
(
cu
*
cadvisorStub
)
MachineInfo
()
(
*
cadvisorapi
.
MachineInfo
,
error
)
{
return
&
cadvisorapi
.
MachineInfo
{},
nil
}
func
(
cu
*
cadvisorStub
)
VersionInfo
()
(
*
cadvisorapi
.
VersionInfo
,
error
)
{
return
&
cadvisorapi
.
VersionInfo
{},
nil
}
func
(
cu
*
cadvisorStub
)
ImagesFsInfo
()
(
cadvisorapiv2
.
FsInfo
,
error
)
{
return
cadvisorapiv2
.
FsInfo
{},
nil
}
func
(
cu
*
cadvisorStub
)
RootFsInfo
()
(
cadvisorapiv2
.
FsInfo
,
error
)
{
return
cadvisorapiv2
.
FsInfo
{},
nil
}
func
(
cu
*
cadvisorStub
)
WatchEvents
(
request
*
events
.
Request
)
(
*
events
.
EventChannel
,
error
)
{
return
&
events
.
EventChannel
{},
nil
}
pkg/kubelet/cm/container_manager_stub.go
View file @
09285864
// +build !linux
/*
/*
Copyright 2015 The Kubernetes Authors.
Copyright 2015 The Kubernetes Authors.
...
@@ -23,8 +25,6 @@ import (
...
@@ -23,8 +25,6 @@ import (
type
containerManagerStub
struct
{}
type
containerManagerStub
struct
{}
var
_
ContainerManager
=
&
containerManagerStub
{}
func
(
cm
*
containerManagerStub
)
Start
(
_
*
api
.
Node
)
error
{
func
(
cm
*
containerManagerStub
)
Start
(
_
*
api
.
Node
)
error
{
glog
.
V
(
2
)
.
Infof
(
"Starting stub container manager"
)
glog
.
V
(
2
)
.
Infof
(
"Starting stub container manager"
)
return
nil
return
nil
...
...
pkg/kubelet/cm/container_manager_unsupported.go
deleted
100644 → 0
View file @
dad0445b
// +build !linux
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
cm
import
(
"fmt"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
"k8s.io/kubernetes/pkg/util/mount"
)
type
unsupportedContainerManager
struct
{
}
var
_
ContainerManager
=
&
unsupportedContainerManager
{}
func
(
unsupportedContainerManager
)
Start
(
_
*
api
.
Node
)
error
{
return
fmt
.
Errorf
(
"Container Manager is unsupported in this build"
)
}
func
(
unsupportedContainerManager
)
SystemCgroupsLimit
()
api
.
ResourceList
{
return
api
.
ResourceList
{}
}
func
(
unsupportedContainerManager
)
GetNodeConfig
()
NodeConfig
{
return
NodeConfig
{}
}
func
(
unsupportedContainerManager
)
GetMountedSubsystems
()
*
CgroupSubsystems
{
return
&
CgroupSubsystems
{}
}
func
(
unsupportedContainerManager
)
GetQOSContainersInfo
()
QOSContainersInfo
{
return
QOSContainersInfo
{}
}
func
(
cm
*
unsupportedContainerManager
)
Status
()
Status
{
return
Status
{}
}
func
(
cm
*
unsupportedContainerManager
)
NewPodContainerManager
()
PodContainerManager
{
return
&
unsupportedPodContainerManager
{}
}
func
NewContainerManager
(
_
mount
.
Interface
,
_
cadvisor
.
Interface
,
_
NodeConfig
)
(
ContainerManager
,
error
)
{
return
&
unsupportedContainerManager
{},
nil
}
pkg/kubelet/dockertools/docker_manager.go
View file @
09285864
This diff is collapsed.
Click to expand it.
pkg/volume/volume.go
View file @
09285864
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
volume
package
volume
import
(
import
(
"io"
"io/ioutil"
"io/ioutil"
"os"
"os"
"path"
"path"
...
@@ -213,9 +214,63 @@ func RenameDirectory(oldPath, newName string) (string, error) {
...
@@ -213,9 +214,63 @@ func RenameDirectory(oldPath, newName string) (string, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
err
=
os
.
Rename
(
oldPath
,
newPath
)
// os.Rename call fails on windows (https://github.com/golang/go/issues/14527)
// Replacing with copyFolder to the newPath and deleting the oldPath directory
// err = os.Rename(oldPath, newPath)
err
=
copyFolder
(
oldPath
,
newPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
os
.
RemoveAll
(
oldPath
)
return
newPath
,
nil
return
newPath
,
nil
}
}
func
copyFolder
(
source
string
,
dest
string
)
(
err
error
)
{
directory
,
_
:=
os
.
Open
(
source
)
objects
,
err
:=
directory
.
Readdir
(
-
1
)
for
_
,
obj
:=
range
objects
{
sourcefilepointer
:=
source
+
"/"
+
obj
.
Name
()
destinationfilepointer
:=
dest
+
"/"
+
obj
.
Name
()
if
obj
.
IsDir
()
{
err
=
copyFolder
(
sourcefilepointer
,
destinationfilepointer
)
if
err
!=
nil
{
return
err
}
}
else
{
err
=
copyFile
(
sourcefilepointer
,
destinationfilepointer
)
if
err
!=
nil
{
return
err
}
}
}
return
}
func
copyFile
(
source
string
,
dest
string
)
(
err
error
)
{
sourcefile
,
err
:=
os
.
Open
(
source
)
if
err
!=
nil
{
return
err
}
defer
sourcefile
.
Close
()
destfile
,
err
:=
os
.
Create
(
dest
)
if
err
!=
nil
{
return
err
}
defer
destfile
.
Close
()
_
,
err
=
io
.
Copy
(
destfile
,
sourcefile
)
if
err
==
nil
{
sourceinfo
,
err
:=
os
.
Stat
(
source
)
if
err
!=
nil
{
err
=
os
.
Chmod
(
dest
,
sourceinfo
.
Mode
())
}
}
return
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment