Skip to content

Commit

Permalink
installer: rename the role name witness instead etcd
Browse files Browse the repository at this point in the history
Signed-off-by: Vicente Cheng <[email protected]>
  • Loading branch information
Vicente-Cheng committed Jan 10, 2024
1 parent c3aab22 commit 4f47e27
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const (
ModeInstall = "install"

RoleDefault = "default"
RoleEtcd = "etcd"
RoleWitness = "witness"

NetworkMethodDHCP = "dhcp"
NetworkMethodStatic = "static"
Expand Down
4 changes: 2 additions & 2 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,8 @@ func addAskRolePanel(c *Console) error {
Value: config.RoleDefault,
Text: "Default Role (Master or Worker)",
}, {
Value: config.RoleEtcd,
Text: "Worker (Etcd only)",
Value: config.RoleWitness,
Text: "Witness Role",
},
}, nil
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/console/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@ func doInstall(g *gocui.Gui, hvstConfig *config.HarvesterConfig, webhooks Render
}

// specific the node label for the specific node role
if hvstConfig.Role == config.RoleEtcd {
if hvstConfig.Role == config.RoleWitness {
if hvstConfig.Labels == nil {
hvstConfig.Labels = make(map[string]string)
}
hvstConfig.Labels[util.HarvesterEtcdNodeLabelKey] = "true"
hvstConfig.Labels[util.HarvesterWitnessNodeLabelKey] = "true"
}

env, elementalConfig, err := generateEnvAndConfig(g, hvstConfig)
Expand Down Expand Up @@ -777,11 +777,11 @@ func configureInstalledNode(g *gocui.Gui, hvstConfig *config.HarvesterConfig, we
webhooks.Handle(EventInstallStarted)

// specific the node label for the specific node role
if hvstConfig.Role == config.RoleEtcd {
if hvstConfig.Role == config.RoleWitness {
if hvstConfig.Labels == nil {
hvstConfig.Labels = make(map[string]string)
}
hvstConfig.Labels[util.HarvesterEtcdNodeLabelKey] = "true"
hvstConfig.Labels[util.HarvesterWitnessNodeLabelKey] = "true"
}

// skip rancherd and network config in the cos config
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

var (
HarvesterNodeRoleLabelPrefix = "node-role.harvesterhci.io/"
HarvesterEtcdNodeLabelKey = HarvesterNodeRoleLabelPrefix + "etcd"
HarvesterWitnessNodeLabelKey = HarvesterNodeRoleLabelPrefix + "witness"

sizeRegexp = regexp.MustCompile(`^(\d+)(Mi|Gi)$`)
)
Expand Down

0 comments on commit 4f47e27

Please sign in to comment.