Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Rename rke2ServerConfig to make it public #433

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/rke2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ sysctl -p /etc/sysctl.d/90-rke2-cis.conf
`
)

type rke2ServerConfig struct {
// ServerConfig is a struct that contains the information needed to generate a RKE2 server config.
type ServerConfig struct {
AdvertiseAddress string `json:"advertise-address,omitempty"`
AuditPolicyFile string `json:"audit-policy-file,omitempty"`
BindAddress string `json:"bind-address,omitempty"`
Expand Down Expand Up @@ -164,8 +165,8 @@ type ServerConfigOpts struct {
Version string
}

func newRKE2ServerConfig(opts ServerConfigOpts) (*rke2ServerConfig, []bootstrapv1.File, error) { // nolint:gocyclo
rke2ServerConfig := &rke2ServerConfig{}
func newRKE2ServerConfig(opts ServerConfigOpts) (*ServerConfig, []bootstrapv1.File, error) { // nolint:gocyclo
rke2ServerConfig := &ServerConfig{}
files := []bootstrapv1.File{}
rke2ServerConfig.AdvertiseAddress = opts.ServerConfig.AdvertiseAddress

Expand Down Expand Up @@ -543,7 +544,7 @@ func newRKE2AgentConfig(opts AgentConfigOpts) (*rke2AgentConfig, []bootstrapv1.F
}

// GenerateInitControlPlaneConfig generates the rke2 server and agent config for the init control plane node.
func GenerateInitControlPlaneConfig(opts ServerConfigOpts) (*rke2ServerConfig, []bootstrapv1.File, error) {
func GenerateInitControlPlaneConfig(opts ServerConfigOpts) (*ServerConfig, []bootstrapv1.File, error) {
if opts.Token == "" {
return nil, nil, fmt.Errorf("token is required")
}
Expand All @@ -570,7 +571,7 @@ func GenerateInitControlPlaneConfig(opts ServerConfigOpts) (*rke2ServerConfig, [
}

// GenerateJoinControlPlaneConfig generates the rke2 agent config for joining a control plane node.
func GenerateJoinControlPlaneConfig(opts ServerConfigOpts) (*rke2ServerConfig, []bootstrapv1.File, error) {
func GenerateJoinControlPlaneConfig(opts ServerConfigOpts) (*ServerConfig, []bootstrapv1.File, error) {
if opts.ServerURL == "" {
return nil, nil, fmt.Errorf("server url is required")
}
Expand Down