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

Closed

Conversation

lancelot1989
Copy link
Contributor

@lancelot1989 lancelot1989 commented Oct 29, 2024

@CLAassistant
Copy link

CLAassistant commented Oct 29, 2024

CLA assistant check
All committers have signed the CLA.

@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

@shanshanying
Copy link
Contributor

This feature is supported in Opsdef instead.

@github-actions github-actions bot added this to the Release 0.9.2 milestone Nov 14, 2024
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