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
a4b29530
Commit
a4b29530
authored
Aug 19, 2020
by
Brian Downs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add setup hook capabilities for rke2
Signed-off-by:
Brian Downs
<
brian.downs@gmail.com
>
parent
5859f83d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
0 deletions
+9
-0
server.go
pkg/cli/cmds/server.go
+2
-0
server.go
pkg/cli/server/server.go
+2
-0
server.go
pkg/server/server.go
+4
-0
types.go
pkg/server/types.go
+1
-0
No files found.
pkg/cli/cmds/server.go
View file @
a4b29530
package
cmds
package
cmds
import
(
import
(
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/rancher/k3s/pkg/version"
"github.com/rancher/k3s/pkg/version"
"github.com/rancher/spur/cli"
"github.com/rancher/spur/cli"
"github.com/rancher/spur/cli/altsrc"
"github.com/rancher/spur/cli/altsrc"
...
@@ -54,6 +55,7 @@ type Server struct {
...
@@ -54,6 +55,7 @@ type Server struct {
ClusterInit
bool
ClusterInit
bool
ClusterReset
bool
ClusterReset
bool
EncryptSecrets
bool
EncryptSecrets
bool
SetupHooks
[]
func
(
config
.
Control
)
error
}
}
var
ServerConfig
Server
var
ServerConfig
Server
...
...
pkg/cli/server/server.go
View file @
a4b29530
...
@@ -193,6 +193,8 @@ func run(app *cli.Context, cfg *cmds.Server) error {
...
@@ -193,6 +193,8 @@ func run(app *cli.Context, cfg *cmds.Server) error {
return
errors
.
Wrap
(
err
,
"Invalid tls-min-version"
)
return
errors
.
Wrap
(
err
,
"Invalid tls-min-version"
)
}
}
serverConfig
.
SetupHooks
=
append
(
serverConfig
.
SetupHooks
,
cfg
.
SetupHooks
...
)
// TLS config based on mozilla ssl-config generator
// TLS config based on mozilla ssl-config generator
// https://ssl-config.mozilla.org/#server=golang&version=1.13.6&config=intermediate&guideline=5.4
// https://ssl-config.mozilla.org/#server=golang&version=1.13.6&config=intermediate&guideline=5.4
// Need to disable the TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Cipher for TLS1.2
// Need to disable the TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Cipher for TLS1.2
...
...
pkg/server/server.go
View file @
a4b29530
...
@@ -60,6 +60,10 @@ func StartServer(ctx context.Context, config *Config) error {
...
@@ -60,6 +60,10 @@ func StartServer(ctx context.Context, config *Config) error {
return
errors
.
Wrap
(
err
,
"starting tls server"
)
return
errors
.
Wrap
(
err
,
"starting tls server"
)
}
}
for
_
,
hook
:=
range
config
.
SetupHooks
{
hook
(
config
.
ControlConfig
)
}
ip
:=
net2
.
ParseIP
(
config
.
ControlConfig
.
BindAddress
)
ip
:=
net2
.
ParseIP
(
config
.
ControlConfig
.
BindAddress
)
if
ip
==
nil
{
if
ip
==
nil
{
hostIP
,
err
:=
net
.
ChooseHostInterface
()
hostIP
,
err
:=
net
.
ChooseHostInterface
()
...
...
pkg/server/types.go
View file @
a4b29530
...
@@ -10,4 +10,5 @@ type Config struct {
...
@@ -10,4 +10,5 @@ type Config struct {
ControlConfig
config
.
Control
ControlConfig
config
.
Control
Rootless
bool
Rootless
bool
SupervisorPort
int
SupervisorPort
int
SetupHooks
[]
func
(
config
.
Control
)
error
}
}
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