Skip to content

Commit

Permalink
Merge ipsec fix from #262
Browse files Browse the repository at this point in the history
Includes the change by @bobhenkel in #262 - thank you Bob.

Closes: #262
Fixes: #183
Fixes: #245

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Oct 7, 2020
1 parent fd18d77 commit 80383dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func makeInstallExec(cluster bool, ip net.IP, tlsSAN string, options k3sExecOpti
extraArgs = append(extraArgs, fmt.Sprintf("--datastore-endpoint %s", options.Datastore))
}
if options.FlannelIPSec {
extraArgs = append(extraArgs, fmt.Sprintf("'--flannel-backend %s'", "ipsec"))
extraArgs = append(extraArgs, "--flannel-backend ipsec")
}

if options.NoExtras {
Expand Down
21 changes: 21 additions & 0 deletions cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,27 @@ func Test_makeInstallExec_SAN(t *testing.T) {
}
}

func Test_makeInstallExec_IPSec(t *testing.T) {
cluster := false
datastore := ""
flannelIPSec := true
k3sNoExtras := false
k3sExtraArgs := ""
ip := net.ParseIP("127.0.0.1")
tlsSAN := ""
got := makeInstallExec(cluster, ip, tlsSAN,
k3sExecOptions{
Datastore: datastore,
FlannelIPSec: flannelIPSec,
NoExtras: k3sNoExtras,
ExtraArgs: k3sExtraArgs,
})
want := "INSTALL_K3S_EXEC='server --tls-san 127.0.0.1 --flannel-backend ipsec'"
if got != want {
t.Errorf("want: %q, got: %q", want, got)
}
}

func Test_makeInstallExec_Datastore(t *testing.T) {
cluster := false
datastore := "mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb"
Expand Down

0 comments on commit 80383dd

Please sign in to comment.