-
Notifications
You must be signed in to change notification settings - Fork 536
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
resource/alicloud_pvtz_zone: Support update sync_status without user_info #4372
Conversation
2b9478b
to
93eedd6
Compare
93eedd6
to
8984aa6
Compare
conn, err := client.NewPvtzClient() | ||
if err != nil { | ||
return WrapError(err) | ||
if _, ok := d.GetOk("user_info"); !ok { |
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.
客户提出应该与控制台功能保持一致, 配置同步任务变更, 应该自动更改, 所以需要查询一次
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"user_id": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
}, | ||
"region_ids": { | ||
Type: schema.TypeList, |
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.
客户做plan的时候发现了diff
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.
这个地方要打包测试下,看下List 和Set 是否相互兼容,我印象中是兼容的
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.
兼容的
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"user_id": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
}, | ||
"region_ids": { | ||
Type: schema.TypeList, |
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.
这个地方要打包测试下,看下List 和Set 是否相互兼容,我印象中是兼容的
if IsExpectedErrors(err, []string{"MissingRegion"}) { | ||
log.Printf("[DEBUG] Resource alicloud_private_zone_zone UpdateSyncEcsHostTask Missed Region!!! %s", err) | ||
return 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.
这个报错为啥要直接返回 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.
这块还是因为之前说的,控制台通过status管理同步任务, 但Api里status,user_info这两个字段都应该是必填项, pvtz的做法是前端查出来自己填进去带给后端,这时会有几个情况:
- 用户创建资源未配置同步任务
- 用户创建资源没有配置同步任务, 但status置位了关闭状态(此时会有报错, 是预期中的错误)
No description provided.