Skip to content

Commit

Permalink
resource/alicloud_cs_kubernetes: Fixes GetClusterConfig failed error …
Browse files Browse the repository at this point in the history
…when the cluster state is failed
  • Loading branch information
xiaozhu36 committed Mar 15, 2021
1 parent d845109 commit 2cd9cbf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions alicloud/resource_alicloud_cs_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,10 @@ func resourceAlicloudCSKubernetesRead(d *schema.ResourceData, meta interface{})
}

// get cluster conn certs
// If the cluster is failed, there is no need to get cluster certs
if object.State == "failed" {
return nil
}
var requestInfo *cs.Client
var response interface{}
if err := invoker.Run(func() error {
Expand Down
4 changes: 2 additions & 2 deletions alicloud/resource_alicloud_fc_custom_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ func testSweepFCCustomDomain(region string) error {
if response == nil {
return nil
}
nextToken = *response.NextToken
for _, domain := range response.CustomDomains {
log.Printf("[INFO] Deleting FC custom domain: %s", *domain.DomainName)
_, err := client.WithFcClient(func(fcClient *fc.Client) (interface{}, error) {
Expand All @@ -178,9 +177,10 @@ func testSweepFCCustomDomain(region string) error {
log.Printf("[ERROR] Failed to delete FC custom domains(%s): %s", *domain.DomainName, err)
}
}
if nextToken == "" {
if response.NextToken == nil || *response.NextToken == "" {
break
}
nextToken = *response.NextToken
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions alicloud/resource_alicloud_ros_stack_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func testSweepRosStackGroup(region string) error {

prefixes := []string{
"tf-testAcc",
"tf-testacc",
"tf_testAcc",
}
request := map[string]interface{}{
"PageSize": PageSizeLarge,
Expand Down Expand Up @@ -63,7 +63,7 @@ func testSweepRosStackGroup(region string) error {
item := v.(map[string]interface{})
skip := true
for _, prefix := range prefixes {
if strings.HasPrefix(strings.ToLower(item["StackGroupName"].(string)), strings.ToLower(prefix)) && item["Status"].(string) != "DELETED" {
if strings.HasPrefix(strings.ToLower(item["StackGroupName"].(string)), strings.ToLower(prefix)) {
skip = false
}
}
Expand Down
16 changes: 8 additions & 8 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ jobs:
- <<: *clone-provider
- get: trigger
trigger: true
resource: 08
resource: 08Thu
- aggregate:
- *get-aliyun-cli
- <<: *run
Expand Down Expand Up @@ -1614,13 +1614,13 @@ resources:
# days: [Sunday]
location: {{time_location}}

- name: 08
type: time
source:
start: 08:00 AM
stop: 10:50 PM
# days: [Sunday]
location: {{time_location}}
# - name: 08
# type: time
# source:
# start: 08:00 AM
# stop: 10:50 PM
# # days: [Sunday]
# location: {{time_location}}

# - name: 0830
# type: time
Expand Down
4 changes: 2 additions & 2 deletions ci/tasks/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ if [[ ${SWEEPER} = true ]]; then
echo -e "\n--------------- Running Sweeper Test Cases ---------------"
if [[ ${TEST_SWEEPER_CASE_CODE} == "alicloud_"* ]]; then
echo -e "TF_ACC=1 go test ./alicloud -v -sweep=${ALICLOUD_REGION} -sweep-run=${TEST_SWEEPER_CASE_CODE} -sweep-allow-failures=true"
TF_ACC=1 go test ./alicloud -v -sweep=${ALICLOUD_REGION} -sweep-run=${TEST_SWEEPER_CASE_CODE} -timeout=60m
TF_ACC=1 go test ./alicloud -v -sweep=${ALICLOUD_REGION} -sweep-run=${TEST_SWEEPER_CASE_CODE} -sweep-allow-failures=true -timeout=60m
else
echo -e "TF_ACC=1 go test ./alicloud -v -sweep=${ALICLOUD_REGION} -sweep-allow-failures=true"
TF_ACC=1 go test ./alicloud -v -sweep=${ALICLOUD_REGION} -timeout=60m
TF_ACC=1 go test ./alicloud -v -sweep=${ALICLOUD_REGION} -sweep-allow-failures=true -timeout=60m
fi
echo -e "\n--------------- END ---------------"
exit 0
Expand Down

0 comments on commit 2cd9cbf

Please sign in to comment.