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
5d0e5d7d
Commit
5d0e5d7d
authored
May 05, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inject dependencies to rkt
parent
1b7749b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
gc.go
pkg/kubelet/rkt/gc.go
+2
-3
rkt_linux.go
pkg/kubelet/rkt/rkt_linux.go
+14
-6
rkt_unsupported.go
pkg/kubelet/rkt/rkt_unsupported.go
+9
-0
No files found.
pkg/kubelet/rkt/gc.go
View file @
5d0e5d7d
...
@@ -18,11 +18,10 @@ package rkt
...
@@ -18,11 +18,10 @@ package rkt
// ImageManager manages and garbage collects the container images for rkt.
// ImageManager manages and garbage collects the container images for rkt.
type
ImageManager
struct
{
type
ImageManager
struct
{
runtime
*
runtime
}
}
func
NewImageManager
(
r
*
runtime
)
*
ImageManager
{
func
NewImageManager
()
*
ImageManager
{
return
&
ImageManager
{
runtime
:
r
}
return
&
ImageManager
{}
}
}
// GarbageCollect collects the images. It is not implemented by rkt yet.
// GarbageCollect collects the images. It is not implemented by rkt yet.
...
...
pkg/kubelet/rkt/rkt_linux.go
View file @
5d0e5d7d
...
@@ -34,6 +34,7 @@ import (
...
@@ -34,6 +34,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
"github.com/GoogleCloudPlatform/kubernetes/pkg/credentialprovider"
"github.com/GoogleCloudPlatform/kubernetes/pkg/credentialprovider"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/prober"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/prober"
...
@@ -104,7 +105,11 @@ var _ kubecontainer.Runtime = &runtime{}
...
@@ -104,7 +105,11 @@ var _ kubecontainer.Runtime = &runtime{}
// New creates the rkt container runtime which implements the container runtime interface.
// New creates the rkt container runtime which implements the container runtime interface.
// It will test if the rkt binary is in the $PATH, and whether we can get the
// It will test if the rkt binary is in the $PATH, and whether we can get the
// version of it. If so, creates the rkt container runtime, otherwise returns an error.
// version of it. If so, creates the rkt container runtime, otherwise returns an error.
func
New
(
config
*
Config
)
(
kubecontainer
.
Runtime
,
error
)
{
func
New
(
config
*
Config
,
generator
kubecontainer
.
RunContainerOptionsGenerator
,
recorder
record
.
EventRecorder
,
containerRefManager
*
kubecontainer
.
RefManager
,
readinessManager
*
kubecontainer
.
ReadinessManager
)
(
kubecontainer
.
Runtime
,
error
)
{
systemdVersion
,
err
:=
getSystemdVersion
()
systemdVersion
,
err
:=
getSystemdVersion
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -129,11 +134,14 @@ func New(config *Config) (kubecontainer.Runtime, error) {
...
@@ -129,11 +134,14 @@ func New(config *Config) (kubecontainer.Runtime, error) {
}
}
rkt
:=
&
runtime
{
rkt
:=
&
runtime
{
systemd
:
systemd
,
generator
:
generator
,
rktBinAbsPath
:
rktBinAbsPath
,
readinessManager
:
readinessManager
,
config
:
config
,
systemd
:
systemd
,
dockerKeyring
:
credentialprovider
.
NewDockerKeyring
(),
rktBinAbsPath
:
rktBinAbsPath
,
}
config
:
config
,
dockerKeyring
:
credentialprovider
.
NewDockerKeyring
(),
}
rkt
.
prober
=
prober
.
New
(
rkt
,
readinessManager
,
containerRefManager
,
recorder
)
// Test the rkt version.
// Test the rkt version.
version
,
err
:=
rkt
.
Version
()
version
,
err
:=
rkt
.
Version
()
...
...
pkg/kubelet/rkt/rkt_unsupported.go
View file @
5d0e5d7d
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"io"
"io"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
)
)
...
@@ -32,6 +33,14 @@ type unsupportedRuntime struct {
...
@@ -32,6 +33,14 @@ type unsupportedRuntime struct {
var
_
kubecontainer
.
Runtime
=
&
unsupportedRuntime
{}
var
_
kubecontainer
.
Runtime
=
&
unsupportedRuntime
{}
func
New
(
config
*
Config
,
generator
kubecontainer
.
RunContainerOptionsGenerator
,
recorder
record
.
EventRecorder
,
containerRefManager
*
kubecontainer
.
RefManager
,
readinessManager
*
kubecontainer
.
ReadinessManager
)
(
kubecontainer
.
Runtime
,
error
)
{
return
nil
,
unsupportedError
}
var
unsupportedError
=
fmt
.
Errorf
(
"rkt runtime is unsupported in this platform"
)
var
unsupportedError
=
fmt
.
Errorf
(
"rkt runtime is unsupported in this platform"
)
func
(
ur
*
unsupportedRuntime
)
Version
()
(
kubecontainer
.
Version
,
error
)
{
func
(
ur
*
unsupportedRuntime
)
Version
()
(
kubecontainer
.
Version
,
error
)
{
...
...
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