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
9a57e6fd
Unverified
Commit
9a57e6fd
authored
Mar 25, 2019
by
Darren Shepherd
Committed by
GitHub
Mar 25, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #257 from mortenlj/master
Skip writing manifest when using `--no-deploy`
parents
4e158451
9033891f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
controller.go
pkg/deploy/controller.go
+1
-6
stage.go
pkg/deploy/stage.go
+9
-1
server.go
pkg/server/server.go
+2
-2
No files found.
pkg/deploy/controller.go
View file @
9a57e6fd
...
@@ -35,14 +35,13 @@ const (
...
@@ -35,14 +35,13 @@ const (
startKey
=
"_start_"
startKey
=
"_start_"
)
)
func
WatchFiles
(
ctx
context
.
Context
,
skips
[]
string
,
bases
...
string
)
error
{
func
WatchFiles
(
ctx
context
.
Context
,
bases
...
string
)
error
{
server
:=
norman
.
GetServer
(
ctx
)
server
:=
norman
.
GetServer
(
ctx
)
addons
:=
v1
.
ClientsFrom
(
ctx
)
.
Addon
addons
:=
v1
.
ClientsFrom
(
ctx
)
.
Addon
w
:=
&
watcher
{
w
:=
&
watcher
{
addonCache
:
addons
.
Cache
(),
addonCache
:
addons
.
Cache
(),
addons
:
addons
,
addons
:
addons
,
skips
:
skips
,
bases
:
bases
,
bases
:
bases
,
restConfig
:
*
server
.
Runtime
.
LocalConfig
,
restConfig
:
*
server
.
Runtime
.
LocalConfig
,
discovery
:
server
.
K8sClient
.
Discovery
(),
discovery
:
server
.
K8sClient
.
Discovery
(),
...
@@ -64,7 +63,6 @@ type watcher struct {
...
@@ -64,7 +63,6 @@ type watcher struct {
addonCache
v1
.
AddonClientCache
addonCache
v1
.
AddonClientCache
addons
v1
.
AddonClient
addons
v1
.
AddonClient
bases
[]
string
bases
[]
string
skips
[]
string
restConfig
rest
.
Config
restConfig
rest
.
Config
discovery
discovery
.
DiscoveryInterface
discovery
discovery
.
DiscoveryInterface
clients
map
[
schema
.
GroupVersionKind
]
*
objectclient
.
ObjectClient
clients
map
[
schema
.
GroupVersionKind
]
*
objectclient
.
ObjectClient
...
@@ -107,9 +105,6 @@ func (w *watcher) listFilesIn(base string, force bool) error {
...
@@ -107,9 +105,6 @@ func (w *watcher) listFilesIn(base string, force bool) error {
}
}
skips
:=
map
[
string
]
bool
{}
skips
:=
map
[
string
]
bool
{}
for
_
,
skip
:=
range
w
.
skips
{
skips
[
skip
]
=
true
}
for
_
,
file
:=
range
files
{
for
_
,
file
:=
range
files
{
if
strings
.
HasSuffix
(
file
.
Name
(),
".skip"
)
{
if
strings
.
HasSuffix
(
file
.
Name
(),
".skip"
)
{
skips
[
strings
.
TrimSuffix
(
file
.
Name
(),
".skip"
)]
=
true
skips
[
strings
.
TrimSuffix
(
file
.
Name
(),
".skip"
)]
=
true
...
...
pkg/deploy/stage.go
View file @
9a57e6fd
...
@@ -9,10 +9,18 @@ import (
...
@@ -9,10 +9,18 @@ import (
"path/filepath"
"path/filepath"
)
)
func
Stage
(
dataDir
string
,
templateVars
map
[
string
]
string
)
error
{
func
Stage
(
dataDir
string
,
templateVars
map
[
string
]
string
,
skipList
[]
string
)
error
{
os
.
MkdirAll
(
dataDir
,
0700
)
os
.
MkdirAll
(
dataDir
,
0700
)
skips
:=
map
[
string
]
bool
{}
for
_
,
skip
:=
range
skipList
{
skips
[
skip
]
=
true
}
for
_
,
name
:=
range
AssetNames
()
{
for
_
,
name
:=
range
AssetNames
()
{
if
skips
[
name
]
{
continue
}
content
,
err
:=
Asset
(
name
)
content
,
err
:=
Asset
(
name
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
pkg/server/server.go
View file @
9a57e6fd
...
@@ -126,10 +126,10 @@ func startNorman(ctx context.Context, config *Config) (string, error) {
...
@@ -126,10 +126,10 @@ func startNorman(ctx context.Context, config *Config) (string, error) {
func
(
ctx
context
.
Context
)
error
{
func
(
ctx
context
.
Context
)
error
{
dataDir
:=
filepath
.
Join
(
controlConfig
.
DataDir
,
"manifests"
)
dataDir
:=
filepath
.
Join
(
controlConfig
.
DataDir
,
"manifests"
)
templateVars
:=
map
[
string
]
string
{
"%{CLUSTER_DNS}%"
:
controlConfig
.
ClusterDNS
.
String
()}
templateVars
:=
map
[
string
]
string
{
"%{CLUSTER_DNS}%"
:
controlConfig
.
ClusterDNS
.
String
()}
if
err
:=
deploy
.
Stage
(
dataDir
,
templateVars
);
err
!=
nil
{
if
err
:=
deploy
.
Stage
(
dataDir
,
templateVars
,
controlConfig
.
Skips
);
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
deploy
.
WatchFiles
(
ctx
,
controlConfig
.
Skips
,
dataDir
);
err
!=
nil
{
if
err
:=
deploy
.
WatchFiles
(
ctx
,
dataDir
);
err
!=
nil
{
return
err
return
err
}
}
return
nil
return
nil
...
...
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