Skip to content

Commit

Permalink
Rename rke2ServerConfig to make it public
Browse files Browse the repository at this point in the history
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
  • Loading branch information
furkatgofurov7 committed Sep 9, 2024
1 parent 967b2da commit f1281d5
Showing 1 changed file with 6 additions and 5 deletions.
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

0 comments on commit f1281d5

Please sign in to comment.