Skip to content

Commit 7793dca

Browse files
authored
Fix/cluster agent status handle (#1261)
* fix: update retry time * fix: fix automated tests Co-authored-by: arunma <arunma@tencent.com>
1 parent 583f3c2 commit 7793dca

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

tencentcloud/basic_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ const (
183183
defaultTkeClusterType = "tke"
184184
defaultPrometheusId = "prom-1lspn8sw"
185185
defaultTemplateId = "temp-gqunlvo1"
186-
tkeClusterIdAgent = "cls-87o4klby"
186+
clusterPrometheusId = "prom-g261hacc"
187+
tkeClusterIdAgent = "cls-9ae9qo9k"
187188
tkeClusterTypeAgent = "eks"
188189
defaultAgentId = "agent-q3zy8gt8"
189190
)

tencentcloud/resource_tc_monitor_tmp_exporter_integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestAccTencentCloudMonitorExporterIntegration_basic(t *testing.T) {
6464
testAccCheckExporterIntegrationExists("tencentcloud_monitor_tmp_exporter_integration.basic"),
6565
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "kind", "cvm-http-sd-exporter"),
6666
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "kube_type", "1"),
67-
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "cluster_id", "cls-87o4klby"),
67+
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "cluster_id", "cls-9ae9qo9k"),
6868
),
6969
},
7070
{
@@ -73,7 +73,7 @@ func TestAccTencentCloudMonitorExporterIntegration_basic(t *testing.T) {
7373
testAccCheckExporterIntegrationExists("tencentcloud_monitor_tmp_exporter_integration.basic"),
7474
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "kind", "cvm-http-sd-exporter"),
7575
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "kube_type", "1"),
76-
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "cluster_id", "cls-87o4klby"),
76+
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_exporter_integration.basic", "cluster_id", "cls-9ae9qo9k"),
7777
),
7878
},
7979
},
@@ -134,7 +134,7 @@ func testAccCheckExporterIntegrationExists(r string) resource.TestCheckFunc {
134134

135135
const testExporterIntegrationVar = `
136136
variable "prometheus_id" {
137-
default = "` + defaultPrometheusId + `"
137+
default = "` + clusterPrometheusId + `"
138138
}
139139
variable "cluster_id" {
140140
default = "` + tkeClusterIdAgent + `"

tencentcloud/resource_tc_monitor_tmp_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func resourceTencentCloudMonitorTmpInstanceCreate(d *schema.ResourceData, meta i
138138
service := MonitorService{client: meta.(*TencentCloudClient).apiV3Conn}
139139
ctx := context.WithValue(context.TODO(), logIdKey, logId)
140140

141-
err = resource.Retry(1*readRetryTimeout, func() *resource.RetryError {
141+
err = resource.Retry(3*readRetryTimeout, func() *resource.RetryError {
142142
instance, errRet := service.DescribeMonitorTmpInstance(ctx, tmpInstanceId)
143143
if errRet != nil {
144144
return retryError(errRet, InternalError)

tencentcloud/resource_tc_monitor_tmp_tke_cluster_agent_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func testSweepClusterAgent(region string) error {
2424
client := cli.(*TencentCloudClient).apiV3Conn
2525
service := TkeService{client}
2626

27-
instanceId := defaultPrometheusId
28-
clusterId := ""
29-
clusterType := ""
27+
instanceId := clusterPrometheusId
28+
clusterId := tkeClusterIdAgent
29+
clusterType := tkeClusterTypeAgent
3030

3131
agents, err := service.DescribeTmpTkeClusterAgentsById(ctx, instanceId, clusterId, clusterType)
3232
if err != nil {
@@ -57,7 +57,7 @@ func TestAccTencentCloudMonitorClusterAgent_basic(t *testing.T) {
5757
Config: testClusterAgentYaml_basic,
5858
Check: resource.ComposeTestCheckFunc(
5959
testAccCheckClusterAgentExists("tencentcloud_monitor_tmp_tke_cluster_agent.basic"),
60-
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_tke_cluster_agent.basic", "agents.0.cluster_id", "cls-87o4klby"),
60+
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_tke_cluster_agent.basic", "agents.0.cluster_id", "cls-9ae9qo9k"),
6161
resource.TestCheckResourceAttr("tencentcloud_monitor_tmp_tke_cluster_agent.basic", "agents.0.cluster_type", "eks"),
6262
),
6363
},
@@ -127,7 +127,7 @@ func testAccCheckClusterAgentExists(r string) resource.TestCheckFunc {
127127

128128
const testClusterAgentYamlVar = `
129129
variable "prometheus_id" {
130-
default = "` + defaultPrometheusId + `"
130+
default = "` + clusterPrometheusId + `"
131131
}
132132
variable "default_region" {
133133
default = "` + defaultRegion + `"

0 commit comments

Comments
 (0)