@@ -70,13 +70,13 @@ func TestAccTencentCloudMonitorTmpTkeConfig_basic(t *testing.T) {
7070 {
7171 Config : testAccTmpTkeConfig_update ,
7272 Check : resource .ComposeTestCheckFunc (
73- testAccCheckTmpTkeConfigExists ("tencentcloud_monitor_tmp_tke_config.update " ),
74- resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.update " , "instance_id" , defaultPrometheusId ),
75- resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.update " , "cluster_type" , defaultTkeClusterType ),
76- resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.update " , "cluster_id" , defaultTkeClusterId ),
77- resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.update " , "raw_jobs.0.config" , "scrape_configs:\n - job_name: " + raw_job_name + "\n scrape_interval: 20s\n honor_labels: true\n " ),
78- resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.update " , "service_monitors.0.config" , "apiVersion: monitoring.coreos.com/v1\n kind: ServiceMonitor\n metadata:\n name: " + service_monitors_name + "\n namespace: kube-system\n spec:\n endpoints:\n - interval: 20s\n port: 8080-8080-tcp\n path: /metrics\n relabelings:\n - action: replace\n sourceLabels:\n - __meta_kubernetes_pod_label_app\n targetLabel: application\n namespaceSelector:\n matchNames:\n - test\n selector:\n matchLabels:\n app: test" ),
79- resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.update " , "pod_monitors.0.config" , "apiVersion: monitoring.coreos.com/v1\n kind: PodMonitor\n metadata:\n name: " + pod_monitors_name + "\n namespace: kube-system\n spec:\n podMetricsEndpoints:\n - interval: 20s\n port: metric-port\n path: /metrics\n relabelings:\n - action: replace\n sourceLabels:\n - instance\n regex: (.*)\n targetLabel: instance\n replacement: xxxxxx\n namespaceSelector:\n matchNames:\n - test\n selector:\n matchLabels:\n k8s-app: test" ),
73+ testAccCheckTmpTkeConfigExists ("tencentcloud_monitor_tmp_tke_config.basic " ),
74+ resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.basic " , "instance_id" , defaultPrometheusId ),
75+ resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.basic " , "cluster_type" , defaultTkeClusterType ),
76+ resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.basic " , "cluster_id" , defaultTkeClusterId ),
77+ resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.basic " , "raw_jobs.0.config" , "scrape_configs:\n - job_name: " + raw_job_name + "\n scrape_interval: 20s\n honor_labels: true\n " ),
78+ resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.basic " , "service_monitors.0.config" , "apiVersion: monitoring.coreos.com/v1\n kind: ServiceMonitor\n metadata:\n name: " + service_monitors_name + "\n namespace: kube-system\n spec:\n endpoints:\n - interval: 20s\n port: 8080-8080-tcp\n path: /metrics\n relabelings:\n - action: replace\n sourceLabels:\n - __meta_kubernetes_pod_label_app\n targetLabel: application\n namespaceSelector:\n matchNames:\n - test\n selector:\n matchLabels:\n app: test" ),
79+ resource .TestCheckResourceAttr ("tencentcloud_monitor_tmp_tke_config.basic " , "pod_monitors.0.config" , "apiVersion: monitoring.coreos.com/v1\n kind: PodMonitor\n metadata:\n name: " + pod_monitors_name + "\n namespace: kube-system\n spec:\n podMetricsEndpoints:\n - interval: 20s\n port: metric-port\n path: /metrics\n relabelings:\n - action: replace\n sourceLabels:\n - instance\n regex: (.*)\n targetLabel: instance\n replacement: xxxxxx\n namespaceSelector:\n matchNames:\n - test\n selector:\n matchLabels:\n k8s-app: test" ),
8080 ),
8181 },
8282 },
@@ -228,7 +228,7 @@ resource "tencentcloud_monitor_tmp_tke_config" "basic" {
228228}`
229229
230230const testAccTmpTkeConfig_update = testAccTmpTkeConfigVar + `
231- resource "tencentcloud_monitor_tmp_tke_config" "update " {
231+ resource "tencentcloud_monitor_tmp_tke_config" "basic " {
232232 instance_id = var.prometheus_id
233233 cluster_type = var.tke_cluster_type
234234 cluster_id = var.tke_cluster_id
0 commit comments