Skip to content

Don't allow empty rsName in Router.RemoveInstance #59

@nurzhan-saktaganov

Description

@nurzhan-saktaganov

In #57 we started allowing an empty rsName to simplify logic in ETCD provider.
Later, we discussed and decided to keep the core code as simple as possible for maintainability reasons.
Therefore, we should remove supporting empty rsName in RemoveInstance and move the code complexity to an external provider for ETCD.

if rsName == "" {
r.log().Debugf(ctx, "Replicaset name is not provided for instance %s, attempting to find it",
instanceName)
for _, trs := range nameToReplicasetRef {
_, exists := trs.conn.GetInfo()[instanceName]
if exists {
r.log().Debugf(ctx, "Replicaset found for instance %s, removing it", instanceName)
rs = trs
}
}
} else {

Metadata

Metadata

Assignees

No one assigned

    Labels

    code healthImprove code readability, simplify maintenance and so on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions