Skip to content

Commit

Permalink
chore: remove KubeBlocks type roleArbitrator and replace with Lorry (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Rookie authored Dec 14, 2023
1 parent 1ea66c3 commit 9c6bdcf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions apis/apps/v1alpha1/componentdefinition_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ type SystemAccount struct {
type RoleArbitrator string

const (
ExternalRoleArbitrator RoleArbitrator = "External"
KubeBlocksRoleArbitrator RoleArbitrator = "KubeBlocks"
LorryRoleArbitrator RoleArbitrator = "Lorry"
ExternalRoleArbitrator RoleArbitrator = "External"
LorryRoleArbitrator RoleArbitrator = "Lorry"
)

// ReplicaRole represents a role that can be assumed by a component instance.
Expand Down
2 changes: 1 addition & 1 deletion controllers/apps/transformer_component_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (r *componentStatusHandler) updateComponentStatus(phaseTransitionMsg string
// In the future, there is a need for a better design to replace this kind of workaround.
func (r *componentStatusHandler) updatePrimaryIndex() error {
// TODO(xingran): consider if there are alternative ways to determine whether it is necessary to specify primary info in the Controller
if r.synthesizeComp.RoleArbitrator == nil || *r.synthesizeComp.RoleArbitrator != appsv1alpha1.KubeBlocksRoleArbitrator {
if r.synthesizeComp.RoleArbitrator == nil || *r.synthesizeComp.RoleArbitrator != appsv1alpha1.LorryRoleArbitrator {
return nil
}
podList, err := component.ListPodOwnedByComponent(r.reqCtx.Ctx, r.cli, r.cluster.Namespace, constant.GetComponentWellKnownLabels(r.cluster.Name, r.synthesizeComp.Name))
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/component/component_definition_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (c *compDefRoleArbitratorConvertor) convert(args ...any) (any, error) {

// TODO(xingran): it is hacky, should be refactored
if clusterCompDef.WorkloadType == appsv1alpha1.Replication && clusterCompDef.CharacterType == constant.RedisCharacterType {
roleArbitrator := appsv1alpha1.KubeBlocksRoleArbitrator
roleArbitrator := appsv1alpha1.LorryRoleArbitrator
return &roleArbitrator, nil
}

Expand Down

0 comments on commit 9c6bdcf

Please sign in to comment.