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
9c237349
Unverified
Commit
9c237349
authored
Jun 08, 2021
by
Manuel Buil
Committed by
GitHub
Jun 08, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3417 from manuelbuil/replaceAll
Change Replace with ReplaceAll function
parents
bd840120
243fd14c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
setup.go
pkg/agent/flannel/setup.go
+3
-3
No files found.
pkg/agent/flannel/setup.go
View file @
9c237349
...
@@ -118,7 +118,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
...
@@ -118,7 +118,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
logrus
.
Infof
(
"Using custom flannel conf defined at %s"
,
nodeConfig
.
FlannelConf
)
logrus
.
Infof
(
"Using custom flannel conf defined at %s"
,
nodeConfig
.
FlannelConf
)
return
nil
return
nil
}
}
confJSON
:=
strings
.
Replace
(
flannelConf
,
"%CIDR%"
,
nodeConfig
.
AgentConfig
.
ClusterCIDR
.
String
(),
-
1
)
confJSON
:=
strings
.
Replace
All
(
flannelConf
,
"%CIDR%"
,
nodeConfig
.
AgentConfig
.
ClusterCIDR
.
String
()
)
var
backendConf
string
var
backendConf
string
...
@@ -128,7 +128,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
...
@@ -128,7 +128,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
case
config
.
FlannelBackendHostGW
:
case
config
.
FlannelBackendHostGW
:
backendConf
=
hostGWBackend
backendConf
=
hostGWBackend
case
config
.
FlannelBackendIPSEC
:
case
config
.
FlannelBackendIPSEC
:
backendConf
=
strings
.
Replace
(
ipsecBackend
,
"%psk%"
,
nodeConfig
.
AgentConfig
.
IPSECPSK
,
-
1
)
backendConf
=
strings
.
Replace
All
(
ipsecBackend
,
"%psk%"
,
nodeConfig
.
AgentConfig
.
IPSECPSK
)
if
err
:=
setupStrongSwan
(
nodeConfig
);
err
!=
nil
{
if
err
:=
setupStrongSwan
(
nodeConfig
);
err
!=
nil
{
return
err
return
err
}
}
...
@@ -137,7 +137,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
...
@@ -137,7 +137,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
default
:
default
:
return
fmt
.
Errorf
(
"Cannot configure unknown flannel backend '%s'"
,
nodeConfig
.
FlannelBackend
)
return
fmt
.
Errorf
(
"Cannot configure unknown flannel backend '%s'"
,
nodeConfig
.
FlannelBackend
)
}
}
confJSON
=
strings
.
Replace
(
confJSON
,
"%backend%"
,
backendConf
,
-
1
)
confJSON
=
strings
.
Replace
All
(
confJSON
,
"%backend%"
,
backendConf
)
return
util
.
WriteFile
(
nodeConfig
.
FlannelConf
,
confJSON
)
return
util
.
WriteFile
(
nodeConfig
.
FlannelConf
,
confJSON
)
}
}
...
...
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