Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
NameHaibinZhang committed Nov 14, 2024
1 parent 44e1a47 commit 1c84642
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/unittest/metadata/K8sMetadataUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class k8sMetadataUnittest : public ::testing::Test {
public:
void TestGetByContainerIds() {
LOG_INFO(sLogger, ("TestGetByContainerIds() begin", time(NULL)));
const std::string jsonData = R"({"containerd://286effd2650c0689b779018e42e9ec7aa3d2cb843005e038204e85fc3d4f9144":{"k8s.namespace.name":"default","workload.name":"oneagent-demo-658648895b","workload.kind":"replicaset","service.name":"","pod.labels":{"app":"oneagent-demo","pod-template-hash":"658648895b"},"envs":{},"container.image.name":{"oneagent-demo":"sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/centos7-cve-fix:1.0.0"}}})";
const std::string jsonData = R"({"containerd://286effd2650c0689b779018e42e9ec7aa3d2cb843005e038204e85fc3d4f9144":{"k8s.namespace.name":"default","workload.name":"oneagent-demo-658648895b","workload.kind":"replicaset","service.name":"","k8s.pod.label":{"app":"oneagent-demo","pod-template-hash":"658648895b"},"envs":{},"container.image.name":{"oneagent-demo":"sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/centos7-cve-fix:1.0.0"}}})";

Json::Value root;
Json::CharReaderBuilder readerBuilder;
Expand Down Expand Up @@ -67,7 +67,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workload.name": "coredns-7b669cbb96",
"workload.kind": "replicaset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"k8s-app": "kube-dns",
"pod-template-hash": "7b669cbb96"
},
Expand All @@ -84,7 +84,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workload.name": "csi-provisioner-8bd988c55",
"workload.kind": "replicaset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"app": "csi-provisioner",
"pod-template-hash": "8bd988c55"
},
Expand All @@ -111,7 +111,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workload.name": "kube-proxy-worker",
"workload.kind": "daemonset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"controller-revision-hash": "756748b889",
"k8s-app": "kube-proxy-worker",
"pod-template-generation": "1"
Expand Down Expand Up @@ -187,7 +187,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workload.name": "coredns-7b669cbb96",
"workload.kind": "replicaset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"k8s-app": "kube-dns",
"pod-template-hash": "7b669cbb96"
},
Expand All @@ -204,7 +204,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workload.name": "csi-provisioner-8bd988c55",
"workload.kind": "replicaset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"app": "csi-provisioner",
"pod-template-hash": "8bd988c55"
},
Expand All @@ -231,7 +231,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workload.name": "kube-proxy-worker",
"workload.kind": "daemonset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"controller-revision-hash": "756748b889",
"k8s-app": "kube-proxy-worker",
"pod-template-generation": "1"
Expand Down Expand Up @@ -301,7 +301,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workloadName": "coredns-7b669cbb96",
"workloadKind": "replicaset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"k8s-app": "kube-dns",
"pod-template-hash": "7b669cbb96"
},
Expand All @@ -318,7 +318,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workloadName": "csi-provisioner-8bd988c55",
"workloadKind": "replicaset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"app": "csi-provisioner",
"pod-template-hash": "8bd988c55"
},
Expand All @@ -345,7 +345,7 @@ class k8sMetadataUnittest : public ::testing::Test {
"workloadName": "kube-proxy-worker",
"workloadKind": "daemonset",
"service.name": "",
"pod.labels": {
"k8s.pod.label": {
"controller-revision-hash": "756748b889",
"k8s-app": "kube-proxy-worker",
"pod-template-generation": "1"
Expand Down

0 comments on commit 1c84642

Please sign in to comment.