-
Notifications
You must be signed in to change notification settings - Fork 175
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
feat: switchover supports Sharding API #8352
base: release-0.9
Are you sure you want to change the base?
Conversation
lancelot1989
commented
Oct 29, 2024
•
edited by shanshanying
Loading
edited by shanshanying
- fix [Improvement]Switchover improve to support Sharding API #8351
|
shardingSpec := opsRes.Cluster.Spec.GetShardingByName(switchover.ComponentName) | ||
var synthesizedComp *component.SynthesizedComponent | ||
var err error | ||
if nil != compSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compSpec != nil
return validateBaseOnClusterCompDef(cluster.Spec.GetComponentDefRefName(switchover.ComponentName)) | ||
} | ||
} | ||
if shardingSpec != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use else if
, component name is unique in cluster
return nil, err | ||
} | ||
} | ||
if nil != shardingSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto and useelse if
} | ||
return comps, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can reuse the intctrlutil.ListShardingComponents
function
Hi @lancelot1989 , Thanks for your PR. |
component = cmp | ||
break | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check whether component is nil