From 4b30e79512d5d804eab492ea0a430f3434a7705b Mon Sep 17 00:00:00 2001 From: yangyshdan Date: Tue, 27 Dec 2022 10:09:45 +0800 Subject: [PATCH] change the test.json to previous version, and adding annotation information. --- sermant-injector/src/test/resources/test.json | 221 +++++------------- 1 file changed, 58 insertions(+), 163 deletions(-) diff --git a/sermant-injector/src/test/resources/test.json b/sermant-injector/src/test/resources/test.json index 1682919751..f274436404 100644 --- a/sermant-injector/src/test/resources/test.json +++ b/sermant-injector/src/test/resources/test.json @@ -2,7 +2,7 @@ "kind": "AdmissionReview", "apiVersion": "admission.k8s.io/v1beta1", "request": { - "uid": "c57327fb-27c5-4d26-bc49-4732569f3c1d", + "uid": "57d4d575-4a5d-444a-8b21-b325d3d11b45", "kind": { "group": "", "version": "v1", @@ -23,26 +23,26 @@ "version": "v1", "resource": "pods" }, - "namespace": "default", + "namespace": "mesh", "operation": "CREATE", "userInfo": { - "username": "system:serviceaccount:kube-system:replicaset-controller", - "uid": "584907d5-656e-4d6f-969c-90569b29b56e", + "username": "foo", + "uid": "f8b49463-63cd-434e-865d-1a2f8679ccec", "groups": [ - "system:serviceaccounts", - "system:serviceaccounts:kube-system", - "system:authenticated" + "system:bar", + "system:foo", + "system:bar" ] }, "object": { "kind": "Pod", "apiVersion": "v1", "metadata": { - "generateName": "testapp-7c8756758c-", + "generateName": "bar-test-f8b49463-", "creationTimestamp": null, "labels": { - "app": "testapp", - "pod-template-hash": "7c8756758c", + "app": "bar-test", + "pod-template-hash": "f8b49463", "sermant-injection": "enabled" }, "annotations": { @@ -54,171 +54,79 @@ { "apiVersion": "apps/v1", "kind": "ReplicaSet", - "name": "testapp-7c8756758c", - "uid": "aa70b547-02ac-4d23-ae49-0305aad0c7a2", + "name": "bar-test-f8b49463", + "uid": "4a28cea0-2a40-4e22-95a5-f61d2a5878bd", "controller": true, "blockOwnerDeletion": true } - ], - "managedFields": [ - { - "manager": "kube-controller-manager", - "operation": "Update", - "apiVersion": "v1", - "time": "2022-12-22T12:28:22Z", - "fieldsType": "FieldsV1", - "fieldsV1": { - "f:metadata": { - "f:generateName": {}, - "f:labels": { - ".": {}, - "f:app": {}, - "f:env.sermant.io/key1": {}, - "f:env.sermant.io/key2": {}, - "f:pod-template-hash": {}, - "f:sermant-injection": {} - }, - "f:ownerReferences": { - ".": {}, - "k:{\"uid\":\"aa70b547-02ac-4d23-ae49-0305aad0c7a2\"}": { - ".": {}, - "f:apiVersion": {}, - "f:blockOwnerDeletion": {}, - "f:controller": {}, - "f:kind": {}, - "f:name": {}, - "f:uid": {} - } - } - }, - "f:spec": { - "f:containers": { - "k:{\"name\":\"testapp\"}": { - ".": {}, - "f:env": { - ".": {}, - "k:{\"name\":\"az\"}": { - ".": {}, - "f:name": {}, - "f:value": {} - }, - "k:{\"name\":\"dubbo.registry.address\"}": { - ".": {}, - "f:name": {}, - "f:value": {} - }, - "k:{\"name\":\"sermant_springboot_registry_lb_registryAddress\"}": { - ".": {}, - "f:name": {}, - "f:value": {} - } - }, - "f:image": {}, - "f:imagePullPolicy": {}, - "f:name": {}, - "f:ports": { - ".": {}, - "k:{\"containerPort\":8104,\"protocol\":\"TCP\"}": { - ".": {}, - "f:containerPort": {}, - "f:protocol": {} - } - }, - "f:resources": {}, - "f:terminationMessagePath": {}, - "f:terminationMessagePolicy": {} - } - }, - "f:dnsPolicy": {}, - "f:enableServiceLinks": {}, - "f:imagePullSecrets": { - ".": {}, - "k:{\"name\":\"foo-secret\"}": { - ".": {}, - "f:name": {} - } - }, - "f:restartPolicy": {}, - "f:schedulerName": {}, - "f:securityContext": {}, - "f:terminationGracePeriodSeconds": {} - } - } - } ] }, "spec": { "volumes": [ { - "name": "kube-api-access-sd2sx", - "projected": { - "sources": [ - { - "serviceAccountToken": { - "expirationSeconds": 3607, - "path": "token" - } - }, - { - "configMap": { - "name": "kube-root-ca.crt", - "items": [ - { - "key": "ca.crt", - "path": "ca.crt" - } - ] - } - }, - { - "downwardAPI": { - "items": [ - { - "path": "namespace", - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - ] - } - } - ] + "name": "foo", + "secret": { + "secretName": "bar" } } ], "containers": [ { - "name": "testapp", - "image": "swr.cn-north-5.myhuaweicloud.com/pengyuyi/testapp:3.10.0", + "name": "foo-test", + "image": "bar-test:1.0.1", "ports": [ { - "containerPort": 8104, + "containerPort": 100, + "protocol": "TCP" + }, + { + "containerPort": 101, + "protocol": "TCP" + }, + { + "containerPort": 102, "protocol": "TCP" } ], "env": [ { - "name": "dubbo.registry.address", - "value": "zookeeper://192.168.1.1:1111" + "name": "SERVICECOMB.SERVICE.ENABLEDUBBOREGISTER", + "value": "true" + }, + { + "name": "SERVICECOMB.SERVICE.ENABLESPRINGREGISTER", + "value": "false" + }, + { + "name": "SERVICECOMB.SERVICE.SSLENABLED", + "value": "false" }, { - "name": "az", - "value": "sz" + "name": "SERVICECOMB.SERVICE.OPENMIGRATION", + "value": "false" }, { - "name": "sermant_springboot_registry_lb_registryAddress", - "value": "192.168.1.1:1111" + "name": "DYNAMIC.CONFIG.PLUGIN.ENABLEDYNAMICCONFIG", + "value": "false" } ], "resources": {}, "volumeMounts": [ { - "name": "kube-api-access-sd2sx", + "name": "bar", "readOnly": true, - "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount" + "mountPath": "foo" } ], + "lifecycle": { + "preStop": { + "exec": { + "command": [ + "echo \"1111111111111111111111111111\"" + ] + } + } + }, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File", "imagePullPolicy": "IfNotPresent" @@ -227,44 +135,31 @@ "restartPolicy": "Always", "terminationGracePeriodSeconds": 30, "dnsPolicy": "ClusterFirst", - "serviceAccountName": "default", - "serviceAccount": "default", + "serviceAccountName": "foo", + "serviceAccount": "bar", "securityContext": {}, "imagePullSecrets": [ { - "name": "foo-secret" + "name": "foo" } ], - "schedulerName": "default-scheduler", + "schedulerName": "bar", "tolerations": [ { - "key": "node.kubernetes.io/not-ready", + "key": "bar", "operator": "Exists", "effect": "NoExecute", "tolerationSeconds": 300 }, { - "key": "node.kubernetes.io/unreachable", + "key": "foo", "operator": "Exists", "effect": "NoExecute", "tolerationSeconds": 300 } ], "priority": 0, - "dnsConfig": { - "options": [ - { - "name": "single-request-reopen", - "value": "" - }, - { - "name": "timeout", - "value": "2" - } - ] - }, - "enableServiceLinks": true, - "preemptionPolicy": "PreemptLowerPriority" + "enableServiceLinks": true }, "status": {} },