-
Notifications
You must be signed in to change notification settings - Fork 144
fix: [123456789] tencentcloud_teo_origin_group and tencentcloud_teo_l7_acc_setting apply always update #3660
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,56 @@ | ||
| package teo | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "hash/crc32" | ||
| "sort" | ||
| "strings" | ||
| ) | ||
|
|
||
| func teoOriginGroupRecordsHash(v interface{}) int { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this function for using a custom hash to perform resource migration verification? |
||
| m, ok := v.(map[string]interface{}) | ||
| if !ok { | ||
| return 0 | ||
| } | ||
|
|
||
| record := "" | ||
| if rv, ok := m["record"].(string); ok { | ||
| record = rv | ||
| } | ||
|
|
||
| recordType := "" | ||
| if tv, ok := m["type"].(string); ok { | ||
| recordType = tv | ||
| } | ||
|
|
||
| weight := 0 | ||
| if wv, ok := m["weight"].(int); ok { | ||
| weight = wv | ||
| } | ||
|
|
||
| private := false | ||
| if pv, ok := m["private"].(bool); ok { | ||
| private = pv | ||
| } | ||
|
|
||
| privateParamsSig := "" | ||
| if raw, ok := m["private_parameters"]; ok { | ||
| if list, ok := raw.([]interface{}); ok { | ||
| pairs := make([]string, 0, len(list)) | ||
| for _, item := range list { | ||
| pm, ok := item.(map[string]interface{}) | ||
| if !ok { | ||
| continue | ||
| } | ||
| name, _ := pm["name"].(string) | ||
| value, _ := pm["value"].(string) | ||
| pairs = append(pairs, name+"="+value) | ||
| } | ||
| sort.Strings(pairs) | ||
| privateParamsSig = strings.Join(pairs, ",") | ||
| } | ||
| } | ||
|
|
||
| s := fmt.Sprintf("record=%s|type=%s|weight=%d|private=%t|private_parameters=%s", record, recordType, weight, private, privateParamsSig) | ||
| return int(crc32.ChecksumIEEE([]byte(s))) | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
It is not recommended to change this, as it will affect the provider's generated document titles.
https://registry.terraform.io/providers/tencentcloudstack/tencentcloud/latest/docs
example:
