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
44634088
Unverified
Commit
44634088
authored
Mar 25, 2019
by
Darren Shepherd
Committed by
GitHub
Mar 25, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #239 from takmatsu/add-hosts
Add tls-san flag
parents
9a57e6fd
3a6b3054
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
server.go
pkg/cli/cmds/server.go
+6
-0
server.go
pkg/cli/server/server.go
+3
-5
No files found.
pkg/cli/cmds/server.go
View file @
44634088
...
...
@@ -16,6 +16,7 @@ type Server struct {
DisableAgent
bool
KubeConfigOutput
string
KubeConfigMode
string
KnownIPs
cli
.
StringSlice
}
var
ServerConfig
Server
...
...
@@ -94,6 +95,11 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Destination
:
&
ServerConfig
.
KubeConfigMode
,
EnvVar
:
"K3S_KUBECONFIG_MODE"
,
},
cli
.
StringSliceFlag
{
Name
:
"tls-san"
,
Usage
:
"Add additional hostname or IP as a Subject Alternative Name in the TLS cert"
,
Value
:
&
ServerConfig
.
KnownIPs
,
},
NodeIPFlag
,
NodeNameFlag
,
DockerFlag
,
...
...
pkg/cli/server/server.go
View file @
44634088
...
...
@@ -77,7 +77,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {
serverConfig
.
ControlConfig
.
KubeConfigMode
=
cfg
.
KubeConfigMode
serverConfig
.
TLSConfig
.
HTTPSPort
=
cfg
.
HTTPSPort
serverConfig
.
TLSConfig
.
HTTPPort
=
cfg
.
HTTPPort
serverConfig
.
TLSConfig
.
KnownIPs
=
knownIPs
()
serverConfig
.
TLSConfig
.
KnownIPs
=
knownIPs
(
cfg
.
KnownIPs
)
_
,
serverConfig
.
ControlConfig
.
ClusterIPRange
,
err
=
net2
.
ParseCIDR
(
cfg
.
ClusterCIDR
)
if
err
!=
nil
{
...
...
@@ -146,10 +146,8 @@ func run(app *cli.Context, cfg *cmds.Server) error {
return
agent
.
Run
(
ctx
,
agentConfig
)
}
func
knownIPs
()
[]
string
{
ips
:=
[]
string
{
"127.0.0.1"
,
}
func
knownIPs
(
ips
[]
string
)
[]
string
{
ips
=
append
(
ips
,
"127.0.0.1"
)
ip
,
err
:=
net
.
ChooseHostInterface
()
if
err
==
nil
{
ips
=
append
(
ips
,
ip
.
String
())
...
...
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