Skip to content

Commit 68522c0

Browse files
authored
Merge pull request #562 from oliverpei/master
fix cos bucket name validator
2 parents 602b127 + 92d67fd commit 68522c0

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ ENHANCEMENTS:
1515

1616
* Resource `tencentcloud_sercurity_group_rule` add `address_template` and `protocol_template` to support building new security group rule with resource `tencentcloud_address_template` and `tencentcloud_protocol_template`.
1717

18+
BUG FIXES:
19+
20+
* Resource: `tencentcloud_cos_bucket` fix bucket name validator.
21+
1822
## 1.49.1 (December 01, 2020)
1923

2024
ENHANCEMENTS:

tencentcloud/resource_tc_instance.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,8 @@ func resourceTencentCloudInstanceCreate(d *schema.ResourceData, meta interface{}
614614
if errRet != nil {
615615
return retryError(errRet, InternalError)
616616
}
617-
if instance != nil && *instance.InstanceState == CVM_STATUS_RUNNING {
617+
if instance != nil && (*instance.InstanceState == CVM_STATUS_RUNNING ||
618+
*instance.InstanceState == CVM_STATUS_LAUNCH_FAILED) {
618619
return nil
619620
}
620621
return resource.RetryableError(fmt.Errorf("cvm instance status is %s, retry...", *instance.InstanceState))

tencentcloud/validators.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ func validateAllowedIntValue(ints []int) schema.SchemaValidateFunc {
226226
}
227227
}
228228

229-
// Only support lowercase letters, numbers and "-". It cannot be longer than 40 characters.
229+
// Only support lowercase letters, numbers and "-". It cannot be longer than 60 characters.
230230
func validateCosBucketName(v interface{}, k string) (ws []string, errors []error) {
231231
value := v.(string)
232-
if len(value) > 40 || len(value) < 0 {
233-
errors = append(errors, fmt.Errorf("the length of %s must be 1-40: %s", k, value))
232+
if len(value) > 60 || len(value) < 0 {
233+
errors = append(errors, fmt.Errorf("the length of %s must be 1-60: %s", k, value))
234234
}
235235

236236
pattern := `^[a-z0-9-]+$`

0 commit comments

Comments
 (0)