diff --git a/mockkubeapiserver/tests/kubeapiserver_test.go b/mockkubeapiserver/tests/kubeapiserver_test.go index 0d2663c6..f6cb855c 100644 --- a/mockkubeapiserver/tests/kubeapiserver_test.go +++ b/mockkubeapiserver/tests/kubeapiserver_test.go @@ -88,7 +88,7 @@ func TestGoldenTests(t *testing.T) { requestLog.RemoveUserAgent() requestLog.SortGETs() - requests := requestLog.FormatHTTP() + requests := requestLog.FormatHTTP(true) h.CompareGoldenFile(filepath.Join(testdir, "expected.yaml"), requests) }) } diff --git a/mockkubeapiserver/tests/testdata/configmap/expected.yaml b/mockkubeapiserver/tests/testdata/configmap/expected.yaml index a5f0aa39..044a215a 100644 --- a/mockkubeapiserver/tests/testdata/configmap/expected.yaml +++ b/mockkubeapiserver/tests/testdata/configmap/expected.yaml @@ -1,13 +1,148 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1820 Content-Type: application/json Date: (removed) -{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"v1","resources":[{"name":"componentstatuses","singularName":"","namespaced":false,"version":"v1","kind":"ComponentStatus","verbs":null},{"name":"configmaps","singularName":"","namespaced":true,"version":"v1","kind":"ConfigMap","verbs":null},{"name":"endpoints","singularName":"","namespaced":true,"version":"v1","kind":"Endpoints","verbs":null},{"name":"events","singularName":"","namespaced":true,"version":"v1","kind":"Event","verbs":null},{"name":"limitranges","singularName":"","namespaced":true,"version":"v1","kind":"LimitRange","verbs":null},{"name":"namespaces","singularName":"","namespaced":false,"version":"v1","kind":"Namespace","verbs":null},{"name":"nodes","singularName":"","namespaced":false,"version":"v1","kind":"Node","verbs":null},{"name":"persistentvolumes","singularName":"","namespaced":false,"version":"v1","kind":"PersistentVolume","verbs":null},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"version":"v1","kind":"PersistentVolumeClaim","verbs":null},{"name":"pods","singularName":"","namespaced":true,"version":"v1","kind":"Pod","verbs":null},{"name":"podtemplates","singularName":"","namespaced":true,"version":"v1","kind":"PodTemplate","verbs":null},{"name":"replicationcontrollers","singularName":"","namespaced":true,"version":"v1","kind":"ReplicationController","verbs":null},{"name":"resourcequotas","singularName":"","namespaced":true,"version":"v1","kind":"ResourceQuota","verbs":null},{"name":"secrets","singularName":"","namespaced":true,"version":"v1","kind":"Secret","verbs":null},{"name":"services","singularName":"","namespaced":true,"version":"v1","kind":"Service","verbs":null},{"name":"serviceaccounts","singularName":"","namespaced":true,"version":"v1","kind":"ServiceAccount","verbs":null}]} +{ + "apiVersion": "v1", + "groupVersion": "v1", + "kind": "APIResourceList", + "resources": [ + { + "kind": "ComponentStatus", + "name": "componentstatuses", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ConfigMap", + "name": "configmaps", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Endpoints", + "name": "endpoints", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Event", + "name": "events", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "LimitRange", + "name": "limitranges", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Namespace", + "name": "namespaces", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Node", + "name": "nodes", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "PersistentVolume", + "name": "persistentvolumes", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "PersistentVolumeClaim", + "name": "persistentvolumeclaims", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Pod", + "name": "pods", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "PodTemplate", + "name": "podtemplates", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ReplicationController", + "name": "replicationcontrollers", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ResourceQuota", + "name": "resourcequotas", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Secret", + "name": "secrets", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Service", + "name": "services", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ServiceAccount", + "name": "serviceaccounts", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + } + ] +} --- @@ -15,8 +150,13 @@ PATCH http://kube-apiserver/api/v1/namespaces/default?fieldManager=test&force=fa Accept: application/json Content-Type: application/apply-patch+yaml -{"apiVersion":"v1","kind":"Namespace","metadata":{"name":"default"}} - +{ + "apiVersion": "v1", + "kind": "Namespace", + "metadata": { + "name": "default" + } +} 200 OK Cache-Control: no-cache, private @@ -24,7 +164,27 @@ Content-Length: 294 Content-Type: application/json Date: (removed) -{"apiVersion":"v1","kind":"Namespace","metadata":{"creationTimestamp":"2022-01-01T00:00:00Z","labels":{"kubernetes.io/metadata.name":"default"},"name":"default","resourceVersion":"1","uid":"00000000-0000-0000-0000-000000000001"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} +{ + "apiVersion": "v1", + "kind": "Namespace", + "metadata": { + "creationTimestamp": "2022-01-01T00:00:00Z", + "labels": { + "kubernetes.io/metadata.name": "default" + }, + "name": "default", + "resourceVersion": "1", + "uid": "00000000-0000-0000-0000-000000000001" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Active" + } +} --- @@ -32,8 +192,17 @@ PATCH http://kube-apiserver/api/v1/namespaces/default/configmaps/config?fieldMan Accept: application/json Content-Type: application/apply-patch+yaml -{"apiVersion":"v1","data":{"foo":"bar"},"kind":"ConfigMap","metadata":{"name":"config","namespace":"default"}} - +{ + "apiVersion": "v1", + "data": { + "foo": "bar" + }, + "kind": "ConfigMap", + "metadata": { + "name": "config", + "namespace": "default" + } +} 200 OK Cache-Control: no-cache, private @@ -41,4 +210,17 @@ Content-Length: 220 Content-Type: application/json Date: (removed) -{"apiVersion":"v1","data":{"foo":"bar"},"kind":"ConfigMap","metadata":{"creationTimestamp":"2022-01-01T00:00:01Z","name":"config","namespace":"default","resourceVersion":"2","uid":"00000000-0000-0000-0000-000000000002"}} +{ + "apiVersion": "v1", + "data": { + "foo": "bar" + }, + "kind": "ConfigMap", + "metadata": { + "creationTimestamp": "2022-01-01T00:00:01Z", + "name": "config", + "namespace": "default", + "resourceVersion": "2", + "uid": "00000000-0000-0000-0000-000000000002" + } +} diff --git a/mockkubeapiserver/tests/testdata/secrets_stringdata/expected.yaml b/mockkubeapiserver/tests/testdata/secrets_stringdata/expected.yaml index 07f22742..27b3d5c1 100644 --- a/mockkubeapiserver/tests/testdata/secrets_stringdata/expected.yaml +++ b/mockkubeapiserver/tests/testdata/secrets_stringdata/expected.yaml @@ -1,13 +1,148 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1820 Content-Type: application/json Date: (removed) -{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"v1","resources":[{"name":"componentstatuses","singularName":"","namespaced":false,"version":"v1","kind":"ComponentStatus","verbs":null},{"name":"configmaps","singularName":"","namespaced":true,"version":"v1","kind":"ConfigMap","verbs":null},{"name":"endpoints","singularName":"","namespaced":true,"version":"v1","kind":"Endpoints","verbs":null},{"name":"events","singularName":"","namespaced":true,"version":"v1","kind":"Event","verbs":null},{"name":"limitranges","singularName":"","namespaced":true,"version":"v1","kind":"LimitRange","verbs":null},{"name":"namespaces","singularName":"","namespaced":false,"version":"v1","kind":"Namespace","verbs":null},{"name":"nodes","singularName":"","namespaced":false,"version":"v1","kind":"Node","verbs":null},{"name":"persistentvolumes","singularName":"","namespaced":false,"version":"v1","kind":"PersistentVolume","verbs":null},{"name":"persistentvolumeclaims","singularName":"","namespaced":true,"version":"v1","kind":"PersistentVolumeClaim","verbs":null},{"name":"pods","singularName":"","namespaced":true,"version":"v1","kind":"Pod","verbs":null},{"name":"podtemplates","singularName":"","namespaced":true,"version":"v1","kind":"PodTemplate","verbs":null},{"name":"replicationcontrollers","singularName":"","namespaced":true,"version":"v1","kind":"ReplicationController","verbs":null},{"name":"resourcequotas","singularName":"","namespaced":true,"version":"v1","kind":"ResourceQuota","verbs":null},{"name":"secrets","singularName":"","namespaced":true,"version":"v1","kind":"Secret","verbs":null},{"name":"services","singularName":"","namespaced":true,"version":"v1","kind":"Service","verbs":null},{"name":"serviceaccounts","singularName":"","namespaced":true,"version":"v1","kind":"ServiceAccount","verbs":null}]} +{ + "apiVersion": "v1", + "groupVersion": "v1", + "kind": "APIResourceList", + "resources": [ + { + "kind": "ComponentStatus", + "name": "componentstatuses", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ConfigMap", + "name": "configmaps", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Endpoints", + "name": "endpoints", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Event", + "name": "events", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "LimitRange", + "name": "limitranges", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Namespace", + "name": "namespaces", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Node", + "name": "nodes", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "PersistentVolume", + "name": "persistentvolumes", + "namespaced": false, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "PersistentVolumeClaim", + "name": "persistentvolumeclaims", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Pod", + "name": "pods", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "PodTemplate", + "name": "podtemplates", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ReplicationController", + "name": "replicationcontrollers", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ResourceQuota", + "name": "resourcequotas", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Secret", + "name": "secrets", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "Service", + "name": "services", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + }, + { + "kind": "ServiceAccount", + "name": "serviceaccounts", + "namespaced": true, + "singularName": "", + "verbs": null, + "version": "v1" + } + ] +} --- @@ -15,8 +150,13 @@ PATCH http://kube-apiserver/api/v1/namespaces/default?fieldManager=test&force=fa Accept: application/json Content-Type: application/apply-patch+yaml -{"apiVersion":"v1","kind":"Namespace","metadata":{"name":"default"}} - +{ + "apiVersion": "v1", + "kind": "Namespace", + "metadata": { + "name": "default" + } +} 200 OK Cache-Control: no-cache, private @@ -24,7 +164,27 @@ Content-Length: 294 Content-Type: application/json Date: (removed) -{"apiVersion":"v1","kind":"Namespace","metadata":{"creationTimestamp":"2022-01-01T00:00:00Z","labels":{"kubernetes.io/metadata.name":"default"},"name":"default","resourceVersion":"1","uid":"00000000-0000-0000-0000-000000000001"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} +{ + "apiVersion": "v1", + "kind": "Namespace", + "metadata": { + "creationTimestamp": "2022-01-01T00:00:00Z", + "labels": { + "kubernetes.io/metadata.name": "default" + }, + "name": "default", + "resourceVersion": "1", + "uid": "00000000-0000-0000-0000-000000000001" + }, + "spec": { + "finalizers": [ + "kubernetes" + ] + }, + "status": { + "phase": "Active" + } +} --- @@ -32,8 +192,19 @@ PATCH http://kube-apiserver/api/v1/namespaces/default/secrets/secret?fieldManage Accept: application/json Content-Type: application/apply-patch+yaml -{"apiVersion":"v1","kind":"Secret","metadata":{"name":"secret","namespace":"default"},"stringData":{"foo":"bar","foo2":"bar2"},"type":"Opaque"} - +{ + "apiVersion": "v1", + "kind": "Secret", + "metadata": { + "name": "secret", + "namespace": "default" + }, + "stringData": { + "foo": "bar", + "foo2": "bar2" + }, + "type": "Opaque" +} 200 OK Cache-Control: no-cache, private @@ -41,4 +212,19 @@ Content-Length: 252 Content-Type: application/json Date: (removed) -{"apiVersion":"v1","data":{"foo":"YmFy","foo2":"YmFyMg=="},"kind":"Secret","metadata":{"creationTimestamp":"2022-01-01T00:00:01Z","name":"secret","namespace":"default","resourceVersion":"2","uid":"00000000-0000-0000-0000-000000000002"},"type":"Opaque"} +{ + "apiVersion": "v1", + "data": { + "foo": "YmFy", + "foo2": "YmFyMg==" + }, + "kind": "Secret", + "metadata": { + "creationTimestamp": "2022-01-01T00:00:01Z", + "name": "secret", + "namespace": "default", + "resourceVersion": "2", + "uid": "00000000-0000-0000-0000-000000000002" + }, + "type": "Opaque" +} diff --git a/pkg/patterns/declarative/pkg/applier/applylib_test.go b/pkg/patterns/declarative/pkg/applier/applylib_test.go index 8767ee4f..838afa15 100644 --- a/pkg/patterns/declarative/pkg/applier/applylib_test.go +++ b/pkg/patterns/declarative/pkg/applier/applylib_test.go @@ -119,7 +119,7 @@ func runApplierGoldenTests(t *testing.T, testDir string, interceptHTTPServer boo requestLog.RemoveUserAgent() requestLog.SortGETs() - requests := requestLog.FormatHTTP() + requests := requestLog.FormatHTTP(false) h.CompareGoldenFile(filepath.Join(testdir, "expected.yaml"), requests) if interceptHTTPServer { @@ -128,7 +128,7 @@ func runApplierGoldenTests(t *testing.T, testDir string, interceptHTTPServer boo apiserverRequestLog.RemoveUserAgent() apiserverRequestLog.SortGETs() apiserverRequestLog.RemoveHeader("Kubectl-Session") - apiserverRequests := apiserverRequestLog.FormatHTTP() + apiserverRequests := apiserverRequestLog.FormatHTTP(false) h.CompareGoldenFile(filepath.Join(testdir, "expected-apiserver.yaml"), apiserverRequests) } }) diff --git a/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple1/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple1/expected.yaml index 4c9d92d5..dd23dca0 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple1/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple1/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple2/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple2/expected.yaml index 26343090..ad4fe601 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple2/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple2/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple3/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple3/expected.yaml index 56c77edc..f6710898 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple3/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/applylib/simple3/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/direct/simple1/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/direct/simple1/expected.yaml index 27f374c0..b644ff4c 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/direct/simple1/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/direct/simple1/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 @@ -14,6 +15,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1 Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -45,6 +47,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns2 Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/direct/simple2/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/direct/simple2/expected.yaml index 0168b769..df8c9ea3 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/direct/simple2/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/direct/simple2/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 @@ -14,6 +15,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1 Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 286 @@ -43,6 +45,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns2 Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 286 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/direct/simple3/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/direct/simple3/expected.yaml index f7b9a37a..cf04ac6c 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/direct/simple3/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/direct/simple3/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 @@ -14,6 +15,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1 Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 455 @@ -27,6 +29,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns2 Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 455 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected-apiserver.yaml b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected-apiserver.yaml index 70f1a64b..e6b90cfe 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected-apiserver.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected-apiserver.yaml @@ -4,7 +4,6 @@ Accept-Encoding: gzip - --- GET /openapi/v2?timeout=32s @@ -14,7 +13,6 @@ Kubectl-Command: kubectl apply - --- GET /api?timeout=32s @@ -24,7 +22,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1?timeout=32s @@ -34,7 +31,6 @@ Kubectl-Command: kubectl apply - --- GET /apis?timeout=32s @@ -44,7 +40,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/admissionregistration.k8s.io/v1?timeout=32s @@ -54,7 +49,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apiextensions.k8s.io/v1?timeout=32s @@ -64,7 +58,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apiregistration.k8s.io/v1?timeout=32s @@ -74,7 +67,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apps/v1?timeout=32s @@ -84,7 +76,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v1?timeout=32s @@ -94,7 +85,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v2?timeout=32s @@ -104,7 +94,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v2beta2?timeout=32s @@ -114,7 +103,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/batch/v1?timeout=32s @@ -124,7 +112,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/certificates.k8s.io/v1?timeout=32s @@ -134,7 +121,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/coordination.k8s.io/v1?timeout=32s @@ -144,7 +130,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/discovery.k8s.io/v1?timeout=32s @@ -154,7 +139,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/events.k8s.io/v1?timeout=32s @@ -164,7 +148,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/flowcontrol.apiserver.k8s.io/v1beta1?timeout=32s @@ -174,7 +157,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/flowcontrol.apiserver.k8s.io/v1beta2?timeout=32s @@ -184,7 +166,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/networking.k8s.io/v1?timeout=32s @@ -194,7 +175,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/node.k8s.io/v1?timeout=32s @@ -204,7 +184,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/policy/v1?timeout=32s @@ -214,7 +193,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/rbac.authorization.k8s.io/v1?timeout=32s @@ -224,7 +202,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/scheduling.k8s.io/v1?timeout=32s @@ -234,7 +211,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/storage.k8s.io/v1?timeout=32s @@ -244,7 +220,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/storage.k8s.io/v1beta1?timeout=32s @@ -254,7 +229,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1/namespaces/ns1 @@ -264,7 +238,6 @@ Kubectl-Command: kubectl apply - --- POST /api/v1/namespaces?fieldManager=kubectl-client-side-apply&fieldValidation=Ignore @@ -278,8 +251,6 @@ Kubectl-Command: kubectl apply - - --- GET /api/v1/namespaces/ns2 @@ -289,7 +260,6 @@ Kubectl-Command: kubectl apply - --- POST /api/v1/namespaces?fieldManager=kubectl-client-side-apply&fieldValidation=Ignore @@ -302,5 +272,3 @@ Kubectl-Command: kubectl apply {"apiVersion":"v1","kind":"Namespace","metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"ns2\"}}\n"},"name":"ns2"}} - - diff --git a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected.yaml index 95bf8150..a3a008f5 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple1/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected-apiserver.yaml b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected-apiserver.yaml index 8f4ce0ca..a610433c 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected-apiserver.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected-apiserver.yaml @@ -4,7 +4,6 @@ Accept-Encoding: gzip - --- GET /openapi/v2?timeout=32s @@ -14,7 +13,6 @@ Kubectl-Command: kubectl apply - --- GET /api?timeout=32s @@ -24,7 +22,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1?timeout=32s @@ -34,7 +31,6 @@ Kubectl-Command: kubectl apply - --- GET /apis?timeout=32s @@ -44,7 +40,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/admissionregistration.k8s.io/v1?timeout=32s @@ -54,7 +49,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apiextensions.k8s.io/v1?timeout=32s @@ -64,7 +58,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apiregistration.k8s.io/v1?timeout=32s @@ -74,7 +67,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apps/v1?timeout=32s @@ -84,7 +76,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v1?timeout=32s @@ -94,7 +85,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v2?timeout=32s @@ -104,7 +94,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v2beta2?timeout=32s @@ -114,7 +103,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/batch/v1?timeout=32s @@ -124,7 +112,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/certificates.k8s.io/v1?timeout=32s @@ -134,7 +121,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/coordination.k8s.io/v1?timeout=32s @@ -144,7 +130,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/discovery.k8s.io/v1?timeout=32s @@ -154,7 +139,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/events.k8s.io/v1?timeout=32s @@ -164,7 +148,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/flowcontrol.apiserver.k8s.io/v1beta1?timeout=32s @@ -174,7 +157,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/flowcontrol.apiserver.k8s.io/v1beta2?timeout=32s @@ -184,7 +166,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/networking.k8s.io/v1?timeout=32s @@ -194,7 +175,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/node.k8s.io/v1?timeout=32s @@ -204,7 +184,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/policy/v1?timeout=32s @@ -214,7 +193,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/rbac.authorization.k8s.io/v1?timeout=32s @@ -224,7 +202,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/scheduling.k8s.io/v1?timeout=32s @@ -234,7 +211,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/storage.k8s.io/v1?timeout=32s @@ -244,7 +220,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/storage.k8s.io/v1beta1?timeout=32s @@ -254,7 +229,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1/namespaces/ns1 @@ -264,7 +238,6 @@ Kubectl-Command: kubectl apply - --- PATCH /api/v1/namespaces/ns1?fieldManager=kubectl-client-side-apply&fieldValidation=Ignore @@ -277,8 +250,6 @@ Kubectl-Command: kubectl apply {"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"ns1\"}}\n"}}} - - --- GET /api/v1/namespaces/ns2 @@ -288,7 +259,6 @@ Kubectl-Command: kubectl apply - --- PATCH /api/v1/namespaces/ns2?fieldManager=kubectl-client-side-apply&fieldValidation=Ignore @@ -300,5 +270,3 @@ Kubectl-Command: kubectl apply {"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"ns2\"}}\n"}}} - - diff --git a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected.yaml index 95bf8150..a3a008f5 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple2/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 diff --git a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected-apiserver.yaml b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected-apiserver.yaml index 352c9054..137e3f21 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected-apiserver.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected-apiserver.yaml @@ -4,7 +4,6 @@ Accept-Encoding: gzip - --- GET /openapi/v2?timeout=32s @@ -14,7 +13,6 @@ Kubectl-Command: kubectl apply - --- GET /api?timeout=32s @@ -24,7 +22,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1?timeout=32s @@ -34,7 +31,6 @@ Kubectl-Command: kubectl apply - --- GET /apis?timeout=32s @@ -44,7 +40,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/admissionregistration.k8s.io/v1?timeout=32s @@ -54,7 +49,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apiextensions.k8s.io/v1?timeout=32s @@ -64,7 +58,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apiregistration.k8s.io/v1?timeout=32s @@ -74,7 +67,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/apps/v1?timeout=32s @@ -84,7 +76,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v1?timeout=32s @@ -94,7 +85,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v2?timeout=32s @@ -104,7 +94,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/autoscaling/v2beta2?timeout=32s @@ -114,7 +103,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/batch/v1?timeout=32s @@ -124,7 +112,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/certificates.k8s.io/v1?timeout=32s @@ -134,7 +121,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/coordination.k8s.io/v1?timeout=32s @@ -144,7 +130,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/discovery.k8s.io/v1?timeout=32s @@ -154,7 +139,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/events.k8s.io/v1?timeout=32s @@ -164,7 +148,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/flowcontrol.apiserver.k8s.io/v1beta1?timeout=32s @@ -174,7 +157,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/flowcontrol.apiserver.k8s.io/v1beta2?timeout=32s @@ -184,7 +166,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/networking.k8s.io/v1?timeout=32s @@ -194,7 +175,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/node.k8s.io/v1?timeout=32s @@ -204,7 +184,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/policy/v1?timeout=32s @@ -214,7 +193,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/rbac.authorization.k8s.io/v1?timeout=32s @@ -224,7 +202,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/scheduling.k8s.io/v1?timeout=32s @@ -234,7 +211,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/storage.k8s.io/v1?timeout=32s @@ -244,7 +220,6 @@ Kubectl-Command: kubectl apply - --- GET /apis/storage.k8s.io/v1beta1?timeout=32s @@ -254,7 +229,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1/namespaces/ns1 @@ -264,7 +238,6 @@ Kubectl-Command: kubectl apply - --- GET /api/v1/namespaces/ns2 @@ -273,4 +246,3 @@ Accept-Encoding: gzip Kubectl-Command: kubectl apply - diff --git a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected.yaml b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected.yaml index 95bf8150..a3a008f5 100644 --- a/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected.yaml +++ b/pkg/patterns/declarative/pkg/applier/testdata/kubectl/simple3/expected.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 1926 diff --git a/pkg/test/httprecorder/request_log.go b/pkg/test/httprecorder/request_log.go index 01df2dcc..badafacf 100644 --- a/pkg/test/httprecorder/request_log.go +++ b/pkg/test/httprecorder/request_log.go @@ -3,6 +3,7 @@ package httprecorder import ( "encoding/json" "fmt" + "io" "net/http" "net/url" "regexp" @@ -36,16 +37,17 @@ type Response struct { Body string `json:"body,omitempty"` } -func (e *LogEntry) FormatHTTP() string { +func (e *LogEntry) FormatHTTP(pretty bool) string { var b strings.Builder - b.WriteString(e.Request.FormatHTTP()) - b.WriteString(e.Response.FormatHTTP()) + b.WriteString(e.Request.FormatHTTP(pretty)) + b.WriteString("\n") + b.WriteString(e.Response.FormatHTTP(pretty)) return b.String() } -func (r *Request) FormatHTTP() string { - var b strings.Builder - b.WriteString(fmt.Sprintf("%s %s\n", r.Method, r.URL)) +func (r *Request) FormatHTTP(pretty bool) string { + var w strings.Builder + w.WriteString(fmt.Sprintf("%s %s\n", r.Method, r.URL)) var keys []string for k := range r.Header { keys = append(keys, k) @@ -53,15 +55,31 @@ func (r *Request) FormatHTTP() string { sort.Strings(keys) for _, k := range keys { for _, v := range r.Header[k] { - b.WriteString(fmt.Sprintf("%s: %s\n", k, v)) + w.WriteString(fmt.Sprintf("%s: %s\n", k, v)) } } - b.WriteString("\n") - if r.Body != "" { - b.WriteString(r.Body) - b.WriteString("\n\n") + w.WriteString("\n") + writeBody(&w, r.Body, pretty) + return w.String() +} + +func writeBody(w io.StringWriter, body string, pretty bool) { + if body == "" { + return } - return b.String() + + if pretty { + var obj interface{} + if err := json.Unmarshal([]byte(body), &obj); err == nil { + b, err := json.MarshalIndent(obj, "", " ") + if err == nil { + body = string(b) + } + } + } + + w.WriteString(body) + w.WriteString("\n") } func (l *RequestLog) ReplaceTimestamp() { @@ -101,7 +119,12 @@ func resetTimestamp(body string) string { return string(b) } -func (r *Response) FormatHTTP() string { +func (r *Response) FormatHTTP(pretty bool) string { + // Skip empty responses (e.g. from streaming watch) + if r.Status == "" && r.StatusCode == 0 && r.Body == "" { + return "" + } + var b strings.Builder b.WriteString(fmt.Sprintf("%s\n", r.Status)) var keys []string @@ -115,10 +138,7 @@ func (r *Response) FormatHTTP() string { } } b.WriteString("\n") - if r.Body != "" { - b.WriteString(r.Body) - b.WriteString("\n") - } + writeBody(&b, r.Body, pretty) return b.String() } @@ -136,13 +156,13 @@ func (l *RequestLog) AddEntry(entry *LogEntry) { l.entries = append(l.entries, entry) } -func (l *RequestLog) FormatHTTP() string { +func (l *RequestLog) FormatHTTP(pretty bool) string { l.mutex.Lock() defer l.mutex.Unlock() var actual []string for _, entry := range l.entries { - s := entry.FormatHTTP() + s := entry.FormatHTTP(pretty) actual = append(actual, s) } return strings.Join(actual, "\n---\n\n") diff --git a/pkg/test/testreconciler/simpletest/controller_test.go b/pkg/test/testreconciler/simpletest/controller_test.go index 60d02c35..30e11f9a 100644 --- a/pkg/test/testreconciler/simpletest/controller_test.go +++ b/pkg/test/testreconciler/simpletest/controller_test.go @@ -129,7 +129,7 @@ func testSimpleReconciler(h *testharness.Harness, testdir string, applier applie h.Logf("replacing real timestamp in request and response to a fake value") requestLog.ReplaceTimestamp() - requests := requestLog.FormatHTTP() + requests := requestLog.FormatHTTP(false) h.CompareGoldenFile(filepath.Join(testdir, "expected-http.yaml"), requests) } diff --git a/pkg/test/testreconciler/simpletest/testdata/reconcile/direct/create/expected-http.yaml b/pkg/test/testreconciler/simpletest/testdata/reconcile/direct/create/expected-http.yaml index 2db23713..abcf7820 100644 --- a/pkg/test/testreconciler/simpletest/testdata/reconcile/direct/create/expected-http.yaml +++ b/pkg/test/testreconciler/simpletest/testdata/reconcile/direct/create/expected-http.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/apis/addons.example.org/v1alpha1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 245 @@ -14,6 +15,7 @@ Date: (removed) GET http://kube-apiserver/apis/addons.example.org/v1alpha1/simpletests?limit=500&resourceVersion=0 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 379 @@ -27,6 +29,7 @@ Date: (removed) GET http://kube-apiserver/apis/addons.example.org/v1alpha1/simpletests?allowWatchBookmarks=true&resourceVersion=2&timeoutSeconds=&watch=true Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Type: application/json @@ -39,6 +42,7 @@ Date: (removed) GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 2128 @@ -52,6 +56,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 831 @@ -65,6 +70,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -79,6 +85,7 @@ Not Found GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -93,6 +100,7 @@ Not Found GET http://kube-apiserver/api/v1/configmaps?allowWatchBookmarks=true&labelSelector=addons.example.org%2Fsimpletest%3Dsimple1&watch=true Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Type: application/json @@ -105,6 +113,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/deployments?allowWatchBookmarks=true&labelSelector=addons.example.org%2Fsimpletest%3Dsimple1&watch=true Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Type: application/json @@ -117,6 +126,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -131,6 +141,7 @@ Not Found GET http://kube-apiserver/api/v1/namespaces/ns1 Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 286 @@ -161,6 +172,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -175,6 +187,7 @@ Not Found GET http://kube-apiserver/api/v1/namespaces/ns1 Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 286 @@ -205,6 +218,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1680 @@ -235,6 +249,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1025 @@ -248,6 +263,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1680 @@ -261,6 +277,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1025 @@ -274,6 +291,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1680 @@ -287,6 +305,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1680 diff --git a/pkg/test/testreconciler/simpletest/testdata/reconcile/ssa/create/expected-http.yaml b/pkg/test/testreconciler/simpletest/testdata/reconcile/ssa/create/expected-http.yaml index 7347d59f..ffb634db 100644 --- a/pkg/test/testreconciler/simpletest/testdata/reconcile/ssa/create/expected-http.yaml +++ b/pkg/test/testreconciler/simpletest/testdata/reconcile/ssa/create/expected-http.yaml @@ -1,6 +1,7 @@ GET http://kube-apiserver/apis/addons.example.org/v1alpha1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 245 @@ -14,6 +15,7 @@ Date: (removed) GET http://kube-apiserver/apis/addons.example.org/v1alpha1/simpletests?limit=500&resourceVersion=0 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 379 @@ -27,6 +29,7 @@ Date: (removed) GET http://kube-apiserver/apis/addons.example.org/v1alpha1/simpletests?allowWatchBookmarks=true&resourceVersion=2&timeoutSeconds=&watch=true Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Type: application/json @@ -39,6 +42,7 @@ Date: (removed) GET http://kube-apiserver/api/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 2128 @@ -52,6 +56,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1 Accept: application/json, */* + 200 OK Cache-Control: no-cache, private Content-Length: 831 @@ -65,6 +70,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -79,6 +85,7 @@ Not Found GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 404 Not Found Content-Length: 10 Content-Type: text/plain; charset=utf-8 @@ -93,6 +100,7 @@ Not Found GET http://kube-apiserver/api/v1/configmaps?allowWatchBookmarks=true&labelSelector=addons.example.org%2Fsimpletest%3Dsimple1&watch=true Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Type: application/json @@ -105,6 +113,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/deployments?allowWatchBookmarks=true&labelSelector=addons.example.org%2Fsimpletest%3Dsimple1&watch=true Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Type: application/json @@ -166,6 +175,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 583 @@ -179,6 +189,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1040 @@ -208,6 +219,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 583 @@ -221,6 +233,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1040 @@ -234,6 +247,7 @@ Date: (removed) GET http://kube-apiserver/api Accept: application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json + 200 OK Cache-Control: no-cache, private Content-Length: 74 @@ -247,6 +261,7 @@ Date: (removed) GET http://kube-apiserver/apis Accept: application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json + 200 OK Cache-Control: no-cache, private Content-Length: 3401 @@ -292,6 +307,7 @@ Date: (removed) GET http://kube-apiserver/api/v1/namespaces/ns1/configmaps/foo Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 583 @@ -305,6 +321,7 @@ Date: (removed) GET http://kube-apiserver/apis/apps/v1/namespaces/ns1/deployments/mydeployment Accept: application/json + 200 OK Cache-Control: no-cache, private Content-Length: 1040