Skip to content
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

Open
wants to merge 1 commit into
base: release-0.9
Choose a base branch
from

Conversation

lancelot1989
Copy link

@lancelot1989 lancelot1989 commented Oct 29, 2024

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the size/XL Denotes a PR that changes 500-999 lines. label Oct 29, 2024
@apecloud-bot apecloud-bot added the pre-approve Fork PR Pre Approve Test label Oct 29, 2024
shardingSpec := opsRes.Cluster.Spec.GetShardingByName(switchover.ComponentName)
var synthesizedComp *component.SynthesizedComponent
var err error
if nil != compSpec {
Copy link
Contributor

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 {
Copy link
Contributor

@wangyelei wangyelei Oct 30, 2024

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 {
Copy link
Contributor

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
}

Copy link
Contributor

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

@shanshanying
Copy link
Contributor

Hi @lancelot1989 ,

Thanks for your PR.
PKAL @wangyelei @Y-Rookie

component = cmp
break
}
}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre-approve Fork PR Pre Approve Test size/XL Denotes a PR that changes 500-999 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants