Open
Conversation
mileszhang2016
requested changes
Feb 16, 2022
liuqing6767
suggested changes
Feb 18, 2022
mileszhang2016
requested changes
Mar 3, 2022
mileszhang2016
requested changes
Apr 6, 2022
added 2 commits
May 5, 2022 23:44
mileszhang2016
requested changes
Jun 2, 2022
|
|
||
| for typ := range type2InstancePoolList { | ||
| _, ok := pim.instancePoolStorages[typ] | ||
| for type2 := range type2PoolList { |
Member
There was a problem hiding this comment.
type2 => type?
如果type是保留字,可以用typeName。
type2不知道是什么意思
| rst := map[string]*InstancePool{} | ||
| for typ, pisList := range type2InstancePoolList { | ||
| storager := pim.instancePoolStorages[typ] | ||
| for type2, pisList := range type2PoolList { |
| // CanDelete check whether pool can be deleted, Check Logic: | ||
| // 1. Not BFE Cluster Refer To | ||
| // 2. Not SubCluster Refer To | ||
| func (m *PoolManager) CanDelete(ctx context.Context, pool *Pool) error { |
Member
There was a problem hiding this comment.
这个函数的返回值有些问题。
从函数名字看,应该“逻辑判断型”的返回值。
建议返回值改为 (bool, error),第一个返回值返回true/false,第二个返回错误的信息
| return | ||
| } | ||
|
|
||
| func (m *PoolManager) FetchBFEPools(ctx context.Context) (list []*Pool, err error) { |
| return | ||
| } | ||
|
|
||
| func poolNameJudger(productName string, poolName string) (realName string, err error) { |
Member
There was a problem hiding this comment.
poolNameJudger => poolNameGet
- *er一般是一个对象。这个函数显然只是一个操作
- 如果语义是judge/check,就没有“修改”的含义。改为Get后会好很多
|
|
||
| type PoolManager struct { | ||
| storage PoolStorage | ||
| bfeClusterStorager ibasic.BFEClusterStorager |
Member
There was a problem hiding this comment.
Storager => Storage
所有代码的都替换一下吧。
既然line 27已经是storage,那就统一风格
Author
There was a problem hiding this comment.
本次设计里面没有编写BFEClusterStorager,是以前的代码
|
|
||
| func (m *PoolManager) CreateProductPool(ctx context.Context, product *ibasic.Product, param *PoolParam, pool *InstancePool) (one *Pool, err error) { | ||
| var pN string | ||
| pN, err = poolNameJudger(product.Name, *param.Name) |
Member
There was a problem hiding this comment.
pN => poolName。
pN这样的缩写完全看不懂,是非常差的起名方式。
缩写还是要让人能看懂
mileszhang2016
requested changes
Jun 20, 2022
| var _ icluster_conf.InstancePoolStorage = &RDBInstancePoolStorage{} | ||
|
|
||
| func (rpps *RDBInstancePoolStorage) UpdateInstances(ctx context.Context, pool *icluster_conf.Pool, | ||
| pis *icluster_conf.InstancePool) error { |
| return err | ||
| } | ||
|
|
||
| func (rpps *RDBInstancePoolStorage) BatchFetchInstances(ctx context.Context, |
| } | ||
|
|
||
| func (rpps *RDBPoolStorager) DeletePool(ctx context.Context, pool *icluster_conf.Pool) error { | ||
| func (rpps *RDBPoolStorage) DeletePool(ctx context.Context, pool *icluster_conf.Pool) error { |
| } | ||
|
|
||
| func (rpps *RDBPoolStorager) UpdatePool(ctx context.Context, oldData *icluster_conf.Pool, | ||
| func (rpps *RDBPoolStorage) UpdatePool(ctx context.Context, oldData *icluster_conf.Pool, |
| } | ||
|
|
||
| func (rpps *RDBPoolStorager) CreatePool(ctx context.Context, product *ibasic.Product, | ||
| func (rpps *RDBPoolStorage) CreatePool(ctx context.Context, product *ibasic.Product, |
|
|
||
| rst := map[string]*InstancePool{} | ||
| for type2, pisList := range type2PoolList { | ||
| storager := m.instancePoolStorages[type2] |
| return rst, nil | ||
| } | ||
|
|
||
| func (m *InstancePoolManager) UpdateInstances(ctx context.Context, pool *Pool, pis *InstancePool) error { |
| return | ||
| } | ||
|
|
||
| func (m *PoolManager) FetchBFEPools(ctx context.Context) (list []*Pool, err error) { |
| return | ||
| } | ||
|
|
||
| func poolNameJudger(productName string, poolName string) (realName string, err error) { |
| // CanDelete check whether pool can be deleted, Check Logic: | ||
| // 1. Not BFE Cluster Refer To | ||
| // 2. Not SubCluster Refer To | ||
| func (m *PoolManager) CanDelete(ctx context.Context, pool *Pool) error { |
|
What's the progress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.