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
cc96f814
Unverified
Commit
cc96f814
authored
Jan 11, 2021
by
Chin-Ya Huang
Committed by
Erik Wilson
Mar 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow download traefik static file and rename
Allow writing static files regardless of the version. Signed-off-by:
Chin-Ya Huang
<
chin-ya.huang@suse.com
>
parent
10e03289
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
server.go
pkg/server/server.go
+4
-5
stage.go
pkg/static/stage.go
+1
-6
No files found.
pkg/server/server.go
View file @
cc96f814
...
...
@@ -204,8 +204,7 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
func
stageFiles
(
ctx
context
.
Context
,
sc
*
Context
,
controlConfig
*
config
.
Control
)
error
{
dataDir
:=
filepath
.
Join
(
controlConfig
.
DataDir
,
"static"
)
stageTraefik
:=
doStageTraefik
(
sc
)
if
err
:=
static
.
Stage
(
dataDir
,
stageTraefik
);
err
!=
nil
{
if
err
:=
static
.
Stage
(
dataDir
);
err
!=
nil
{
return
err
}
dataDir
=
filepath
.
Join
(
controlConfig
.
DataDir
,
"manifests"
)
...
...
@@ -216,7 +215,7 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
}
skip
:=
controlConfig
.
Skips
if
!
stageTraefik
{
if
!
checkStageTraefik
(
sc
)
{
skip
[
"traefik"
]
=
true
skip
[
"traefik-crd"
]
=
true
}
...
...
@@ -227,13 +226,13 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
return
deploy
.
WatchFiles
(
ctx
,
sc
.
Apply
,
sc
.
K3s
.
K3s
()
.
V1
()
.
Addon
(),
controlConfig
.
Disables
,
dataDir
)
}
//
do
StageTraefik checks on running traefik HelmChart version and traefik
//
check
StageTraefik checks on running traefik HelmChart version and traefik
// HelmChartConfig.
// Traefik should skip stage when it is v1 and have existing customize traefik
// HelmChartConfig due to the incompatible configuration from v1 to v2.
// It will progress stage on upgrade or restart when no customized traefik
// HelmChartConfig exists on the cluster.
func
do
StageTraefik
(
sc
*
Context
)
bool
{
func
check
StageTraefik
(
sc
*
Context
)
bool
{
if
isHelmChartTraefikV1
(
sc
)
&&
isHelmChartConfigExist
(
sc
,
"traefik"
)
{
return
false
}
...
...
pkg/static/stage.go
View file @
cc96f814
...
...
@@ -6,18 +6,13 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
func
Stage
(
dataDir
string
,
isStageTraefik
bool
)
error
{
func
Stage
(
dataDir
string
)
error
{
for
_
,
name
:=
range
AssetNames
()
{
if
!
isStageTraefik
&&
strings
.
HasPrefix
(
name
,
"charts/traefik-"
)
{
logrus
.
WithField
(
"name"
,
name
)
.
Info
(
"Skip staging"
)
continue
}
content
,
err
:=
Asset
(
name
)
if
err
!=
nil
{
return
err
...
...
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