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
54a35505
Unverified
Commit
54a35505
authored
Feb 10, 2021
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Traefik v1 migration
parent
cc96f814
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
26 deletions
+2
-26
server.go
pkg/server/server.go
+2
-26
No files found.
pkg/server/server.go
View file @
54a35505
...
@@ -215,9 +215,9 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
...
@@ -215,9 +215,9 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
}
}
skip
:=
controlConfig
.
Skips
skip
:=
controlConfig
.
Skips
if
!
checkStageTraefik
(
sc
)
{
if
!
skip
[
"traefik"
]
&&
isHelmChartTraefikV1
(
sc
)
{
logrus
.
Warn
(
"Skipping Traefik v2 deployment due to existing Traefik v1 installation"
)
skip
[
"traefik"
]
=
true
skip
[
"traefik"
]
=
true
skip
[
"traefik-crd"
]
=
true
}
}
if
err
:=
deploy
.
Stage
(
dataDir
,
templateVars
,
skip
);
err
!=
nil
{
if
err
:=
deploy
.
Stage
(
dataDir
,
templateVars
,
skip
);
err
!=
nil
{
return
err
return
err
...
@@ -226,19 +226,6 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
...
@@ -226,19 +226,6 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
return
deploy
.
WatchFiles
(
ctx
,
sc
.
Apply
,
sc
.
K3s
.
K3s
()
.
V1
()
.
Addon
(),
controlConfig
.
Disables
,
dataDir
)
return
deploy
.
WatchFiles
(
ctx
,
sc
.
Apply
,
sc
.
K3s
.
K3s
()
.
V1
()
.
Addon
(),
controlConfig
.
Disables
,
dataDir
)
}
}
// checkStageTraefik 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
checkStageTraefik
(
sc
*
Context
)
bool
{
if
isHelmChartTraefikV1
(
sc
)
&&
isHelmChartConfigExist
(
sc
,
"traefik"
)
{
return
false
}
return
true
}
// isHelmChartTraefikV1 checks the chart with "traefik-1." prefix.
// isHelmChartTraefikV1 checks the chart with "traefik-1." prefix.
func
isHelmChartTraefikV1
(
sc
*
Context
)
bool
{
func
isHelmChartTraefikV1
(
sc
*
Context
)
bool
{
prefix
:=
"traefik-1."
prefix
:=
"traefik-1."
...
@@ -255,17 +242,6 @@ func isHelmChartTraefikV1(sc *Context) bool {
...
@@ -255,17 +242,6 @@ func isHelmChartTraefikV1(sc *Context) bool {
return
false
return
false
}
}
func
isHelmChartConfigExist
(
sc
*
Context
,
name
string
)
bool
{
helmChartConfig
:=
sc
.
Helm
.
Helm
()
.
V1
()
.
HelmChartConfig
()
_
,
err
:=
helmChartConfig
.
Get
(
metav1
.
NamespaceSystem
,
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
logrus
.
WithField
(
"name"
,
name
)
.
Info
(
"Not find HelmChartConfig"
)
return
false
}
logrus
.
WithField
(
"name"
,
name
)
.
Info
(
"Found HelmChartConfig "
)
return
true
}
func
HomeKubeConfig
(
write
,
rootless
bool
)
(
string
,
error
)
{
func
HomeKubeConfig
(
write
,
rootless
bool
)
(
string
,
error
)
{
if
write
{
if
write
{
if
os
.
Getuid
()
==
0
&&
!
rootless
{
if
os
.
Getuid
()
==
0
&&
!
rootless
{
...
...
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