From 0292a48da20ca7c156a981fd326d00fa126f05e3 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Tue, 18 Nov 2025 18:12:25 -0300 Subject: [PATCH 01/20] added tests from r/r v2/integration/steveapi here --- Makefile | 6 + scripts/build-rancher.sh | 55 + scripts/test-rancher.sh | 272 ++ .../actions/kubeapi/clusters/clusters.go | 16 + .../actions/kubeapi/deployments/create.go | 58 + .../kubeapi/deployments/deployments.go | 82 + .../actions/kubeapi/deployments/list.go | 54 + .../actions/kubeapi/namespaces/create.go | 132 + .../actions/kubeapi/namespaces/list.go | 55 + .../actions/kubeapi/namespaces/namespaces.go | 51 + .../actions/kubeapi/projects/create.go | 33 + .../actions/kubeapi/projects/delete.go | 47 + .../actions/kubeapi/projects/list.go | 36 + .../actions/kubeapi/projects/projects.go | 58 + .../actions/kubeapi/projects/update.go | 47 + .../actions/kubeapi/rbac/create.go | 182 + .../actions/kubeapi/rbac/delete.go | 56 + .../integration/actions/kubeapi/rbac/list.go | 186 + .../integration/actions/kubeapi/rbac/rbac.go | 75 + .../actions/kubeapi/rbac/update.go | 112 + .../actions/kubeapi/resourcequotas/list.go | 43 + .../kubeapi/resourcequotas/resourcequotas.go | 35 + .../actions/kubeapi/secrets/basicAuth.go | 21 + .../actions/kubeapi/secrets/create.go | 38 + .../actions/kubeapi/secrets/list.go | 56 + .../actions/kubeapi/secrets/patchsecrets.go | 49 + .../actions/kubeapi/secrets/secrets.go | 42 + .../integration/actions/namespaces/create.go | 150 + .../actions/secrets/certificates.go | 73 + tests/integration/actions/secrets/config.go | 11 + tests/integration/actions/secrets/secrets.go | 220 ++ tests/integration/actions/secrets/template.go | 20 + .../serviceaccounts/serviceaccounts.go | 38 + tests/integration/setup/README.md | 99 + tests/integration/setup/main.go | 108 + tests/integration/steveapi/README.md | 210 ++ ...2&filter=metadata.namespace~test-ns-1.json | 147 + ..._filter=metadata.labels[test-label]=2.json | 180 + ...er-a_none_filter=metadata.name!=test1.json | 678 ++++ ...me=test1,metadata.namespace~test-ns-1.json | 307 ++ ...ser-a_none_filter=metadata.name=test1.json | 175 + ...ser-a_none_filter=metadata.name=test6.json | 12 + ...e_filter=metadata.namespace~test-ns-1.json | 179 + .../steveapi/json/user-a_none_none.json | 838 +++++ ...8&page=2&revision=nondeterministicint.json | 286 ++ .../steveapi/json/user-a_none_pagesize=8.json | 283 ++ .../json/user-a_none_sort=-metadata.name.json | 838 +++++ ...ort=metadata.name,-metadata.namespace.json | 838 +++++ ...sort=metadata.name,metadata.namespace.json | 838 +++++ .../json/user-a_none_sort=metadata.name.json | 838 +++++ ..._test-ns-1_filter=metadata.name=test1.json | 47 + ...1_filter=metadata.namespace~test-ns-1.json | 179 + .../steveapi/json/user-a_test-ns-1_none.json | 179 + ...3&page=2&revision=nondeterministicint.json | 81 + .../json/user-a_test-ns-1_pagesize=3.json | 119 + .../user-a_test-ns-1_sort=-metadata.name.json | 179 + .../user-a_test-ns-1_sort=metadata.name.json | 179 + ...Fproject-scoped-secret-copy]=potatoes.json | 12 + ...o%2Fproject-scoped-secret-copy]=spuds.json | 51 + ..._filter=metadata.labels[test-label]=2.json | 48 + ...2_filter=metadata.namespace~test-ns-1.json | 12 + .../steveapi/json/user-a_test-ns-5_none.json | 179 + ...2&page=2&revision=nondeterministicint.json | 42 + ...-gte=3&sort=-metadata.name&pagesize=2.json | 78 + ...2&filter=metadata.namespace~test-ns-1.json | 132 + ..._filter=metadata.labels[test-label]=2.json | 42 + ...er-b_none_filter=metadata.name!=test1.json | 132 + ...me=test1,metadata.namespace~test-ns-1.json | 161 + ...ser-b_none_filter=metadata.name=test1.json | 41 + ...e_filter=metadata.namespace~test-ns-1.json | 161 + ...e_filter=metadata.namespace~test-ns-2.json | 9 + .../steveapi/json/user-b_none_none.json | 161 + ...3&page=2&revision=nondeterministicint.json | 72 + .../steveapi/json/user-b_none_pagesize=3.json | 107 + ...ort=-metadata.name,metadata.namespace.json | 161 + .../json/user-b_none_sort=-metadata.name.json | 161 + ...sort=metadata.name,metadata.namespace.json | 161 + .../json/user-b_none_sort=metadata.name.json | 161 + ..._filter=metadata.labels[test-label]=2.json | 42 + ..._test-ns-1_filter=metadata.name=test1.json | 41 + ..._test-ns-1_filter=metadata.name=test6.json | 9 + ...1_filter=metadata.namespace~test-ns-1.json | 161 + ...1_filter=metadata.namespace~test-ns-2.json | 9 + .../steveapi/json/user-b_test-ns-1_none.json | 161 + ...3&page=2&revision=nondeterministicint.json | 72 + .../json/user-b_test-ns-1_pagesize=3.json | 107 + .../user-b_test-ns-1_sort=-metadata.name.json | 161 + .../user-b_test-ns-1_sort=metadata.name.json | 161 + ..._filter=metadata.labels[test-label]=2.json | 9 + ..._test-ns-2_filter=metadata.name=test1.json | 9 + ...2_filter=metadata.namespace~test-ns-1.json | 9 + .../steveapi/json/user-b_test-ns-5_none.json | 9 + .../json/user-b_test-ns-5_pagesize=3.json | 9 + .../user-b_test-ns-5_sort=metadata.name.json | 9 + ...2&filter=metadata.namespace~test-ns-1.json | 42 + ..._filter=metadata.labels[test-label]=2.json | 102 + ...er-c_none_filter=metadata.name!=test1.json | 102 + ...me=test1,metadata.namespace~test-ns-1.json | 129 + ...ser-c_none_filter=metadata.name=test1.json | 99 + ...ser-c_none_filter=metadata.name=test5.json | 9 + ...e_filter=metadata.namespace~test-ns-1.json | 71 + ...e_filter=metadata.namespace~test-ns-2.json | 71 + ...1&page=2&revision=nondeterministicint.json | 41 + ...t-ns-3&sort=-metadata.name&pagesize=1.json | 48 + ...e_filter=metadata.namespace~test-ns-5.json | 9 + .../steveapi/json/user-c_none_none.json | 189 + ...3&page=2&revision=nondeterministicint.json | 101 + .../steveapi/json/user-c_none_pagesize=3.json | 106 + .../json/user-c_none_sort=-metadata.name.json | 189 + ...ort=metadata.name,-metadata.namespace.json | 189 + ...sort=metadata.name,metadata.namespace.json | 189 + .../json/user-c_none_sort=metadata.name.json | 189 + ..._filter=metadata.labels[test-label]=2.json | 42 + ..._test-ns-1_filter=metadata.name=test1.json | 41 + ..._test-ns-1_filter=metadata.name=test3.json | 9 + ..._test-ns-1_filter=metadata.name=test5.json | 9 + ...1_filter=metadata.namespace~test-ns-1.json | 71 + ...1_filter=metadata.namespace~test-ns-2.json | 9 + .../steveapi/json/user-c_test-ns-1_none.json | 71 + .../json/user-c_test-ns-1_pagesize=3.json | 71 + .../user-c_test-ns-1_sort=-metadata.name.json | 71 + ...ort=metadata.name,-metadata.namespace.json | 71 + ...sort=metadata.name,metadata.namespace.json | 71 + .../user-c_test-ns-1_sort=metadata.name.json | 71 + ...2_filter=metadata.namespace~test-ns-1.json | 9 + ..._filter=metadata.labels[test-label]=2.json | 9 + ..._test-ns-5_filter=metadata.name=test1.json | 9 + .../steveapi/json/user-c_test-ns-5_none.json | 9 + .../json/user-c_test-ns-5_pagesize=3.json | 9 + .../user-c_test-ns-5_sort=metadata.name.json | 9 + .../steveapi/json/user-d_none_none.json | 1086 ++++++ ...paces!=test-prj-1,test-ns-6,test-ns-8.json | 139 + ...tsornamespaces!=test-prj-1,test-prj-2.json | 133 + ...none_projectsornamespaces!=test-prj-1.json | 263 ++ ...jectsornamespaces=test-ns-1,test-ns-2.json | 346 ++ ...d_none_projectsornamespaces=test-ns-1.json | 179 + ...jectsornamespaces=test-ns-8,test-ns-9.json | 133 + ...ctsornamespaces=test-prj-1,test-prj-2.json | 968 +++++ ...spaces=test-prj-2,test-ns-2,test-ns-3.json | 476 +++ ..._none_projectsornamespaces=test-prj-2.json | 145 + ...tsornamespaces!=test-prj-1,test-prj-2.json | 12 + ...ns-1_projectsornamespaces!=test-prj-1.json | 12 + ...t-ns-1,test-ns-2,test-prj-2,test-ns-7.json | 179 + .../steveapi/json/user-d_test-ns-6_none.json | 80 + ...-ns-6_projectsornamespaces=test-prj-1.json | 12 + ...-ns-6_projectsornamespaces=test-prj-2.json | 80 + .../steveapi/json/user-e_none_none.json | 1098 ++++++ ...paces!=test-prj-1,test-ns-6,test-ns-8.json | 145 + ...tsornamespaces!=test-prj-1,test-prj-2.json | 145 + ...none_projectsornamespaces!=test-prj-1.json | 275 ++ ...jectsornamespaces=test-ns-1,test-ns-2.json | 346 ++ ...e_none_projectsornamespaces=test-ns-1.json | 179 + ...jectsornamespaces=test-ns-8,test-ns-9.json | 145 + ...ctsornamespaces=test-prj-1,test-prj-2.json | 968 +++++ ...spaces=test-prj-2,test-ns-2,test-ns-3.json | 476 +++ ..._none_projectsornamespaces=test-prj-2.json | 145 + ...paces!=test-prj-1,test-ns-2,test-ns-8.json | 12 + ...tsornamespaces!=test-prj-1,test-prj-2.json | 12 + ...ns-1_projectsornamespaces!=test-prj-1.json | 12 + ...t-ns-1,test-ns-2,test-prj-2,test-ns-7.json | 179 + .../steveapi/json/user-e_test-ns-6_none.json | 80 + ...-ns-6_projectsornamespaces=test-prj-1.json | 12 + ...-ns-6_projectsornamespaces=test-prj-2.json | 80 + tests/integration/steveapi/make-table.sh | 15 + tests/integration/steveapi/output.csv | 134 + tests/integration/steveapi/steve_api_test.go | 3275 +++++++++++++++++ 166 files changed, 27800 insertions(+) create mode 100755 scripts/build-rancher.sh create mode 100755 scripts/test-rancher.sh create mode 100644 tests/integration/actions/kubeapi/clusters/clusters.go create mode 100644 tests/integration/actions/kubeapi/deployments/create.go create mode 100644 tests/integration/actions/kubeapi/deployments/deployments.go create mode 100644 tests/integration/actions/kubeapi/deployments/list.go create mode 100644 tests/integration/actions/kubeapi/namespaces/create.go create mode 100644 tests/integration/actions/kubeapi/namespaces/list.go create mode 100644 tests/integration/actions/kubeapi/namespaces/namespaces.go create mode 100644 tests/integration/actions/kubeapi/projects/create.go create mode 100644 tests/integration/actions/kubeapi/projects/delete.go create mode 100644 tests/integration/actions/kubeapi/projects/list.go create mode 100644 tests/integration/actions/kubeapi/projects/projects.go create mode 100644 tests/integration/actions/kubeapi/projects/update.go create mode 100644 tests/integration/actions/kubeapi/rbac/create.go create mode 100644 tests/integration/actions/kubeapi/rbac/delete.go create mode 100644 tests/integration/actions/kubeapi/rbac/list.go create mode 100644 tests/integration/actions/kubeapi/rbac/rbac.go create mode 100644 tests/integration/actions/kubeapi/rbac/update.go create mode 100644 tests/integration/actions/kubeapi/resourcequotas/list.go create mode 100644 tests/integration/actions/kubeapi/resourcequotas/resourcequotas.go create mode 100644 tests/integration/actions/kubeapi/secrets/basicAuth.go create mode 100644 tests/integration/actions/kubeapi/secrets/create.go create mode 100644 tests/integration/actions/kubeapi/secrets/list.go create mode 100644 tests/integration/actions/kubeapi/secrets/patchsecrets.go create mode 100644 tests/integration/actions/kubeapi/secrets/secrets.go create mode 100644 tests/integration/actions/namespaces/create.go create mode 100644 tests/integration/actions/secrets/certificates.go create mode 100644 tests/integration/actions/secrets/config.go create mode 100644 tests/integration/actions/secrets/secrets.go create mode 100644 tests/integration/actions/secrets/template.go create mode 100644 tests/integration/actions/serviceaccounts/serviceaccounts.go create mode 100644 tests/integration/setup/README.md create mode 100644 tests/integration/setup/main.go create mode 100644 tests/integration/steveapi/README.md create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.name!=test1.json create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.name=test6.json create mode 100644 tests/integration/steveapi/json/user-a_none_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-a_none_none.json create mode 100644 tests/integration/steveapi/json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-a_none_pagesize=8.json create mode 100644 tests/integration/steveapi/json/user-a_none_sort=-metadata.name.json create mode 100644 tests/integration/steveapi/json/user-a_none_sort=metadata.name,-metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-a_none_sort=metadata.name,metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-a_none_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_none.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_sort=-metadata.name.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-1_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=potatoes.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=spuds.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-a_test-ns-5_none.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.name!=test1.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-2.json create mode 100644 tests/integration/steveapi/json/user-b_none_none.json create mode 100644 tests/integration/steveapi/json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-b_none_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-b_none_sort=-metadata.name,metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-b_none_sort=-metadata.name.json create mode 100644 tests/integration/steveapi/json/user-b_none_sort=metadata.name,metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-b_none_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test6.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-2.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_none.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_sort=-metadata.name.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-1_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-5_none.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-5_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-b_test-ns-5_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.name!=test1.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.name=test5.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-2.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1.json create mode 100644 tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-5.json create mode 100644 tests/integration/steveapi/json/user-c_none_none.json create mode 100644 tests/integration/steveapi/json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json create mode 100644 tests/integration/steveapi/json/user-c_none_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-c_none_sort=-metadata.name.json create mode 100644 tests/integration/steveapi/json/user-c_none_sort=metadata.name,-metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-c_none_sort=metadata.name,metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-c_none_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test3.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test5.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-2.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_none.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_sort=-metadata.name.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-2_filter=metadata.namespace~test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.labels[test-label]=2.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.name=test1.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-5_none.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-5_pagesize=3.json create mode 100644 tests/integration/steveapi/json/user-c_test-ns-5_sort=metadata.name.json create mode 100644 tests/integration/steveapi/json/user-d_none_none.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json create mode 100644 tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json create mode 100644 tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json create mode 100644 tests/integration/steveapi/json/user-d_test-ns-6_none.json create mode 100644 tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json create mode 100644 tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-e_none_none.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json create mode 100644 tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-6_none.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json create mode 100644 tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json create mode 100755 tests/integration/steveapi/make-table.sh create mode 100644 tests/integration/steveapi/output.csv create mode 100644 tests/integration/steveapi/steve_api_test.go diff --git a/Makefile b/Makefile index 5f2ebc16f..6fa283209 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,12 @@ build: build-bin: bash scripts/build-bin.sh +build-rancher: + bash scripts/build-rancher.sh + +test-rancher: + bash scripts/test-rancher.sh + run: build docker run $(DOCKER_ARGS) --rm -p 8989:9080 -it -v ${HOME}/.kube:/root/.kube steve --https-listen-port 0 diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh new file mode 100755 index 000000000..e0b0f119d --- /dev/null +++ b/scripts/build-rancher.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -e + +STEVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +RANCHER_DIR="/tmp/rancher-build/rancher" + +if [ -d "$RANCHER_DIR" ]; then + echo "Rancher repository already exists at $RANCHER_DIR" + echo "Skipping clone. To force a fresh clone, remove the directory first: rm -rf $RANCHER_DIR" +else + echo "Cloning rancher repository to $RANCHER_DIR..." + mkdir -p "$(dirname "$RANCHER_DIR")" + git clone https://github.com/rancher/rancher.git "$RANCHER_DIR" +fi + +cd "$RANCHER_DIR" + +echo "Adding replace directive for steve module..." +go mod edit -replace github.com/rancher/steve="$STEVE_DIR" + +echo "Running go mod tidy..." +go mod tidy + +echo "Running make quick..." +STEVE_PARENT_DIR=$(dirname "$STEVE_DIR") +if [ -n "$BUILD_SAFE_DIRS" ]; then + export BUILD_SAFE_DIRS="${BUILD_SAFE_DIRS}:${STEVE_PARENT_DIR}" +else + export BUILD_SAFE_DIRS="${STEVE_PARENT_DIR}" +fi +echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" +make quick + +echo "" +echo "Detecting built images..." +RANCHER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) +RANCHER_AGENT_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) + +if [ -z "$RANCHER_IMAGE" ]; then + echo "Warning: Could not detect rancher image, using default rancher/rancher:dev" + RANCHER_IMAGE="rancher/rancher:dev" +fi + +if [ -z "$RANCHER_AGENT_IMAGE" ]; then + echo "Warning: Could not detect rancher-agent image, using default rancher/rancher-agent:dev" + RANCHER_AGENT_IMAGE="rancher/rancher-agent:dev" +fi + +echo "" +echo "Build complete! Docker images created:" +echo " Rancher server: ${RANCHER_IMAGE}" +echo " Rancher agent: ${RANCHER_AGENT_IMAGE}" + diff --git a/scripts/test-rancher.sh b/scripts/test-rancher.sh new file mode 100755 index 000000000..818848a81 --- /dev/null +++ b/scripts/test-rancher.sh @@ -0,0 +1,272 @@ +#!/bin/bash + +set -e + +# Get the absolute path of the steve directory (this repo) +STEVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +# Initialize variables from environment or defaults +RANCHER_IMAGE="${RANCHER_IMAGE:-}" +RANCHER_AGENT_IMAGE="${RANCHER_AGENT_IMAGE:-}" +CONTAINER_NAME="rancher-server-test" +BOOTSTRAP_PASSWORD="${CATTLE_BOOTSTRAP_PASSWORD:-admin}" +SKIP_SETUP=false + +# Function to detect Rancher images if not provided +detect_rancher_images() { + local rancher_image=$1 + local agent_image=$2 + + if [ -z "$rancher_image" ] || [ -z "$agent_image" ]; then + echo "Detecting most recently built Rancher images..." + + if [ -z "$rancher_image" ]; then + local detected_server=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) + if [ -n "$detected_server" ]; then + rancher_image="$detected_server" + echo " Detected rancher server image: ${rancher_image}" + fi + fi + + if [ -z "$agent_image" ]; then + local detected_agent=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) + if [ -n "$detected_agent" ]; then + agent_image="$detected_agent" + echo " Detected rancher agent image: ${agent_image}" + fi + fi + fi + + # Return values via global variables (bash limitation) + RANCHER_IMAGE="${rancher_image}" + RANCHER_AGENT_IMAGE="${agent_image}" +} + +# Function to cleanup on exit +cleanup() { + echo "" + echo "Cleaning up..." + if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then + echo "Stopping and removing container ${CONTAINER_NAME}..." + docker stop "${CONTAINER_NAME}" >/dev/null 2>&1 || true + docker rm "${CONTAINER_NAME}" >/dev/null 2>&1 || true + fi +} + +trap cleanup EXIT + +# Function to detect the machine's primary IP address +detect_rancher_ip() { + local ip=$(hostname -I | awk '{print $1}') + if [ -z "$ip" ]; then + echo "Error: Could not determine IP address" >&2 + return 1 + fi + # Set global variable + RANCHER_IP="$ip" + echo "Using IP address: $RANCHER_IP" +} + +# Function to remove existing container if it exists +remove_existing_container() { + local container_name=$1 + if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then + echo "Removing existing container ${container_name}..." + docker stop "${container_name}" >/dev/null 2>&1 || true + docker rm "${container_name}" >/dev/null 2>&1 || true + fi +} + +# Function to start Rancher server container +start_rancher_server() { + local container_name=$1 + local rancher_image=$2 + local agent_image=$3 + local rancher_ip=$4 + local bootstrap_password=$5 + + echo "Starting Rancher server container..." + echo " Image: ${rancher_image}" + echo " Agent Image: ${agent_image}" + echo " Server URL: https://${rancher_ip}" + echo "" + + docker create --name "${container_name}" --restart=unless-stopped \ + -p 80:80 -p 443:443 \ + --privileged \ + -e CATTLE_SERVER_URL="https://${rancher_ip}" \ + -e CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" \ + -e CATTLE_DEV_MODE="yes" \ + -e CATTLE_AGENT_IMAGE="${agent_image}" \ + "${rancher_image}" + + docker start "${container_name}" + + docker logs -f "${container_name}" 2>&1 & + LOGS_PID=$! + + cleanup_logs() { + kill $LOGS_PID 2>/dev/null || true + } + trap cleanup_logs EXIT +} + +# Function to wait for Rancher to be ready +wait_for_rancher() { + local rancher_ip=$1 + local max_wait=${2:-300} # Default 5 minutes + local interval=5 + + local elapsed=0 + local state="waiting_for_response" + + while [ $elapsed -lt $max_wait ]; do + local response=$(curl -k -s -L \ + -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ + -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" \ + "https://${rancher_ip}" 2>/dev/null || echo "") + local http_code=$(curl -k -s -o /dev/null -w "%{http_code}" -L \ + -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ + -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" \ + "https://${rancher_ip}" 2>/dev/null || echo "000") + + case "$state" in + "waiting_for_response") + if [ "$http_code" != "000" ] && [ -n "$response" ]; then + state="checking_status" + fi + ;; + "checking_status") + if [ "$http_code" = "503" ] || echo "$response" | grep -qi "API Aggregation not ready"; then + # Still waiting + : + elif [ "$http_code" = "200" ]; then + echo "" + echo "Rancher is ready!" + return 0 + fi + ;; + esac + + sleep $interval + elapsed=$((elapsed + interval)) + done + + echo "Error: Rancher did not become ready within ${max_wait} seconds" + echo "Check logs with: docker logs ${CONTAINER_NAME}" + return 1 +} + +# Function to run the integration test setup +run_setup() { + local steve_dir=$1 + local bootstrap_password=$2 + local agent_image=$3 + local skip_setup=$4 + + if [ "$skip_setup" = true ]; then + echo "Skipping integration test setup..." + return 0 + fi + + echo "" + echo "Running integration test setup..." + cd "${steve_dir}/tests/integration/setup" + + # Build setup binary if it doesn't exist + if [ ! -f "./setup" ] || [ "./setup" -ot "./main.go" ]; then + echo "Building setup binary..." + go build -o setup . + fi + + # Run setup with required environment variables + export CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" + export CATTLE_AGENT_IMAGE="${agent_image}" + export CATTLE_TEST_CONFIG="${steve_dir}/tests/integration/steveapi/steveapi.yaml" + ./setup +} + +# Function to run integration tests +run_integration_tests() { + local steve_dir=$1 + local bootstrap_password=$2 + local agent_image=$3 + + echo "" + echo "Running integration tests..." + cd "${steve_dir}" + + # Export environment variables for tests + export CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" + export CATTLE_AGENT_IMAGE="${agent_image}" + export CATTLE_TEST_CONFIG="${steve_dir}/tests/integration/steveapi/steveapi.yaml" + + # Run the tests + go test -v ./tests/integration/... + + echo "" + echo "Integration tests completed!" +} + +# Main function +main() { + # Parse command line arguments + while [[ $# -gt 0 ]]; do + case $1 in + --rancher-image) + RANCHER_IMAGE="$2" + shift 2 + ;; + --agent-image) + RANCHER_AGENT_IMAGE="$2" + shift 2 + ;; + --container-name) + CONTAINER_NAME="$2" + shift 2 + ;; + --skip-setup) + SKIP_SETUP=true + shift + ;; + --help|-h) + echo "Usage: $0 [OPTIONS]" + echo "" + echo "Options:" + echo " --rancher-image IMAGE Rancher server image (default: auto-detect or rancher/rancher:dev)" + echo " --agent-image IMAGE Rancher agent image (default: auto-detect or rancher/rancher-agent:dev)" + echo " --container-name NAME Docker container name (default: rancher-server-test)" + echo " --skip-setup Skip running the setup program" + echo " -h, --help Show this help message" + echo "" + echo "Environment variables:" + echo " RANCHER_IMAGE Same as --rancher-image" + echo " RANCHER_AGENT_IMAGE Same as --agent-image" + echo " CATTLE_BOOTSTRAP_PASSWORD Bootstrap password (default: admin)" + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Use --help for usage information" + exit 1 + ;; + esac + done + + detect_rancher_images "${RANCHER_IMAGE}" "${RANCHER_AGENT_IMAGE}" + + detect_rancher_ip || exit 1 + + remove_existing_container "${CONTAINER_NAME}" + + start_rancher_server "${CONTAINER_NAME}" "${RANCHER_IMAGE}" "${RANCHER_AGENT_IMAGE}" "${RANCHER_IP}" "${BOOTSTRAP_PASSWORD}" + + wait_for_rancher "${RANCHER_IP}" 300 || exit 1 + + run_setup "${STEVE_DIR}" "${BOOTSTRAP_PASSWORD}" "${RANCHER_AGENT_IMAGE}" "${SKIP_SETUP}" + + run_integration_tests "${STEVE_DIR}" "${BOOTSTRAP_PASSWORD}" "${RANCHER_AGENT_IMAGE}" +} + +# Call main function with all arguments +main "$@" diff --git a/tests/integration/actions/kubeapi/clusters/clusters.go b/tests/integration/actions/kubeapi/clusters/clusters.go new file mode 100644 index 000000000..406c96a94 --- /dev/null +++ b/tests/integration/actions/kubeapi/clusters/clusters.go @@ -0,0 +1,16 @@ +package clusters + +import ( + rbacapi "github.com/rancher/steve/tests/integration/actions/kubeapi/rbac" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/wrangler" +) + +// GetClusterWranglerContext returns the context for the cluster +func GetClusterWranglerContext(client *rancher.Client, clusterID string) (*wrangler.Context, error) { + if clusterID == rbacapi.LocalCluster { + return client.WranglerContext, nil + } + + return client.WranglerContext.DownStreamClusterWranglerContext(clusterID) +} diff --git a/tests/integration/actions/kubeapi/deployments/create.go b/tests/integration/actions/kubeapi/deployments/create.go new file mode 100644 index 000000000..2f9b5f4a8 --- /dev/null +++ b/tests/integration/actions/kubeapi/deployments/create.go @@ -0,0 +1,58 @@ +package deployments + +import ( + "context" + "fmt" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreateDeployment is a helper function that uses the dynamic client to create a deployment on a namespace for a specific cluster. +func CreateDeployment(client *rancher.Client, clusterName, deploymentName, namespace string, template corev1.PodTemplateSpec, replicas int32) (*appv1.Deployment, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterName) + if err != nil { + return nil, err + } + + labels := map[string]string{} + labels["workload.user.cattle.io/workloadselector"] = fmt.Sprintf("apps.deployment-%v-%v", namespace, deploymentName) + + template.ObjectMeta = metav1.ObjectMeta{ + Labels: labels, + } + + template.Spec.RestartPolicy = corev1.RestartPolicyAlways + deployment := &appv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: deploymentName, + Namespace: namespace, + }, + Spec: appv1.DeploymentSpec{ + Replicas: &replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: labels, + }, + Template: template, + }, + } + + deploymentResource := dynamicClient.Resource(DeploymentGroupVersionResource).Namespace(namespace) + + unstructuredResp, err := deploymentResource.Create(context.TODO(), unstructured.MustToUnstructured(deployment), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newDeployment := &appv1.Deployment{} + err = scheme.Scheme.Convert(unstructuredResp, newDeployment, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newDeployment, nil +} diff --git a/tests/integration/actions/kubeapi/deployments/deployments.go b/tests/integration/actions/kubeapi/deployments/deployments.go new file mode 100644 index 000000000..555ff0a7a --- /dev/null +++ b/tests/integration/actions/kubeapi/deployments/deployments.go @@ -0,0 +1,82 @@ +package deployments + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/pkg/api/scheme" + "github.com/rancher/shepherd/pkg/wait" + appv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" +) + +// DeploymentGroupVersionResource is the required Group Version Resource for accessing deployments in a cluster, +// using the dynamic client. +var DeploymentGroupVersionResource = schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: "deployments", +} + +// WatchAndWaitDeployments is a helper function that watches the deployments +// sequentially in a specific namespace and waits until number of expected replicas is equal to number of available replicas. +func WatchAndWaitDeployments(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error { + adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) + if err != nil { + return err + } + adminDynamicClient, err := adminClient.GetDownStreamClusterClient(clusterID) + if err != nil { + return err + } + + adminDeploymentResource := adminDynamicClient.Resource(DeploymentGroupVersionResource).Namespace(namespace) + + deployments, err := adminDeploymentResource.List(context.TODO(), listOptions) + if err != nil { + return err + } + + var deploymentList []appv1.Deployment + + for _, unstructuredDeployment := range deployments.Items { + newDeployment := &appv1.Deployment{} + err := scheme.Scheme.Convert(&unstructuredDeployment, newDeployment, unstructuredDeployment.GroupVersionKind()) + if err != nil { + return err + } + + deploymentList = append(deploymentList, *newDeployment) + } + + for _, deployment := range deploymentList { + watchAppInterface, err := adminDeploymentResource.Watch(context.TODO(), metav1.ListOptions{ + FieldSelector: "metadata.name=" + deployment.Name, + TimeoutSeconds: &defaults.WatchTimeoutSeconds, + }) + if err != nil { + return err + } + + wait.WatchWait(watchAppInterface, func(event watch.Event) (ready bool, err error) { + deploymentsUnstructured := event.Object.(*unstructured.Unstructured) + deployment := &appv1.Deployment{} + + err = scheme.Scheme.Convert(deploymentsUnstructured, deployment, deploymentsUnstructured.GroupVersionKind()) + if err != nil { + return false, err + } + + if *deployment.Spec.Replicas == deployment.Status.AvailableReplicas { + return true, nil + } + return false, nil + }) + } + + return nil +} diff --git a/tests/integration/actions/kubeapi/deployments/list.go b/tests/integration/actions/kubeapi/deployments/list.go new file mode 100644 index 000000000..30609f81e --- /dev/null +++ b/tests/integration/actions/kubeapi/deployments/list.go @@ -0,0 +1,54 @@ +package deployments + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + appv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeploymentList is a struct that contains a list of deployments. +type DeploymentList struct { + Items []appv1.Deployment +} + +// ListDeployments is a helper function that uses the dynamic client to list deployments on a namespace for a specific cluster with its list options. +func ListDeployments(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*DeploymentList, error) { + deploymentList := new(DeploymentList) + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + deploymentResource := dynamicClient.Resource(DeploymentGroupVersionResource).Namespace(namespace) + deployments, err := deploymentResource.List(context.TODO(), listOpts) + if err != nil { + return nil, err + } + + for _, unstructuredDeployment := range deployments.Items { + newDeployment := &appv1.Deployment{} + err := scheme.Scheme.Convert(&unstructuredDeployment, newDeployment, unstructuredDeployment.GroupVersionKind()) + if err != nil { + return nil, err + } + + deploymentList.Items = append(deploymentList.Items, *newDeployment) + } + + return deploymentList, nil +} + +// Names is a method that accepts DeploymentList as a receiver, +// returns each deployment name in the list as a new slice of strings. +func (list *DeploymentList) Names() []string { + var deploymentNames []string + + for _, deployment := range list.Items { + deploymentNames = append(deploymentNames, deployment.Name) + } + + return deploymentNames +} diff --git a/tests/integration/actions/kubeapi/namespaces/create.go b/tests/integration/actions/kubeapi/namespaces/create.go new file mode 100644 index 000000000..a4f484cf0 --- /dev/null +++ b/tests/integration/actions/kubeapi/namespaces/create.go @@ -0,0 +1,132 @@ +package namespaces + +import ( + "context" + "fmt" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + "github.com/rancher/shepherd/pkg/wait" + coreV1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kubeUnstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/watch" +) + +// CreateNamespace is a helper function that uses the dynamic client to create a namespace on a project. +// It registers a delete function with a wait.WatchWait to ensure the namspace is deleted cleanly. +func CreateNamespace(client *rancher.Client, clusterID, projectName, namespaceName, containerDefaultResourceLimit string, labels, annotations map[string]string) (*coreV1.Namespace, error) { + if annotations == nil { + annotations = make(map[string]string) + } + + if containerDefaultResourceLimit != "" { + annotations["field.cattle.io/containerDefaultResourceLimit"] = containerDefaultResourceLimit + } + + if projectName != "" { + annotationValue := clusterID + ":" + projectName + annotations["field.cattle.io/projectId"] = annotationValue + } + + namespace := &coreV1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: namespaceName, + Annotations: annotations, + Labels: labels, + }, + } + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) + if err != nil { + return nil, err + } + + adminDynamicClient, err := adminClient.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + namespaceResource := dynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") + + unstructuredResp, err := namespaceResource.Create(context.TODO(), unstructured.MustToUnstructured(namespace), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + clusterRoleResource := adminDynamicClient.Resource(rbacv1.SchemeGroupVersion.WithResource("clusterroles")) + + clusterRoleWatch, err := clusterRoleResource.Watch(context.TODO(), metav1.ListOptions{ + FieldSelector: "metadata.name=" + fmt.Sprintf("%s-namespaces-edit", projectName), + TimeoutSeconds: &defaults.WatchTimeoutSeconds, + }) + + if err != nil { + return nil, err + } + + err = wait.WatchWait(clusterRoleWatch, func(event watch.Event) (ready bool, err error) { + clusterRole := &rbacv1.ClusterRole{} + err = scheme.Scheme.Convert(event.Object.(*kubeUnstructured.Unstructured), clusterRole, event.Object.(*kubeUnstructured.Unstructured).GroupVersionKind()) + + if err != nil { + return false, err + } + + for _, rule := range clusterRole.Rules { + for _, resourceName := range rule.ResourceNames { + if resourceName == namespaceName { + return true, nil + } + } + } + return false, nil + }) + + if err != nil { + return nil, err + } + + client.Session.RegisterCleanupFunc(func() error { + err := namespaceResource.Delete(context.TODO(), unstructuredResp.GetName(), metav1.DeleteOptions{}) + if errors.IsNotFound(err) { + return nil + } + if err != nil { + return err + } + + adminNamespaceResource := adminDynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") + watchInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ + FieldSelector: "metadata.name=" + unstructuredResp.GetName(), + TimeoutSeconds: &defaults.WatchTimeoutSeconds, + }) + + if err != nil { + return err + } + + return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { + if event.Type == watch.Deleted { + return true, nil + } + return false, nil + }) + }) + + newNamespace := &coreV1.Namespace{} + err = scheme.Scheme.Convert(unstructuredResp, newNamespace, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newNamespace, nil +} diff --git a/tests/integration/actions/kubeapi/namespaces/list.go b/tests/integration/actions/kubeapi/namespaces/list.go new file mode 100644 index 000000000..dc04d818d --- /dev/null +++ b/tests/integration/actions/kubeapi/namespaces/list.go @@ -0,0 +1,55 @@ +package namespaces + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NamespaceList is a struct that contains a list of namespaces. +type NamespaceList struct { + Items []corev1.Namespace +} + +// ListNamespaces is a helper function that uses the dynamic client to list namespaces in a cluster with its list options. +func ListNamespaces(client *rancher.Client, clusterID string, listOpts metav1.ListOptions) (*NamespaceList, error) { + namespaceList := new(NamespaceList) + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + namespaceResource := dynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") + namespaces, err := namespaceResource.List(context.TODO(), listOpts) + if err != nil { + return nil, err + } + + for _, unstructuredNamespace := range namespaces.Items { + newNamespace := &corev1.Namespace{} + err := scheme.Scheme.Convert(&unstructuredNamespace, newNamespace, unstructuredNamespace.GroupVersionKind()) + if err != nil { + return nil, err + } + + namespaceList.Items = append(namespaceList.Items, *newNamespace) + } + + return namespaceList, nil +} + +// Names is a method that accepts NamespaceList as a receiver, +// returns each namespace name in the list as a new slice of strings. +func (list *NamespaceList) Names() []string { + var namespaceNames []string + + for _, namespace := range list.Items { + namespaceNames = append(namespaceNames, namespace.Name) + } + + return namespaceNames +} diff --git a/tests/integration/actions/kubeapi/namespaces/namespaces.go b/tests/integration/actions/kubeapi/namespaces/namespaces.go new file mode 100644 index 000000000..3a8e75d55 --- /dev/null +++ b/tests/integration/actions/kubeapi/namespaces/namespaces.go @@ -0,0 +1,51 @@ +package namespaces + +import ( + "context" + "fmt" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// NamespaceGroupVersionResource is the required Group Version Resource for accessing namespaces in a cluster, +// using the dynamic client. +var NamespaceGroupVersionResource = schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "namespaces", +} + +// ContainerDefaultResourceLimit sets the container default resource limit in a string +// limitsCPU and requestsCPU in form of "3m" +// limitsMemory and requestsMemory in the form of "3Mi" +func ContainerDefaultResourceLimit(limitsCPU, limitsMemory, requestsCPU, requestsMemory string) string { + containerDefaultResourceLimit := fmt.Sprintf("{\"limitsCpu\": \"%s\", \"limitsMemory\":\"%s\",\"requestsCpu\":\"%s\",\"requestsMemory\":\"%s\"}", + limitsCPU, limitsMemory, requestsCPU, requestsMemory) + return containerDefaultResourceLimit +} + +// GetNamespaceByName is a helper function that returns the namespace by name in a specific cluster, uses ListNamespaces to get the namespace. +func GetNamespaceByName(client *rancher.Client, clusterID, namespaceName string) (*corev1.Namespace, error) { + namespace := new(corev1.Namespace) + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + namespaceResource := dynamicClient.Resource(NamespaceGroupVersionResource).Namespace("") + unstructuredNamespace, err := namespaceResource.Get(context.TODO(), namespaceName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + if err = scheme.Scheme.Convert(unstructuredNamespace, namespace, unstructuredNamespace.GroupVersionKind()); err != nil { + return nil, err + } + + return namespace, nil +} diff --git a/tests/integration/actions/kubeapi/projects/create.go b/tests/integration/actions/kubeapi/projects/create.go new file mode 100644 index 000000000..7f658df08 --- /dev/null +++ b/tests/integration/actions/kubeapi/projects/create.go @@ -0,0 +1,33 @@ +package projects + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreateProject is a helper function that uses the dynamic client to create a project in a cluster. +func CreateProject(client *rancher.Client, project *v3.Project) (*v3.Project, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + projectResource := dynamicClient.Resource(ProjectGroupVersionResource).Namespace(project.Namespace) + unstructuredResp, err := projectResource.Create(context.TODO(), unstructured.MustToUnstructured(project), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newProject := &v3.Project{} + err = scheme.Scheme.Convert(unstructuredResp, newProject, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newProject, nil +} diff --git a/tests/integration/actions/kubeapi/projects/delete.go b/tests/integration/actions/kubeapi/projects/delete.go new file mode 100644 index 000000000..13a704ebc --- /dev/null +++ b/tests/integration/actions/kubeapi/projects/delete.go @@ -0,0 +1,47 @@ +package projects + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/defaults" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kwait "k8s.io/apimachinery/pkg/util/wait" +) + +// DeleteProject is a helper function that uses the dynamic client to delete a Project from a cluster. +func DeleteProject(client *rancher.Client, projectNamespace string, projectName string) error { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return err + } + + projectResource := dynamicClient.Resource(ProjectGroupVersionResource).Namespace(projectNamespace) + + err = projectResource.Delete(context.TODO(), projectName, metav1.DeleteOptions{}) + if err != nil { + return err + } + + err = kwait.Poll(defaults.FiveHundredMillisecondTimeout, defaults.TenSecondTimeout, func() (done bool, err error) { + projectList, err := ListProjects(client, projectNamespace, metav1.ListOptions{ + FieldSelector: "metadata.name=" + projectName, + }) + + if err != nil { + return false, err + } + + if len(projectList.Items) == 0 { + return true, nil + } + + return false, nil + }) + + if err != nil { + return err + } + + return nil +} diff --git a/tests/integration/actions/kubeapi/projects/list.go b/tests/integration/actions/kubeapi/projects/list.go new file mode 100644 index 000000000..df20de397 --- /dev/null +++ b/tests/integration/actions/kubeapi/projects/list.go @@ -0,0 +1,36 @@ +package projects + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ListProjects is a helper function that uses the dynamic client to list projects in a cluster. +func ListProjects(client *rancher.Client, namespace string, listOpt metav1.ListOptions) (*v3.ProjectList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(ProjectGroupVersionResource).Namespace(namespace).List(context.Background(), listOpt) + if err != nil { + return nil, err + } + + projectList := new(v3.ProjectList) + for _, unstructuredProjects := range unstructuredList.Items { + project := &v3.Project{} + err := scheme.Scheme.Convert(&unstructuredProjects, project, unstructuredProjects.GroupVersionKind()) + if err != nil { + return nil, err + } + + projectList.Items = append(projectList.Items, *project) + } + + return projectList, nil +} diff --git a/tests/integration/actions/kubeapi/projects/projects.go b/tests/integration/actions/kubeapi/projects/projects.go new file mode 100644 index 000000000..b51d60f0a --- /dev/null +++ b/tests/integration/actions/kubeapi/projects/projects.go @@ -0,0 +1,58 @@ +package projects + +import ( + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + Admin = "admin" + StandardUser = "user" + DefaultNamespace = "fleet-default" + RancherNamespace = "cattle-system" + LocalCluster = "local" + Projects = "projects" + ProjectIDAnnotation = "field.cattle.io/projectId" + GroupName = "management.cattle.io" + Version = "v3" +) + +// ProjectGroupVersionResource is the required Group Version Resource for accessing projects in a cluster, using the dynamic client. +var ProjectGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: Projects, +} + +// NewProjectTemplate is a constructor that creates the project template +func NewProjectTemplate(clusterID string) *v3.Project { + project := &v3.Project{ + ObjectMeta: metav1.ObjectMeta{ + Name: namegen.AppendRandomString("testproject"), + Namespace: clusterID, + Finalizers: []string{}, + }, + Spec: v3.ProjectSpec{ + ClusterName: clusterID, + ResourceQuota: &v3.ProjectResourceQuota{ + Limit: v3.ResourceQuotaLimit{ + Pods: "", + }, + }, + NamespaceDefaultResourceQuota: &v3.NamespaceResourceQuota{ + Limit: v3.ResourceQuotaLimit{ + Pods: "", + }, + }, + ContainerDefaultResourceLimit: &v3.ContainerResourceLimit{ + RequestsCPU: "", + RequestsMemory: "", + LimitsCPU: "", + LimitsMemory: "", + }, + }, + } + return project +} diff --git a/tests/integration/actions/kubeapi/projects/update.go b/tests/integration/actions/kubeapi/projects/update.go new file mode 100644 index 000000000..5da64e69e --- /dev/null +++ b/tests/integration/actions/kubeapi/projects/update.go @@ -0,0 +1,47 @@ +package projects + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UpdateProject is a helper function that uses the dynamic client to update a project in a cluster. +func UpdateProject(client *rancher.Client, existingProject *v3.Project, updatedProject *v3.Project) (*v3.Project, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + projectResource := dynamicClient.Resource(ProjectGroupVersionResource).Namespace(existingProject.Namespace) + + projectUnstructured, err := projectResource.Get(context.TODO(), existingProject.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + currentProject := &v3.Project{} + err = scheme.Scheme.Convert(projectUnstructured, currentProject, projectUnstructured.GroupVersionKind()) + if err != nil { + return nil, err + } + + updatedProject.ObjectMeta.ResourceVersion = currentProject.ObjectMeta.ResourceVersion + + unstructuredResp, err := projectResource.Update(context.TODO(), unstructured.MustToUnstructured(updatedProject), metav1.UpdateOptions{}) + if err != nil { + return nil, err + } + + newProject := &v3.Project{} + err = scheme.Scheme.Convert(unstructuredResp, newProject, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newProject, nil +} diff --git a/tests/integration/actions/kubeapi/rbac/create.go b/tests/integration/actions/kubeapi/rbac/create.go new file mode 100644 index 000000000..c6c2b6904 --- /dev/null +++ b/tests/integration/actions/kubeapi/rbac/create.go @@ -0,0 +1,182 @@ +package rbac + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + rbacv1 "k8s.io/api/rbac/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CreateRole is a helper function that uses the dynamic client to create a role on a namespace for a specific cluster. +func CreateRole(client *rancher.Client, clusterName string, role *rbacv1.Role) (*rbacv1.Role, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterName) + if err != nil { + return nil, err + } + + roleResource := dynamicClient.Resource(RoleGroupVersionResource).Namespace(role.Namespace) + + unstructuredResp, err := roleResource.Create(context.Background(), unstructured.MustToUnstructured(role), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newRole := &rbacv1.Role{} + err = scheme.Scheme.Convert(unstructuredResp, newRole, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newRole, nil +} + +// CreateRoleBinding is a helper function that uses the dynamic client to create a rolebinding on a namespace for a specific cluster. +func CreateRoleBinding(client *rancher.Client, clusterName, roleBindingName, namespace, roleName string, subject rbacv1.Subject) (*rbacv1.RoleBinding, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterName) + if err != nil { + return nil, err + } + + roleBinding := &rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: roleBindingName, + Namespace: namespace, + }, + Subjects: []rbacv1.Subject{subject}, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: roleName, + }, + } + + roleBindingResource := dynamicClient.Resource(RoleBindingGroupVersionResource).Namespace(namespace) + + unstructuredResp, err := roleBindingResource.Create(context.Background(), unstructured.MustToUnstructured(roleBinding), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newRoleBinding := &rbacv1.RoleBinding{} + err = scheme.Scheme.Convert(unstructuredResp, newRoleBinding, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newRoleBinding, nil +} + +// CreateGlobalRole is a helper function that uses the dynamic client to create a global role in the local cluster. +func CreateGlobalRole(client *rancher.Client, globalRole *v3.GlobalRole) (*v3.GlobalRole, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + globalRoleResource := dynamicClient.Resource(GlobalRoleGroupVersionResource) + unstructuredResp, err := globalRoleResource.Create(context.TODO(), unstructured.MustToUnstructured(globalRole), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newGlobalRole := &v3.GlobalRole{} + err = scheme.Scheme.Convert(unstructuredResp, newGlobalRole, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newGlobalRole, nil +} + +// CreateGlobalRoleBinding is a helper function that uses the dynamic client to create a global role binding for a specific user. +func CreateGlobalRoleBinding(client *rancher.Client, globalRoleBinding *v3.GlobalRoleBinding) (*v3.GlobalRoleBinding, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + globalRoleBindingResource := dynamicClient.Resource(GlobalRoleBindingGroupVersionResource) + unstructuredResp, err := globalRoleBindingResource.Create(context.TODO(), unstructured.MustToUnstructured(globalRoleBinding), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newGlobalRoleBinding := &v3.GlobalRoleBinding{} + err = scheme.Scheme.Convert(unstructuredResp, newGlobalRoleBinding, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newGlobalRoleBinding, nil +} + +// CreateRoleTemplate is a helper function that uses the dynamic client to create a cluster/project role template for a specific user +func CreateRoleTemplate(client *rancher.Client, roleTemplate *v3.RoleTemplate) (*v3.RoleTemplate, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + roleTemplateResource := dynamicClient.Resource(RoleTemplateGroupVersionResource) + unstructuredResp, err := roleTemplateResource.Create(context.Background(), unstructured.MustToUnstructured(roleTemplate), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newRoleTemplate := &v3.RoleTemplate{} + err = scheme.Scheme.Convert(unstructuredResp, newRoleTemplate, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newRoleTemplate, nil +} + +// CreateProjectRoleTemplateBinding is a helper function that uses the dynamic client to create a project role template binding in the local cluster. +func CreateProjectRoleTemplateBinding(client *rancher.Client, prtb *v3.ProjectRoleTemplateBinding) (*v3.ProjectRoleTemplateBinding, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + projectRoleTemplateBindingResource := dynamicClient.Resource(ProjectRoleTemplateBindingGroupVersionResource).Namespace(prtb.Namespace) + unstructuredResp, err := projectRoleTemplateBindingResource.Create(context.TODO(), unstructured.MustToUnstructured(prtb), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newprtb := &v3.ProjectRoleTemplateBinding{} + err = scheme.Scheme.Convert(unstructuredResp, newprtb, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newprtb, nil +} + +// CreateClusterRoleTemplateBinding is a helper function that uses the dynamic client to create a cluster role template binding for a specific user +// in the given downstream cluster. +func CreateClusterRoleTemplateBinding(client *rancher.Client, crtb *v3.ClusterRoleTemplateBinding) (*v3.ClusterRoleTemplateBinding, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + clusterRoleTemplateBindingResource := dynamicClient.Resource(ClusterRoleTemplateBindingGroupVersionResource).Namespace(crtb.Namespace) + unstructuredResp, err := clusterRoleTemplateBindingResource.Create(context.Background(), unstructured.MustToUnstructured(crtb), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newClusterRoleTemplateBinding := &v3.ClusterRoleTemplateBinding{} + err = scheme.Scheme.Convert(unstructuredResp, newClusterRoleTemplateBinding, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + + return newClusterRoleTemplateBinding, nil +} diff --git a/tests/integration/actions/kubeapi/rbac/delete.go b/tests/integration/actions/kubeapi/rbac/delete.go new file mode 100644 index 000000000..0f2e16516 --- /dev/null +++ b/tests/integration/actions/kubeapi/rbac/delete.go @@ -0,0 +1,56 @@ +package rbac + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeleteGlobalRoleBinding is a helper function that uses the dynamic client to delete a Global Role Binding by name +func DeleteGlobalRoleBinding(client *rancher.Client, globalRoleBindingName string) error { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return err + } + + globalRoleBindingResource := dynamicClient.Resource(GlobalRoleBindingGroupVersionResource) + + err = globalRoleBindingResource.Delete(context.TODO(), globalRoleBindingName, metav1.DeleteOptions{}) + if err != nil { + return err + } + return nil +} + +// DeleteGlobalRole is a helper function that uses the dynamic client to delete a Global Role by name +func DeleteGlobalRole(client *rancher.Client, globalRoleName string) error { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return err + } + + globalRoleResource := dynamicClient.Resource(GlobalRoleGroupVersionResource) + + err = globalRoleResource.Delete(context.TODO(), globalRoleName, metav1.DeleteOptions{}) + if err != nil { + return err + } + return nil +} + +// DeleteRoletemplate is a helper function that uses the dynamic client to delete a Custom Cluster Role/ Project Role template by name +func DeleteRoletemplate(client *rancher.Client, roleName string) error { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return err + } + + roleResource := dynamicClient.Resource(RoleTemplateGroupVersionResource) + + err = roleResource.Delete(context.TODO(), roleName, metav1.DeleteOptions{}) + if err != nil { + return err + } + return nil +} diff --git a/tests/integration/actions/kubeapi/rbac/list.go b/tests/integration/actions/kubeapi/rbac/list.go new file mode 100644 index 000000000..1e72f1b33 --- /dev/null +++ b/tests/integration/actions/kubeapi/rbac/list.go @@ -0,0 +1,186 @@ +package rbac + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + rbacv1 "k8s.io/api/rbac/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ListRoleBindings is a helper function that uses the dynamic client to list rolebindings on a namespace for a specific cluster. +func ListRoleBindings(client *rancher.Client, clusterName, namespace string, listOpt metav1.ListOptions) (*rbacv1.RoleBindingList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterName) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(RoleBindingGroupVersionResource).Namespace(namespace).List(context.Background(), listOpt) + if err != nil { + return nil, err + } + + rbList := new(rbacv1.RoleBindingList) + for _, unstructuredRB := range unstructuredList.Items { + rb := &rbacv1.RoleBinding{} + err := scheme.Scheme.Convert(&unstructuredRB, rb, unstructuredRB.GroupVersionKind()) + if err != nil { + return nil, err + } + + rbList.Items = append(rbList.Items, *rb) + } + return rbList, nil +} + +// ListClusterRoleBindings is a helper function that uses the dynamic client to list clusterrolebindings for a specific cluster. +func ListClusterRoleBindings(client *rancher.Client, clusterName string, listOpt metav1.ListOptions) (*rbacv1.ClusterRoleBindingList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterName) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(ClusterRoleBindingGroupVersionResource).Namespace("").List(context.Background(), listOpt) + if err != nil { + return nil, err + } + + crbList := new(rbacv1.ClusterRoleBindingList) + for _, unstructuredCRB := range unstructuredList.Items { + crb := &rbacv1.ClusterRoleBinding{} + err := scheme.Scheme.Convert(&unstructuredCRB, crb, unstructuredCRB.GroupVersionKind()) + if err != nil { + return nil, err + } + crbList.Items = append(crbList.Items, *crb) + } + + return crbList, nil +} + +// ListGlobalRoleBindings is a helper function that uses the dynamic client to list globalrolebindings from local cluster. +func ListGlobalRoleBindings(client *rancher.Client, listOpt metav1.ListOptions) (*v3.GlobalRoleBindingList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(GlobalRoleBindingGroupVersionResource).List(context.TODO(), listOpt) + if err != nil { + return nil, err + } + + grbList := new(v3.GlobalRoleBindingList) + for _, unstructuredGRB := range unstructuredList.Items { + grb := &v3.GlobalRoleBinding{} + err := scheme.Scheme.Convert(&unstructuredGRB, grb, unstructuredGRB.GroupVersionKind()) + if err != nil { + return nil, err + } + grbList.Items = append(grbList.Items, *grb) + } + + return grbList, nil +} + +// ListClusterRoleTemplateBindings is a helper function that uses the dynamic client to list clusterroletemplatebindings from local cluster. +func ListClusterRoleTemplateBindings(client *rancher.Client, listOpt metav1.ListOptions) (*v3.ClusterRoleTemplateBindingList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(ClusterRoleTemplateBindingGroupVersionResource).Namespace("").List(context.TODO(), listOpt) + if err != nil { + return nil, err + } + + crtbList := new(v3.ClusterRoleTemplateBindingList) + for _, unstructuredCRTB := range unstructuredList.Items { + crtb := &v3.ClusterRoleTemplateBinding{} + err := scheme.Scheme.Convert(&unstructuredCRTB, crtb, unstructuredCRTB.GroupVersionKind()) + if err != nil { + return nil, err + } + crtbList.Items = append(crtbList.Items, *crtb) + } + + return crtbList, nil +} + +// ListGlobalRoles is a helper function that uses the dynamic client to list globalroles from local cluster. +func ListGlobalRoles(client *rancher.Client, listOpt metav1.ListOptions) (*v3.GlobalRoleList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(GlobalRoleGroupVersionResource).List(context.TODO(), listOpt) + if err != nil { + return nil, err + } + + grList := new(v3.GlobalRoleList) + for _, unstructuredGR := range unstructuredList.Items { + gr := &v3.GlobalRole{} + err := scheme.Scheme.Convert(&unstructuredGR, gr, unstructuredGR.GroupVersionKind()) + if err != nil { + return nil, err + } + grList.Items = append(grList.Items, *gr) + } + + return grList, nil +} + +// ListRoleTemplates is a helper function that uses the dynamic client to list role templates from local cluster. +func ListRoleTemplates(client *rancher.Client, listOpt metav1.ListOptions) (*v3.RoleTemplateList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(RoleTemplateGroupVersionResource).List(context.TODO(), listOpt) + if err != nil { + return nil, err + } + + rtList := new(v3.RoleTemplateList) + for _, unstructuredRT := range unstructuredList.Items { + rt := &v3.RoleTemplate{} + err := scheme.Scheme.Convert(&unstructuredRT, rt, unstructuredRT.GroupVersionKind()) + if err != nil { + return nil, err + } + rtList.Items = append(rtList.Items, *rt) + } + + return rtList, nil +} + +// ListProjectRoleTemplateBindings is a helper function that uses the dynamic client to list projectroletemplatebindings from local cluster. +func ListProjectRoleTemplateBindings(client *rancher.Client, listOpt metav1.ListOptions) (*v3.ProjectRoleTemplateBindingList, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + + unstructuredList, err := dynamicClient.Resource(ProjectRoleTemplateBindingGroupVersionResource).Namespace("").List(context.TODO(), listOpt) + if err != nil { + return nil, err + } + + prtbList := new(v3.ProjectRoleTemplateBindingList) + for _, unstructuredPRTB := range unstructuredList.Items { + prtb := &v3.ProjectRoleTemplateBinding{} + err := scheme.Scheme.Convert(&unstructuredPRTB, prtb, unstructuredPRTB.GroupVersionKind()) + if err != nil { + return nil, err + } + prtbList.Items = append(prtbList.Items, *prtb) + } + + return prtbList, nil +} diff --git a/tests/integration/actions/kubeapi/rbac/rbac.go b/tests/integration/actions/kubeapi/rbac/rbac.go new file mode 100644 index 000000000..c3bc9da89 --- /dev/null +++ b/tests/integration/actions/kubeapi/rbac/rbac.go @@ -0,0 +1,75 @@ +package rbac + +import ( + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + GroupName = "management.cattle.io" + Version = "v3" + LocalCluster = "local" +) + +// RoleGroupVersionResource is the required Group Version Resource for accessing roles in a cluster, using the dynamic client. +var RoleGroupVersionResource = schema.GroupVersionResource{ + Group: rbacv1.SchemeGroupVersion.Group, + Version: rbacv1.SchemeGroupVersion.Version, + Resource: "roles", +} + +// ClusterRoleGroupVersionResource is the required Group Version Resource for accessing clusterroles in a cluster, using the dynamic client. +var ClusterRoleGroupVersionResource = schema.GroupVersionResource{ + Group: rbacv1.SchemeGroupVersion.Group, + Version: rbacv1.SchemeGroupVersion.Version, + Resource: "clusterroles", +} + +// RoleBindingGroupVersionResource is the required Group Version Resource for accessing rolebindings in a cluster, using the dynamic client. +var RoleBindingGroupVersionResource = schema.GroupVersionResource{ + Group: rbacv1.SchemeGroupVersion.Group, + Version: rbacv1.SchemeGroupVersion.Version, + Resource: "rolebindings", +} + +// ClusterRoleBindingGroupVersionResource is the required Group Version Resource for accessing clusterrolebindings in a cluster, using the dynamic client. +var ClusterRoleBindingGroupVersionResource = schema.GroupVersionResource{ + Group: rbacv1.SchemeGroupVersion.Group, + Version: rbacv1.SchemeGroupVersion.Version, + Resource: "clusterrolebindings", +} + +// GlobalRoleGroupVersionResource is the required Group Version Resource for accessing global roles in a rancher server, using the dynamic client. +var GlobalRoleGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "globalroles", +} + +// GlobalRoleBindingGroupVersionResource is the required Group Version Resource for accessing clusterrolebindings in a cluster, using the dynamic client. +var GlobalRoleBindingGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "globalrolebindings", +} + +// ClusterRoleTemplateBindingGroupVersionResource is the required Group Version Resource for accessing clusterrolebindings in a cluster, using the dynamic client. +var ClusterRoleTemplateBindingGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "clusterroletemplatebindings", +} + +// RoleTemplateGroupVersionResource is the required Group Version Resource for accessing roletemplates in a cluster, using the dynamic client. +var RoleTemplateGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "roletemplates", +} + +// ProjectRoleTemplateBindingGroupVersionResource is the required Group Version Resource for accessing projectroletemplatebindings in a cluster, using the dynamic client. +var ProjectRoleTemplateBindingGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "projectroletemplatebindings", +} diff --git a/tests/integration/actions/kubeapi/rbac/update.go b/tests/integration/actions/kubeapi/rbac/update.go new file mode 100644 index 000000000..f5e1c5877 --- /dev/null +++ b/tests/integration/actions/kubeapi/rbac/update.go @@ -0,0 +1,112 @@ +package rbac + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UpdateGlobalRole is a helper function that uses the dynamic client to update a Global Role +func UpdateGlobalRole(client *rancher.Client, updatedGlobalRole *v3.GlobalRole) (*v3.GlobalRole, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + globalRoleResource := dynamicClient.Resource(GlobalRoleGroupVersionResource) + globalRolesUnstructured, err := globalRoleResource.Get(context.TODO(), updatedGlobalRole.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + currentGlobalRole := &v3.GlobalRole{} + err = scheme.Scheme.Convert(globalRolesUnstructured, currentGlobalRole, globalRolesUnstructured.GroupVersionKind()) + if err != nil { + return nil, err + } + + updatedGlobalRole.ObjectMeta.ResourceVersion = currentGlobalRole.ObjectMeta.ResourceVersion + + unstructuredResp, err := globalRoleResource.Update(context.TODO(), unstructured.MustToUnstructured(updatedGlobalRole), metav1.UpdateOptions{}) + if err != nil { + return nil, err + } + + newGlobalRole := &v3.GlobalRole{} + err = scheme.Scheme.Convert(unstructuredResp, newGlobalRole, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newGlobalRole, nil +} + +// UpdateRoleTemplate is a helper function that uses the dynamic client to update an existing cluster role template +func UpdateRoleTemplate(client *rancher.Client, updatedRoleTemplate *v3.RoleTemplate) (*v3.RoleTemplate, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + roleTemplateUnstructured := dynamicClient.Resource(RoleTemplateGroupVersionResource) + roleTemplate, err := roleTemplateUnstructured.Get(context.TODO(), updatedRoleTemplate.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + currentRoleTemplate := &v3.RoleTemplate{} + err = scheme.Scheme.Convert(roleTemplate, currentRoleTemplate, roleTemplate.GroupVersionKind()) + if err != nil { + return nil, err + } + + updatedRoleTemplate.ObjectMeta.ResourceVersion = currentRoleTemplate.ObjectMeta.ResourceVersion + + unstructuredResp, err := roleTemplateUnstructured.Update(context.TODO(), unstructured.MustToUnstructured(updatedRoleTemplate), metav1.UpdateOptions{}) + if err != nil { + return nil, err + } + + newRoleTemplate := &v3.RoleTemplate{} + err = scheme.Scheme.Convert(unstructuredResp, newRoleTemplate, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newRoleTemplate, nil + +} + +// UpdateClusterRoleTemplateBindings is a helper function that uses the dynamic client to update an existing cluster role template binding +func UpdateClusterRoleTemplateBindings(client *rancher.Client, existingCRTB *v3.ClusterRoleTemplateBinding, updatedCRTB *v3.ClusterRoleTemplateBinding) (*v3.ClusterRoleTemplateBinding, error) { + dynamicClient, err := client.GetDownStreamClusterClient(LocalCluster) + if err != nil { + return nil, err + } + crtbUnstructured := dynamicClient.Resource(ClusterRoleTemplateBindingGroupVersionResource).Namespace(existingCRTB.Namespace) + clusterRoleTemplateBinding, err := crtbUnstructured.Get(context.TODO(), existingCRTB.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + currentCRTB := &v3.ClusterRoleTemplateBinding{} + err = scheme.Scheme.Convert(clusterRoleTemplateBinding, currentCRTB, clusterRoleTemplateBinding.GroupVersionKind()) + if err != nil { + return nil, err + } + + updatedCRTB.ObjectMeta.ResourceVersion = currentCRTB.ObjectMeta.ResourceVersion + + unstructuredResp, err := crtbUnstructured.Update(context.TODO(), unstructured.MustToUnstructured(updatedCRTB), metav1.UpdateOptions{}) + if err != nil { + return nil, err + } + + newCRTB := &v3.ClusterRoleTemplateBinding{} + err = scheme.Scheme.Convert(unstructuredResp, newCRTB, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newCRTB, nil + +} diff --git a/tests/integration/actions/kubeapi/resourcequotas/list.go b/tests/integration/actions/kubeapi/resourcequotas/list.go new file mode 100644 index 000000000..188eeb754 --- /dev/null +++ b/tests/integration/actions/kubeapi/resourcequotas/list.go @@ -0,0 +1,43 @@ +package resourcequotas + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ResourceQuotaList is a struct that contains a list of resource quotas. +type ResourceQuotaList struct { + Items []corev1.ResourceQuota +} + +// ListResourceQuotas is a helper function that uses the dynamic client to list resource quotas in a cluster with its list options. +func ListResourceQuotas(client *rancher.Client, clusterID string, namespace string, listOpts metav1.ListOptions) (*ResourceQuotaList, error) { + resourceQuotaList := new(ResourceQuotaList) + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + resourceQuotaResource := dynamicClient.Resource(ResourceQuotaGroupVersionResource).Namespace(namespace) + quotas, err := resourceQuotaResource.List(context.TODO(), listOpts) + if err != nil { + return nil, err + } + + for _, unstructuredQuota := range quotas.Items { + newQuota := &corev1.ResourceQuota{} + err := scheme.Scheme.Convert(&unstructuredQuota, newQuota, unstructuredQuota.GroupVersionKind()) + if err != nil { + return nil, err + } + + resourceQuotaList.Items = append(resourceQuotaList.Items, *newQuota) + } + + return resourceQuotaList, nil +} diff --git a/tests/integration/actions/kubeapi/resourcequotas/resourcequotas.go b/tests/integration/actions/kubeapi/resourcequotas/resourcequotas.go new file mode 100644 index 000000000..dca900bcd --- /dev/null +++ b/tests/integration/actions/kubeapi/resourcequotas/resourcequotas.go @@ -0,0 +1,35 @@ +package resourcequotas + +import ( + "fmt" + + "github.com/rancher/shepherd/clients/rancher" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// ResourceQuotaGroupVersionResource is the required Group Version Resource for accessing resource quotas in a cluster, +// using the dynamic client. +var ResourceQuotaGroupVersionResource = schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "resourcequotas", +} + +// GetResourceQuotaByName is a helper function that returns the resource quota by name in a specific cluster. +func GetResourceQuotaByName(client *rancher.Client, clusterID, name string) (*corev1.ResourceQuota, error) { + resourceQuotaList, err := ListResourceQuotas(client, clusterID, "", metav1.ListOptions{}) + if err != nil { + return nil, err + } + + for i, q := range resourceQuotaList.Items { + if name == q.Name { + quota := &resourceQuotaList.Items[i] + return quota, nil + } + } + + return nil, fmt.Errorf("quota %s not found in %s cluster", name, clusterID) +} diff --git a/tests/integration/actions/kubeapi/secrets/basicAuth.go b/tests/integration/actions/kubeapi/secrets/basicAuth.go new file mode 100644 index 000000000..c98007973 --- /dev/null +++ b/tests/integration/actions/kubeapi/secrets/basicAuth.go @@ -0,0 +1,21 @@ +package secrets + +import ( + coreV1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NewBasicAuthSecret is a constructor for a Basic Auth secret type +func NewBasicAuthSecret(name, namespace, username, password string) *coreV1.Secret { + return &coreV1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + Data: map[string][]byte{ + "username": []byte(username), + "password": []byte(password), + }, + Type: "kubernetes.io/basic-auth", + } +} diff --git a/tests/integration/actions/kubeapi/secrets/create.go b/tests/integration/actions/kubeapi/secrets/create.go new file mode 100644 index 000000000..6a70d7c71 --- /dev/null +++ b/tests/integration/actions/kubeapi/secrets/create.go @@ -0,0 +1,38 @@ +package secrets + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/pkg/api/scheme" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/dynamic" +) + +// CreateSecretForCluster is a helper function that uses the rancher client to create a secret in a namespace for a specific cluster. +func CreateSecretForCluster(client *rancher.Client, secret *corev1.Secret, clusterID, namespace string) (*corev1.Secret, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) + + return CreateSecret(secretResource, secret) +} + +// CreateSecret is a helper function that uses the dynamic client to create a secret in a namespace for a specific cluster. +func CreateSecret(secretResource dynamic.ResourceInterface, secret *corev1.Secret) (*corev1.Secret, error) { + unstructuredResp, err := secretResource.Create(context.TODO(), unstructured.MustToUnstructured(secret), metav1.CreateOptions{}) + if err != nil { + return nil, err + } + + newSecret := &corev1.Secret{} + err = scheme.Scheme.Convert(unstructuredResp, newSecret, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newSecret, nil +} diff --git a/tests/integration/actions/kubeapi/secrets/list.go b/tests/integration/actions/kubeapi/secrets/list.go new file mode 100644 index 000000000..789f75f33 --- /dev/null +++ b/tests/integration/actions/kubeapi/secrets/list.go @@ -0,0 +1,56 @@ +package secrets + +import ( + "context" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// SecretList is a struct that contains a list of secrets. +type SecretList struct { + Items []corev1.Secret +} + +// ListSecrets is a helper function that uses the dynamic client to list secrets in a cluster with its list options. +func ListSecrets(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*SecretList, error) { + secretList := new(SecretList) + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) + secrets, err := secretResource.List(context.TODO(), listOpts) + if err != nil { + return nil, err + } + + for _, unstructuredSecret := range secrets.Items { + newSecret := &corev1.Secret{} + + err := scheme.Scheme.Convert(&unstructuredSecret, newSecret, unstructuredSecret.GroupVersionKind()) + if err != nil { + return nil, err + } + + secretList.Items = append(secretList.Items, *newSecret) + } + + return secretList, nil +} + +// Names is a method that accepts SecretList as a receiver, +// returns each secret name in the list as a new slice of strings. +func (list *SecretList) Names() []string { + var secretNames []string + + for _, secret := range list.Items { + secretNames = append(secretNames, secret.Name) + } + + return secretNames +} diff --git a/tests/integration/actions/kubeapi/secrets/patchsecrets.go b/tests/integration/actions/kubeapi/secrets/patchsecrets.go new file mode 100644 index 000000000..e65370161 --- /dev/null +++ b/tests/integration/actions/kubeapi/secrets/patchsecrets.go @@ -0,0 +1,49 @@ +package secrets + +import ( + "context" + "fmt" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + coreV1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +type PatchOP string + +const ( + AddPatchOP PatchOP = "add" + ReplacePatchOP PatchOP = "replace" + RemovePatchOP PatchOP = "remove" +) + +// PatchSecret is a helper function that uses the dynamic client to patch a secret in a namespace for a specific cluster. +// Different secret operations are supported: add, replace, remove. +func PatchSecret(client *rancher.Client, clusterID, secretName, namespace string, patchType types.PatchType, patchOp PatchOP, patchPath, patchData string, patchOpts metav1.PatchOptions) (*coreV1.Secret, error) { + patchJSONOperation := fmt.Sprintf(` + [ + { "op": "%v", "path": "%v", "value": "%v" } + ] + `, patchOp, patchPath, patchData) + + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) + + unstructuredResp, err := secretResource.Patch(context.TODO(), secretName, patchType, []byte(patchJSONOperation), patchOpts) + if err != nil { + return nil, err + } + + newSecret := &coreV1.Secret{} + err = scheme.Scheme.Convert(unstructuredResp, newSecret, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newSecret, nil +} diff --git a/tests/integration/actions/kubeapi/secrets/secrets.go b/tests/integration/actions/kubeapi/secrets/secrets.go new file mode 100644 index 000000000..2ceae6167 --- /dev/null +++ b/tests/integration/actions/kubeapi/secrets/secrets.go @@ -0,0 +1,42 @@ +package secrets + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/pkg/api/scheme" + coreV1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// SecretGroupVersionResource is the required Group Version Resource for accessing secrets in a cluster, +// using the dynamic client. +var SecretGroupVersionResource = schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "secrets", +} + +// GetSecretByName is a helper function that uses the dynamic client to get a specific secret on a namespace for a specific cluster. +func GetSecretByName(client *rancher.Client, clusterID, namespace, secretName string, getOpts metav1.GetOptions) (*coreV1.Secret, error) { + dynamicClient, err := client.GetDownStreamClusterClient(clusterID) + if err != nil { + return nil, err + } + + secretResource := dynamicClient.Resource(SecretGroupVersionResource).Namespace(namespace) + + unstructuredResp, err := secretResource.Get(context.TODO(), secretName, getOpts) + if err != nil { + return nil, err + } + + newSecret := &coreV1.Secret{} + err = scheme.Scheme.Convert(unstructuredResp, newSecret, unstructuredResp.GroupVersionKind()) + if err != nil { + return nil, err + } + return newSecret, nil +} diff --git a/tests/integration/actions/namespaces/create.go b/tests/integration/actions/namespaces/create.go new file mode 100644 index 000000000..8e59a4586 --- /dev/null +++ b/tests/integration/actions/namespaces/create.go @@ -0,0 +1,150 @@ +package namespaces + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/rancher/steve/tests/integration/actions/kubeapi/namespaces" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + v1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/defaults" + "github.com/rancher/shepherd/pkg/api/scheme" + "github.com/rancher/shepherd/pkg/wait" + + coreV1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kubeUnstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + kwait "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/apimachinery/pkg/watch" +) + +const ( + NamespaceSteveType = "namespace" +) + +// CreateNamespace is a helper function that uses the dynamic client to create a namespace on a project. +// It registers a delete function with a wait.WatchWait to ensure the namspace is deleted cleanly. +func CreateNamespace(client *rancher.Client, namespaceName, containerDefaultResourceLimit string, labels, annotations map[string]string, project *management.Project) (*v1.SteveAPIObject, error) { + if annotations == nil { + annotations = make(map[string]string) + } + if containerDefaultResourceLimit != "" { + annotations["field.cattle.io/containerDefaultResourceLimit"] = containerDefaultResourceLimit + } + if project != nil { + annotations["field.cattle.io/projectId"] = project.ID + } + namespace := &coreV1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: namespaceName, + Annotations: annotations, + Labels: labels, + }, + } + + steveClient, err := client.Steve.ProxyDownstream(project.ClusterID) + if err != nil { + return nil, err + } + + nameSpaceClient := steveClient.SteveType(NamespaceSteveType) + + resp, err := nameSpaceClient.Create(namespace) + if err != nil { + return nil, err + } + + adminClient, err := rancher.NewClient(client.RancherConfig.AdminToken, client.Session) + if err != nil { + return nil, err + } + + adminDynamicClient, err := adminClient.GetDownStreamClusterClient(project.ClusterID) + if err != nil { + return nil, err + } + + clusterRoleResource := adminDynamicClient.Resource(rbacv1.SchemeGroupVersion.WithResource("clusterroles")) + projectID := strings.Split(project.ID, ":")[1] + + clusterRoleWatch, err := clusterRoleResource.Watch(context.TODO(), metav1.ListOptions{ + FieldSelector: "metadata.name=" + fmt.Sprintf("%s-namespaces-edit", projectID), + TimeoutSeconds: &defaults.WatchTimeoutSeconds, + }) + + if err != nil { + return nil, err + } + + err = wait.WatchWait(clusterRoleWatch, func(event watch.Event) (ready bool, err error) { + clusterRole := &rbacv1.ClusterRole{} + err = scheme.Scheme.Convert(event.Object.(*kubeUnstructured.Unstructured), clusterRole, event.Object.(*kubeUnstructured.Unstructured).GroupVersionKind()) + + if err != nil { + return false, err + } + + for _, rule := range clusterRole.Rules { + for _, resourceName := range rule.ResourceNames { + if resourceName == namespaceName { + return true, nil + } + } + } + return false, nil + }) + + if err != nil { + return nil, err + } + + client.Session.RegisterCleanupFunc(func() error { + steveClient, err = client.Steve.ProxyDownstream(project.ClusterID) + if err != nil { + return err + } + + nameSpaceClient = steveClient.SteveType(NamespaceSteveType) + err := nameSpaceClient.Delete(resp) + if errors.IsNotFound(err) { + return nil + } + if err != nil { + return err + } + + adminNamespaceResource := adminDynamicClient.Resource(namespaces.NamespaceGroupVersionResource).Namespace("") + watchInterface, err := adminNamespaceResource.Watch(context.TODO(), metav1.ListOptions{ + FieldSelector: "metadata.name=" + resp.Name, + TimeoutSeconds: &defaults.WatchTimeoutSeconds, + }) + + if err != nil { + return err + } + + return wait.WatchWait(watchInterface, func(event watch.Event) (ready bool, err error) { + if event.Type == watch.Deleted { + return true, nil + } + return false, nil + }) + }) + err = kwait.Poll(300*time.Millisecond, 3*time.Minute, func() (done bool, err error) { + namespaceStatus := &coreV1.NamespaceStatus{} + err = v1.ConvertToK8sType(resp.Status, namespaceStatus) + if err != nil { + return false, err + } + if namespaceStatus.Phase == "Active" { + return true, nil + } + return false, nil + }) + return resp, nil +} diff --git a/tests/integration/actions/secrets/certificates.go b/tests/integration/actions/secrets/certificates.go new file mode 100644 index 000000000..3be80a8e9 --- /dev/null +++ b/tests/integration/actions/secrets/certificates.go @@ -0,0 +1,73 @@ +package secrets + +import ( + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "fmt" + "math/big" + "net" + "time" + + log "github.com/sirupsen/logrus" +) + +const ( + DefaultCommonName = "rancher.test.local" + LocalhostName = "localhost" + LocalhostIP = "127.0.0.1" +) + +// GenerateSelfSignedCert creates a new self-signed certificate and private key +func GenerateSelfSignedCert() (string, string, error) { + log.Info("Generating RSA private key") + privateKey, err := rsa.GenerateKey(rand.Reader, 2048) + if err != nil { + return "", "", fmt.Errorf("failed to generate private key: %w", err) + } + + notBefore := time.Now() + notAfter := notBefore.Add(365 * 24 * time.Hour) + + serialNumber, err := rand.Int(rand.Reader, new(big.Int).Lsh(big.NewInt(1), 128)) + if err != nil { + return "", "", fmt.Errorf("failed to generate serial number: %w", err) + } + + template := x509.Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{ + Organization: []string{"Rancher Test CA"}, + CommonName: DefaultCommonName, + }, + NotBefore: notBefore, + NotAfter: notAfter, + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, + BasicConstraintsValid: true, + IsCA: true, + IPAddresses: []net.IP{net.ParseIP(LocalhostIP)}, + DNSNames: []string{DefaultCommonName, LocalhostName}, + } + + certBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &privateKey.PublicKey, privateKey) + if err != nil { + return "", "", fmt.Errorf("failed to create certificate: %w", err) + } + + certPEM := pem.EncodeToMemory(&pem.Block{ + Type: "CERTIFICATE", + Bytes: certBytes, + }) + + log.Debug("Encoding private key to PEM format") + keyBytes := x509.MarshalPKCS1PrivateKey(privateKey) + keyPEM := pem.EncodeToMemory(&pem.Block{ + Type: "RSA PRIVATE KEY", + Bytes: keyBytes, + }) + + return string(certPEM), string(keyPEM), nil +} diff --git a/tests/integration/actions/secrets/config.go b/tests/integration/actions/secrets/config.go new file mode 100644 index 000000000..501a36c07 --- /dev/null +++ b/tests/integration/actions/secrets/config.go @@ -0,0 +1,11 @@ +package secrets + +const ( + ConfigurationFileKey = "registryInput" +) + +type Config struct { + Name string `yaml:"name" json:"name" default:"quay.io"` + Username string `yaml:"username" json:"username" default:""` + Password string `yaml:"password" json:"password" default:""` +} diff --git a/tests/integration/actions/secrets/secrets.go b/tests/integration/actions/secrets/secrets.go new file mode 100644 index 000000000..d0ad1ee3a --- /dev/null +++ b/tests/integration/actions/secrets/secrets.go @@ -0,0 +1,220 @@ +package secrets + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "reflect" + + clusterapi "github.com/rancher/steve/tests/integration/actions/kubeapi/clusters" + "github.com/rancher/steve/tests/integration/actions/kubeapi/rbac" + secretsapi "github.com/rancher/steve/tests/integration/actions/kubeapi/secrets" + "github.com/rancher/shepherd/clients/rancher" + "github.com/rancher/shepherd/extensions/defaults" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kwait "k8s.io/apimachinery/pkg/util/wait" +) + +const ( + SecretSteveType = "secret" + ProjectScopedSecretLabel = "management.cattle.io/project-scoped-secret" + ProjectScopedSecretCopyAnnotation = "management.cattle.io/project-scoped-secret-copy" +) + +// CreateSecret is a helper to create a secret using wrangler client +func CreateSecret(client *rancher.Client, clusterID, namespaceName string, data map[string][]byte, secretType corev1.SecretType, labels, annotations map[string]string) (*corev1.Secret, error) { + ctx, err := clusterapi.GetClusterWranglerContext(client, clusterID) + if err != nil { + return nil, fmt.Errorf("failed to get cluster context: %w", err) + } + + if labels == nil { + labels = make(map[string]string) + } + if annotations == nil { + annotations = make(map[string]string) + } + + secretName := namegen.AppendRandomString("testsecret") + secretTemplate := NewSecretTemplate(secretName, namespaceName, data, secretType, labels, annotations) + + createdSecret, err := ctx.Core.Secret().Create(&secretTemplate) + if err != nil { + return nil, fmt.Errorf("failed to create secret: %w", err) + } + + return createdSecret, nil +} + +// SecretCopyWithNewData is a helper to create a copy of an existing secret with new data. +func SecretCopyWithNewData(secret *corev1.Secret, newData map[string][]byte) *corev1.Secret { + updatedSecretObj := secret.DeepCopy() + if updatedSecretObj.Data == nil { + updatedSecretObj.Data = make(map[string][]byte) + } + + for key, value := range newData { + updatedSecretObj.Data[key] = value + } + + return updatedSecretObj +} + +// CreateRegistrySecretDockerConfigJSON is a helper to generate dockerconfigjson content for a registry secret +func CreateRegistrySecretDockerConfigJSON(registryconfig *Config) (string, error) { + registry := registryconfig.Name + username := registryconfig.Username + password := registryconfig.Password + + if username == "" || password == "" { + return "", fmt.Errorf("missing registry credentials in the config file") + } + + auth := map[string]interface{}{ + "username": username, + "password": password, + "auth": base64.StdEncoding.EncodeToString([]byte(username + ":" + password)), + } + + config := map[string]interface{}{ + "auths": map[string]interface{}{ + registry: auth, + }, + } + + configJSON, err := json.Marshal(config) + if err != nil { + return "", err + } + + return string(configJSON), nil +} + +// CreateProjectScopedSecret creates a project-scoped secret in the project's backing namespace in the local cluster +func CreateProjectScopedSecret(client *rancher.Client, clusterID, projectID string, data map[string][]byte, secretType corev1.SecretType) (*corev1.Secret, error) { + backingNamespace := fmt.Sprintf("%s-%s", clusterID, projectID) + + labels := map[string]string{ + ProjectScopedSecretLabel: projectID, + } + + createdProjectScopedSecret, err := CreateSecret(client, rbac.LocalCluster, backingNamespace, data, secretType, labels, nil) + if err != nil { + return nil, fmt.Errorf("failed to create project scoped secret: %w", err) + } + + return createdProjectScopedSecret, nil +} + +// ValidatePropagatedNamespaceSecrets verifies that secrets propagated to project namespaces match the original project-scoped secret +func ValidatePropagatedNamespaceSecrets(client *rancher.Client, clusterID, projectID string, projectScopedSecret *corev1.Secret, namespaceList []*corev1.Namespace) error { + return kwait.PollUntilContextTimeout(context.TODO(), defaults.FiveSecondTimeout, defaults.TenSecondTimeout, true, func(ctx context.Context) (bool, error) { + for _, ns := range namespaceList { + nsSecret, err := secretsapi.GetSecretByName(client, clusterID, ns.Name, projectScopedSecret.Name, metav1.GetOptions{}) + if err != nil { + return false, nil + } + + if nsSecret.Labels[ProjectScopedSecretLabel] != projectID { + return false, nil + } + + if nsSecret.Annotations == nil || nsSecret.Annotations[ProjectScopedSecretCopyAnnotation] != "true" { + return false, nil + } + + if !reflect.DeepEqual(projectScopedSecret.Data, nsSecret.Data) { + return false, nil + } + } + return true, nil + }) +} + +// ValidateProjectScopedSecretLabel ensures the project-scoped secret has the correct label +func ValidateProjectScopedSecretLabel(projectScopedSecret *corev1.Secret, expectedProjectID string) error { + actualLabel, labelExists := projectScopedSecret.Labels[ProjectScopedSecretLabel] + if !labelExists || actualLabel != expectedProjectID { + return fmt.Errorf("project scoped secret missing or incorrect label '%s=%s'", ProjectScopedSecretLabel, expectedProjectID) + } + return nil +} + +// UpdateSecretData updates the data of a secret in the specified namespace using the wrangler client +func UpdateSecretData(client *rancher.Client, clusterID, namespace, secretName string, newData map[string][]byte) (*corev1.Secret, error) { + ctx, err := clusterapi.GetClusterWranglerContext(client, clusterID) + if err != nil { + return nil, fmt.Errorf("failed to get cluster context: %w", err) + } + + existingSecret, err := ctx.Core.Secret().Get(namespace, secretName, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to get secret %s: %w", secretName, err) + } + + existingSecret.Data = newData + updatedSecret, err := ctx.Core.Secret().Update(existingSecret) + if err != nil { + return nil, fmt.Errorf("failed to update secret %s: %w", secretName, err) + } + + return updatedSecret, nil +} + +// UpdateProjectScopedSecret updates the data of an project-scoped secret in the backing namespace of a project +func UpdateProjectScopedSecret(client *rancher.Client, clusterID, projectID, secretName string, newData map[string][]byte) (*corev1.Secret, error) { + backingNamespace := fmt.Sprintf("%s-%s", clusterID, projectID) + + updatedProjectScopedSecret, err := UpdateSecretData(client, rbac.LocalCluster, backingNamespace, secretName, newData) + if err != nil { + return nil, fmt.Errorf("failed to update secret %s: %w", secretName, err) + } + + return updatedProjectScopedSecret, nil +} + +// DeleteSecret deletes a secret from a specific namespace in the given cluster using the wrangler client +func DeleteSecret(client *rancher.Client, clusterID, namespaceName, secretName string) error { + ctx, err := clusterapi.GetClusterWranglerContext(client, clusterID) + if err != nil { + return fmt.Errorf("failed to get cluster context: %w", err) + } + + return ctx.Core.Secret().Delete(namespaceName, secretName, &metav1.DeleteOptions{}) +} + +// WaitForSecretInNamespaces waits for a secret to either exist or be deleted in the given list of namespaces. +// If shouldExist is true, it waits for the secret to be present in all namespaces. +// If shouldExist is false, it waits for the secret to be absent from all namespaces. +func WaitForSecretInNamespaces(client *rancher.Client, clusterID, secretName string, namespaceList []*corev1.Namespace, shouldExist bool) error { + for _, ns := range namespaceList { + err := kwait.PollUntilContextTimeout(context.TODO(), defaults.FiveSecondTimeout, defaults.TwoMinuteTimeout, true, func(ctx context.Context) (done bool, err error) { + _, err = secretsapi.GetSecretByName(client, clusterID, ns.Name, secretName, metav1.GetOptions{}) + if shouldExist { + if err != nil { + if apierrors.IsNotFound(err) { + return false, nil + } + return false, err + } + return true, nil + } else { + if err == nil { + return false, nil + } + if apierrors.IsNotFound(err) { + return true, nil + } + return false, err + } + }) + if err != nil { + return fmt.Errorf("waiting for secret %s in namespace %s failed: %w", secretName, ns.Name, err) + } + } + return nil +} diff --git a/tests/integration/actions/secrets/template.go b/tests/integration/actions/secrets/template.go new file mode 100644 index 000000000..02dc2c685 --- /dev/null +++ b/tests/integration/actions/secrets/template.go @@ -0,0 +1,20 @@ +package secrets + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NewSecretTemplate is a constructor that creates the secret template for secrets +func NewSecretTemplate(secretName, namespace string, data map[string][]byte, secretType corev1.SecretType, labels, annotations map[string]string) corev1.Secret { + return corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: secretName, + Namespace: namespace, + Labels: labels, + Annotations: annotations, + }, + Type: secretType, + Data: data, + } +} diff --git a/tests/integration/actions/serviceaccounts/serviceaccounts.go b/tests/integration/actions/serviceaccounts/serviceaccounts.go new file mode 100644 index 000000000..342e44c75 --- /dev/null +++ b/tests/integration/actions/serviceaccounts/serviceaccounts.go @@ -0,0 +1,38 @@ +package serviceaccounts + +import ( + "fmt" + "strings" + "time" + + "github.com/rancher/shepherd/clients/rancher" + kwait "k8s.io/apimachinery/pkg/util/wait" +) + +const ( + ServiceAccountSteveType = "serviceaccount" +) + +func IsServiceAccountReady(rancherClient *rancher.Client, clusterID, namespace, serviceAccountName string) error { + userAccountID := fmt.Sprintf("%s/%s", namespace, serviceAccountName) + steveClient, err := rancherClient.Steve.ProxyDownstream(clusterID) + if err != nil { + return err + } + + err = kwait.Poll(500*time.Millisecond, 2*time.Minute, func() (done bool, err error) { + serviceAccount, err := steveClient.SteveType(ServiceAccountSteveType).ByID(userAccountID) + if err != nil { + if strings.Contains(err.Error(), "Status [404 Not Found]") { + return false, nil + } + return false, err + } else if serviceAccount.State.Name == "active" { + return true, nil + } + + return false, nil + }) + + return err +} diff --git a/tests/integration/setup/README.md b/tests/integration/setup/README.md new file mode 100644 index 000000000..50c62c602 --- /dev/null +++ b/tests/integration/setup/README.md @@ -0,0 +1,99 @@ +# Integration Test Setup + +This program sets up a local environment for running Rancher integration tests. It performs the following actions: + +1. Connects to a local Rancher server instance. +2. Creates a new k3d cluster. +3. Imports the k3d cluster into the Rancher server. +4. Lists the deployments in the imported cluster to verify the connection. + +## Prerequisites + +* [Go](https://golang.org/doc/install) (version 1.24 or higher, see `go.mod` in the root directory) +* Docker +* k3d (v5.8.3 or compatible) + +You can install `k3d` with the following command: +```bash +curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.8.3 bash +``` + +## Running Locally + +### 1. Build Rancher Images (Optional) + +If you are developing Rancher, you should build your own `rancher/rancher` and `rancher/rancher-agent` images. + +To get the correct versions for dependencies, you can source the `export-config` script. You will also need the git commit hash. +```bash +# From the root of the rancher/rancher repository +source ./scripts/export-config +export COMMIT=$(git rev-parse --short HEAD) +export DEV_TAG=dev # or any other tag for your development images +export ARCH=amd64 # or arm64 +export RANCHER_REPO=rancher # or your custom docker repo +``` + +Example build command for the `rancher-agent` image: +```bash +make quick-agent +``` + +Example build command for the `rancher` server image: +```bash +make quick-server +``` + +If you are not actively developing Rancher, you can use pre-existing images from Docker Hub, like `rancher/rancher:stable` and `rancher/rancher-agent:stable`. + +### 2. Start Rancher Server + +Start a Rancher server instance in a Docker container. This program will connect to this server. + +First, determine your machine's primary IP address. This will be used for the `CATTLE_SERVER_URL`. +```bash +export RANCHER_IP=$(ip route get 8.8.8.8 | awk '{print $7}') +echo "Your Rancher IP is: $RANCHER_IP" +``` + +Now, start the Rancher server. Replace `_YOUR_IP_ADDRESS_` with the IP from the previous step. +```bash +# Set the Rancher and Agent image tags you want to test +export RANCHER_IMAGE_TAG=stable # or your custom tag e.g., 'dev' +export RANCHER_AGENT_IMAGE_TAG=stable # or your custom tag e.g., 'dev' + +docker run -d --name rancher-server --restart=unless-stopped \ + -p 80:80 -p 443:443 \ + --privileged \ + -e CATTLE_SERVER_URL="https://_YOUR_IP_ADDRESS_" \ + -e CATTLE_BOOTSTRAP_PASSWORD="admin" \ + -e CATTLE_DEV_MODE="yes" \ + -e CATTLE_AGENT_IMAGE="rancher/rancher-agent:${RANCHER_AGENT_IMAGE_TAG}" \ + rancher/rancher:${RANCHER_IMAGE_TAG} +``` + +Wait a few minutes for Rancher to start up. You can check the logs with `docker logs -f rancher-server`. + +### 3. Build the Setup Binary + +Navigate to this directory and build the program. + +```bash +# From the root of the rancher/rancher repository +cd tests/v2/integration/setup +go build -o setup . +``` + +### 4. Run the Setup Program + +With the Rancher server running, execute the setup binary. Make sure to set the required environment variables. + +```bash +# From the tests/v2/integration/setup directory +export CATTLE_BOOTSTRAP_PASSWORD="admin" +export CATTLE_AGENT_IMAGE="rancher/rancher-agent:stable" # or your custom tag + +./setup +``` + +The program will output the progress of creating and importing the k3d cluster, and finally list the deployments found in the new cluster. \ No newline at end of file diff --git a/tests/integration/setup/main.go b/tests/integration/setup/main.go new file mode 100644 index 000000000..82cea2724 --- /dev/null +++ b/tests/integration/setup/main.go @@ -0,0 +1,108 @@ +// We're protecting this file with a build tag because it depends on github.com/containers/image which depends on C +// libraries that we can't and don't want to build unless we're going to run this integration setup program. + +package main + +import ( + "context" + "fmt" + "net" + "os" + "time" + + "github.com/creasty/defaults" + "github.com/rancher/shepherd/clients/k3d" + rancherClient "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + "github.com/rancher/shepherd/extensions/token" + "github.com/rancher/shepherd/pkg/config" + namegen "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" + "github.com/sirupsen/logrus" + kwait "k8s.io/apimachinery/pkg/util/wait" +) + +var ( + agentImage = os.Getenv("CATTLE_AGENT_IMAGE") + bootstrapPassword = os.Getenv("CATTLE_BOOTSTRAP_PASSWORD") +) + +const ( + k3dClusterNameBasename = "k3d-cluster" +) + +// main creates a test namespace and cluster for use in integration tests. +func main() { + rancherConfig := new(rancherClient.Config) + + ipAddress := getOutboundIP() + hostURL := fmt.Sprintf("%s:443", ipAddress.String()) + + var userToken *management.Token + logrus.Infof("CATTLE AGENT IS %s", agentImage) + logrus.Infof("bootstrap password is %s", bootstrapPassword) + err := kwait.PollUntilContextTimeout(context.TODO(), 500*time.Millisecond, 5*time.Minute, true, func(ctx context.Context) (done bool, err error) { + userToken, err = token.GenerateUserToken(&management.User{ + Username: "admin", + Password: bootstrapPassword, + }, hostURL) + if err != nil { + return false, nil + } + + return true, nil + }) + if err != nil { + logrus.Fatalf("Error with generating admin token: %v", err) + } + + clusterName := namegen.AppendRandomString(k3dClusterNameBasename) + + cleanup := true + insecure := true // Set insecure to true for local testing + rancherConfig.AdminToken = userToken.Token + rancherConfig.Host = hostURL + rancherConfig.Cleanup = &cleanup + rancherConfig.Insecure = &insecure + rancherConfig.ClusterName = clusterName + + if err := defaults.Set(rancherConfig); err != nil { + logrus.Fatalf("error with setting up config file: %v", err) + } + + config.WriteConfig(rancherClient.ConfigurationFileKey, rancherConfig) + + testSession := session.NewSession() + + var client *rancherClient.Client + + // Use NewClientForConfig to pass the config directly instead of loading from file + // This avoids issues with pointer fields like Cleanup not being properly loaded + fmt.Printf("Rancher config: %+v\n", rancherConfig) + fmt.Printf("Test session: %+v\n", testSession) + fmt.Printf("Cluster name: %s\n", clusterName) + fmt.Printf("File path: %s\n", os.Getenv("CATTLE_TEST_CONFIG")) + + client, err = rancherClient.NewClientForConfig("", rancherConfig, testSession) + if err != nil { + logrus.Fatalf("error instantiating client: %v", err) + } + + _, err = k3d.CreateAndImportK3DCluster(client, clusterName, agentImage, "", 1, 0, true) + if err != nil { + logrus.Fatalf("error creating and importing a k3d cluster: %v", err) + } +} + +// Get preferred outbound ip of this machine +func getOutboundIP() net.IP { + conn, err := net.Dial("udp", "8.8.8.8:80") + if err != nil { + logrus.Fatal(err) + } + defer conn.Close() + + localAddr := conn.LocalAddr().(*net.UDPAddr) + + return localAddr.IP +} diff --git a/tests/integration/steveapi/README.md b/tests/integration/steveapi/README.md new file mode 100644 index 000000000..3474525ac --- /dev/null +++ b/tests/integration/steveapi/README.md @@ -0,0 +1,210 @@ +Steve API Integration Tests +=========================== + +This test suite tests the steve resource listing API using secrets as the main +test resource, since they are quick to create. The suite uses three user +scenarios, one user who is a project member, one user who has access to one +namespace in the project, and one user who has access to a few resources in a +few namespaces in the project, in order to demonstrate steve's ability to +collect and return resources across multiple access partitions. There are 25 +sample secrets across 5 namespaces. Some of the sample secrets have labels or +annotations to demonstrate query parameters that use such fields. + +Users +----- + +| User | Access | +|--------|------------------------------------------------------------------------------| +| user-a | Project Owner | +| user-b | get,list for namespace test-ns-1 | +| user-c | get,list for secrets test1,test2 in namespaces test-ns-1,test-ns-2,test-ns-3 | + +Running +------- +Create a `steveapi.yaml` file like the following: + +```yaml +rancher: + host: localhost:8444 + adminToken: token-XXX:YYY +``` + +`adminToken` can be obtained by logging in as the `admin` user into Rancher, then clicking on the user icon (in the top +right corner) -> Account & API Keys -> Create API Key. Choose "No Scope" for the Scope, click Create and copy the Bearer +Token string. + +Then run as a normal go test, from your IDE or via: + +```shell +go test -count=1 -v -run TestSteveLocal +``` + +API examples +------------ + +This table is automatically generated from the output of the integration tests. If you add or update any tests, update this table by: + +1. Run the integration tests locally: + +``` +go test -count=1 -v ./tests/v2/integration/steveapi/ -run TestSteveLocal +``` + +2. Use the [included script](./make-table.sh) to validate the JSON files and update the markdown table: + +``` +cd ./tests/v2/integration/steveapi/ +./make-table.sh +``` + + +user | url | response +---|---|--- +user-a | https://rancherurl/v1/secrets | [json/user-a_none_none.json](json/user-a_none_none.json) +user-a | https://rancherurl/v1/secrets/test-ns-1 | [json/user-a_test-ns-1_none.json](json/user-a_test-ns-1_none.json) +user-a | https://rancherurl/v1/secrets/test-ns-5 | [json/user-a_test-ns-5_none.json](json/user-a_test-ns-5_none.json) +user-a | https://rancherurl/v1/secrets?labelSelector=test-label=2 | [json/user-a_none_labelSelector=test-label=2.json](json/user-a_none_labelSelector=test-label=2.json) +user-a | https://rancherurl/v1/secrets/test-ns-2?labelSelector=test-label=2 | [json/user-a_test-ns-2_labelSelector=test-label=2.json](json/user-a_test-ns-2_labelSelector=test-label=2.json) +user-a | https://rancherurl/v1/secrets?fieldSelector=metadata.namespace=test-ns-1 | [json/user-a_none_fieldSelector=metadata.namespace=test-ns-1.json](json/user-a_none_fieldSelector=metadata.namespace=test-ns-1.json) +user-a | https://rancherurl/v1/secrets?fieldSelector=metadata.name=test1 | [json/user-a_none_fieldSelector=metadata.name=test1.json](json/user-a_none_fieldSelector=metadata.name=test1.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.namespace=test-ns-1 | [json/user-a_test-ns-1_fieldSelector=metadata.namespace=test-ns-1.json](json/user-a_test-ns-1_fieldSelector=metadata.namespace=test-ns-1.json) +user-a | https://rancherurl/v1/secrets/test-ns-2?fieldSelector=metadata.namespace=test-ns-1 | [json/user-a_test-ns-2_fieldSelector=metadata.namespace=test-ns-1.json](json/user-a_test-ns-2_fieldSelector=metadata.namespace=test-ns-1.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.name=test1 | [json/user-a_test-ns-1_fieldSelector=metadata.name=test1.json](json/user-a_test-ns-1_fieldSelector=metadata.name=test1.json) +user-a | https://rancherurl/v1/secrets?limit=8 | [json/user-a_none_limit=8.json](json/user-a_none_limit=8.json) +user-a | https://rancherurl/v1/secrets?limit=8&continue=nondeterministictoken | [json/user-a_none_limit=8&continue=nondeterministictoken.json](json/user-a_none_limit=8&continue=nondeterministictoken.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?limit=3 | [json/user-a_test-ns-1_limit=3.json](json/user-a_test-ns-1_limit=3.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?limit=3&continue=nondeterministictoken | [json/user-a_test-ns-1_limit=3&continue=nondeterministictoken.json](json/user-a_test-ns-1_limit=3&continue=nondeterministictoken.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.name=test1 | [json/user-a_none_filter=metadata.name=test1.json](json/user-a_none_filter=metadata.name=test1.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.name=test6 | [json/user-a_none_filter=metadata.name=test6.json](json/user-a_none_filter=metadata.name=test6.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1 | [json/user-a_test-ns-1_filter=metadata.name=test1.json](json/user-a_test-ns-1_filter=metadata.name=test1.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.name=1,metadata.namespace=1 | [json/user-a_none_filter=metadata.name=1,metadata.namespace=1.json](json/user-a_none_filter=metadata.name=1,metadata.namespace=1.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1 | [json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1.json](json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.name!=1 | [json/user-a_none_filter=metadata.name!=1.json](json/user-a_none_filter=metadata.name!=1.json) +user-a | https://rancherurl/v1/secrets?sort=metadata.name | [json/user-a_none_sort=metadata.name.json](json/user-a_none_sort=metadata.name.json) +user-a | https://rancherurl/v1/secrets?sort=-metadata.name | [json/user-a_none_sort=-metadata.name.json](json/user-a_none_sort=-metadata.name.json) +user-a | https://rancherurl/v1/secrets?sort=metadata.name,metadata.namespace | [json/user-a_none_sort=metadata.name,metadata.namespace.json](json/user-a_none_sort=metadata.name,metadata.namespace.json) +user-a | https://rancherurl/v1/secrets?sort=metadata.name,-metadata.namespace | [json/user-a_none_sort=metadata.name,-metadata.namespace.json](json/user-a_none_sort=metadata.name,-metadata.namespace.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name | [json/user-a_test-ns-1_sort=metadata.name.json](json/user-a_test-ns-1_sort=metadata.name.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?sort=-metadata.name | [json/user-a_test-ns-1_sort=-metadata.name.json](json/user-a_test-ns-1_sort=-metadata.name.json) +user-a | https://rancherurl/v1/secrets?pagesize=8 | [json/user-a_none_pagesize=8.json](json/user-a_none_pagesize=8.json) +user-a | https://rancherurl/v1/secrets?pagesize=8&page=2&revision=nondeterministicint | [json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json](json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?pagesize=3 | [json/user-a_test-ns-1_pagesize=3.json](json/user-a_test-ns-1_pagesize=3.json) +user-a | https://rancherurl/v1/secrets/test-ns-1?pagesize=3&page=2&revision=nondeterministicint | [json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json](json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&limit=20 | [json/user-a_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&limit=20.json](json/user-a_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&limit=20.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=2&revision=nondeterministicint&limit=20 | [json/user-a_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=2&revision=nondeterministicint&limit=20.json](json/user-a_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=2&revision=nondeterministicint&limit=20.json) +user-a | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=1&limit=20&continue=nondeterministictoken | [json/user-a_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=1&limit=20&continue=nondeterministictoken.json](json/user-a_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=1&limit=20&continue=nondeterministictoken.json) +user-b | https://rancherurl/v1/secrets | [json/user-b_none_none.json](json/user-b_none_none.json) +user-b | https://rancherurl/v1/secrets/test-ns-1 | [json/user-b_test-ns-1_none.json](json/user-b_test-ns-1_none.json) +user-b | https://rancherurl/v1/secrets/test-ns-5 | [json/user-b_test-ns-5_none.json](json/user-b_test-ns-5_none.json) +user-b | https://rancherurl/v1/secrets?labelSelector=test-label=2 | [json/user-b_none_labelSelector=test-label=2.json](json/user-b_none_labelSelector=test-label=2.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?labelSelector=test-label=2 | [json/user-b_test-ns-1_labelSelector=test-label=2.json](json/user-b_test-ns-1_labelSelector=test-label=2.json) +user-b | https://rancherurl/v1/secrets/test-ns-2?labelSelector=test-label=2 | [json/user-b_test-ns-2_labelSelector=test-label=2.json](json/user-b_test-ns-2_labelSelector=test-label=2.json) +user-b | https://rancherurl/v1/secrets?fieldSelector=metadata.namespace=test-ns-1 | [json/user-b_none_fieldSelector=metadata.namespace=test-ns-1.json](json/user-b_none_fieldSelector=metadata.namespace=test-ns-1.json) +user-b | https://rancherurl/v1/secrets?fieldSelector=metadata.namespace=test-ns-2 | [json/user-b_none_fieldSelector=metadata.namespace=test-ns-2.json](json/user-b_none_fieldSelector=metadata.namespace=test-ns-2.json) +user-b | https://rancherurl/v1/secrets?fieldSelector=metadata.name=test1 | [json/user-b_none_fieldSelector=metadata.name=test1.json](json/user-b_none_fieldSelector=metadata.name=test1.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.namespace=test-ns-1 | [json/user-b_test-ns-1_fieldSelector=metadata.namespace=test-ns-1.json](json/user-b_test-ns-1_fieldSelector=metadata.namespace=test-ns-1.json) +user-b | https://rancherurl/v1/secrets/test-ns-2?fieldSelector=metadata.namespace=test-ns-1 | [json/user-b_test-ns-2_fieldSelector=metadata.namespace=test-ns-1.json](json/user-b_test-ns-2_fieldSelector=metadata.namespace=test-ns-1.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.namespace=test-ns-2 | [json/user-b_test-ns-1_fieldSelector=metadata.namespace=test-ns-2.json](json/user-b_test-ns-1_fieldSelector=metadata.namespace=test-ns-2.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.name=test1 | [json/user-b_test-ns-1_fieldSelector=metadata.name=test1.json](json/user-b_test-ns-1_fieldSelector=metadata.name=test1.json) +user-b | https://rancherurl/v1/secrets/test-ns-2?fieldSelector=metadata.name=test1 | [json/user-b_test-ns-2_fieldSelector=metadata.name=test1.json](json/user-b_test-ns-2_fieldSelector=metadata.name=test1.json) +user-b | https://rancherurl/v1/secrets?limit=3 | [json/user-b_none_limit=3.json](json/user-b_none_limit=3.json) +user-b | https://rancherurl/v1/secrets?limit=3&continue=nondeterministictoken | [json/user-b_none_limit=3&continue=nondeterministictoken.json](json/user-b_none_limit=3&continue=nondeterministictoken.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?limit=3 | [json/user-b_test-ns-1_limit=3.json](json/user-b_test-ns-1_limit=3.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?limit=3&continue=nondeterministictoken | [json/user-b_test-ns-1_limit=3&continue=nondeterministictoken.json](json/user-b_test-ns-1_limit=3&continue=nondeterministictoken.json) +user-b | https://rancherurl/v1/secrets/test-ns-5?limit=3 | [json/user-b_test-ns-5_limit=3.json](json/user-b_test-ns-5_limit=3.json) +user-b | https://rancherurl/v1/secrets?filter=metadata.name=test1 | [json/user-b_none_filter=metadata.name=test1.json](json/user-b_none_filter=metadata.name=test1.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1 | [json/user-b_test-ns-1_filter=metadata.name=test1.json](json/user-b_test-ns-1_filter=metadata.name=test1.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test6 | [json/user-b_test-ns-1_filter=metadata.name=test6.json](json/user-b_test-ns-1_filter=metadata.name=test6.json) +user-b | https://rancherurl/v1/secrets?filter=metadata.name=1,metadata.namespace=1 | [json/user-b_none_filter=metadata.name=1,metadata.namespace=1.json](json/user-b_none_filter=metadata.name=1,metadata.namespace=1.json) +user-b | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1 | [json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1.json](json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1.json) +user-b | https://rancherurl/v1/secrets?filter=metadata.name!=1 | [json/user-b_none_filter=metadata.name!=1.json](json/user-b_none_filter=metadata.name!=1.json) +user-b | https://rancherurl/v1/secrets?sort=metadata.name | [json/user-b_none_sort=metadata.name.json](json/user-b_none_sort=metadata.name.json) +user-b | https://rancherurl/v1/secrets?sort=-metadata.name | [json/user-b_none_sort=-metadata.name.json](json/user-b_none_sort=-metadata.name.json) +user-b | https://rancherurl/v1/secrets?sort=metadata.name,metadata.namespace | [json/user-b_none_sort=metadata.name,metadata.namespace.json](json/user-b_none_sort=metadata.name,metadata.namespace.json) +user-b | https://rancherurl/v1/secrets?sort=-metadata.name,metadata.namespace | [json/user-b_none_sort=-metadata.name,metadata.namespace.json](json/user-b_none_sort=-metadata.name,metadata.namespace.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name | [json/user-b_test-ns-1_sort=metadata.name.json](json/user-b_test-ns-1_sort=metadata.name.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?sort=-metadata.name | [json/user-b_test-ns-1_sort=-metadata.name.json](json/user-b_test-ns-1_sort=-metadata.name.json) +user-b | https://rancherurl/v1/secrets/test-ns-5?sort=metadata.name | [json/user-b_test-ns-5_sort=metadata.name.json](json/user-b_test-ns-5_sort=metadata.name.json) +user-b | https://rancherurl/v1/secrets?pagesize=3 | [json/user-b_none_pagesize=3.json](json/user-b_none_pagesize=3.json) +user-b | https://rancherurl/v1/secrets?pagesize=3&page=2&revision=nondeterministicint | [json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json](json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?pagesize=3 | [json/user-b_test-ns-1_pagesize=3.json](json/user-b_test-ns-1_pagesize=3.json) +user-b | https://rancherurl/v1/secrets/test-ns-1?pagesize=3&page=2&revision=nondeterministicint | [json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json](json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json) +user-b | https://rancherurl/v1/secrets/test-ns-5?pagesize=3 | [json/user-b_test-ns-5_pagesize=3.json](json/user-b_test-ns-5_pagesize=3.json) +user-b | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2 | [json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json](json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json) +user-b | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint | [json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json](json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json) +user-c | https://rancherurl/v1/secrets | [json/user-c_none_none.json](json/user-c_none_none.json) +user-c | https://rancherurl/v1/secrets/test-ns-1 | [json/user-c_test-ns-1_none.json](json/user-c_test-ns-1_none.json) +user-c | https://rancherurl/v1/secrets/test-ns-5 | [json/user-c_test-ns-5_none.json](json/user-c_test-ns-5_none.json) +user-c | https://rancherurl/v1/secrets?labelSelector=test-label=2 | [json/user-c_none_labelSelector=test-label=2.json](json/user-c_none_labelSelector=test-label=2.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?labelSelector=test-label=2 | [json/user-c_test-ns-1_labelSelector=test-label=2.json](json/user-c_test-ns-1_labelSelector=test-label=2.json) +user-c | https://rancherurl/v1/secrets/test-ns-5?labelSelector=test-label=2 | [json/user-c_test-ns-5_labelSelector=test-label=2.json](json/user-c_test-ns-5_labelSelector=test-label=2.json) +user-c | https://rancherurl/v1/secrets?fieldSelector=metadata.namespace=test-ns-1 | [json/user-c_none_fieldSelector=metadata.namespace=test-ns-1.json](json/user-c_none_fieldSelector=metadata.namespace=test-ns-1.json) +user-c | https://rancherurl/v1/secrets?fieldSelector=metadata.namespace=test-ns-2 | [json/user-c_none_fieldSelector=metadata.namespace=test-ns-2.json](json/user-c_none_fieldSelector=metadata.namespace=test-ns-2.json) +user-c | https://rancherurl/v1/secrets?fieldSelector=metadata.namespace=test-ns-5 | [json/user-c_none_fieldSelector=metadata.namespace=test-ns-5.json](json/user-c_none_fieldSelector=metadata.namespace=test-ns-5.json) +user-c | https://rancherurl/v1/secrets?fieldSelector=metadata.name=test1 | [json/user-c_none_fieldSelector=metadata.name=test1.json](json/user-c_none_fieldSelector=metadata.name=test1.json) +user-c | https://rancherurl/v1/secrets?fieldSelector=metadata.name=test5 | [json/user-c_none_fieldSelector=metadata.name=test5.json](json/user-c_none_fieldSelector=metadata.name=test5.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.namespace=test-ns-1 | [json/user-c_test-ns-1_fieldSelector=metadata.namespace=test-ns-1.json](json/user-c_test-ns-1_fieldSelector=metadata.namespace=test-ns-1.json) +user-c | https://rancherurl/v1/secrets/test-ns-2?fieldSelector=metadata.namespace=test-ns-1 | [json/user-c_test-ns-2_fieldSelector=metadata.namespace=test-ns-1.json](json/user-c_test-ns-2_fieldSelector=metadata.namespace=test-ns-1.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.namespace=test-ns-2 | [json/user-c_test-ns-1_fieldSelector=metadata.namespace=test-ns-2.json](json/user-c_test-ns-1_fieldSelector=metadata.namespace=test-ns-2.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.name=test1 | [json/user-c_test-ns-1_fieldSelector=metadata.name=test1.json](json/user-c_test-ns-1_fieldSelector=metadata.name=test1.json) +user-c | https://rancherurl/v1/secrets/test-ns-5?fieldSelector=metadata.name=test1 | [json/user-c_test-ns-5_fieldSelector=metadata.name=test1.json](json/user-c_test-ns-5_fieldSelector=metadata.name=test1.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?fieldSelector=metadata.name=test5 | [json/user-c_test-ns-1_fieldSelector=metadata.name=test5.json](json/user-c_test-ns-1_fieldSelector=metadata.name=test5.json) +user-c | https://rancherurl/v1/secrets?limit=3 | [json/user-c_none_limit=3.json](json/user-c_none_limit=3.json) +user-c | https://rancherurl/v1/secrets?limit=3&continue=nondeterministictoken | [json/user-c_none_limit=3&continue=nondeterministictoken.json](json/user-c_none_limit=3&continue=nondeterministictoken.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?limit=3 | [json/user-c_test-ns-1_limit=3.json](json/user-c_test-ns-1_limit=3.json) +user-c | https://rancherurl/v1/secrets/test-ns-5?limit=3 | [json/user-c_test-ns-5_limit=3.json](json/user-c_test-ns-5_limit=3.json) +user-c | https://rancherurl/v1/secrets?filter=metadata.name=test1 | [json/user-c_none_filter=metadata.name=test1.json](json/user-c_none_filter=metadata.name=test1.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1 | [json/user-c_test-ns-1_filter=metadata.name=test1.json](json/user-c_test-ns-1_filter=metadata.name=test1.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test3 | [json/user-c_test-ns-1_filter=metadata.name=test3.json](json/user-c_test-ns-1_filter=metadata.name=test3.json) +user-c | https://rancherurl/v1/secrets?filter=metadata.name=1,metadata.namespace=1 | [json/user-c_none_filter=metadata.name=1,metadata.namespace=1.json](json/user-c_none_filter=metadata.name=1,metadata.namespace=1.json) +user-c | https://rancherurl/v1/secrets?filter=metadata.name!=test1 | [json/user-c_none_filter=metadata.name!=test1.json](json/user-c_none_filter=metadata.name!=test1.json) +user-c | https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1 | [json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1.json](json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=1.json) +user-c | https://rancherurl/v1/secrets?sort=metadata.name | [json/user-c_none_sort=metadata.name.json](json/user-c_none_sort=metadata.name.json) +user-c | https://rancherurl/v1/secrets?sort=-metadata.name | [json/user-c_none_sort=-metadata.name.json](json/user-c_none_sort=-metadata.name.json) +user-c | https://rancherurl/v1/secrets?sort=metadata.name,metadata.namespace | [json/user-c_none_sort=metadata.name,metadata.namespace.json](json/user-c_none_sort=metadata.name,metadata.namespace.json) +user-c | https://rancherurl/v1/secrets?sort=metadata.name,-metadata.namespace | [json/user-c_none_sort=metadata.name,-metadata.namespace.json](json/user-c_none_sort=metadata.name,-metadata.namespace.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name | [json/user-c_test-ns-1_sort=metadata.name.json](json/user-c_test-ns-1_sort=metadata.name.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?sort=-metadata.name | [json/user-c_test-ns-1_sort=-metadata.name.json](json/user-c_test-ns-1_sort=-metadata.name.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,metadata.namespace | [json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json](json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,-metadata.namespace | [json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json](json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json) +user-c | https://rancherurl/v1/secrets/test-ns-5?sort=metadata.name | [json/user-c_test-ns-5_sort=metadata.name.json](json/user-c_test-ns-5_sort=metadata.name.json) +user-c | https://rancherurl/v1/secrets?pagesize=3 | [json/user-c_none_pagesize=3.json](json/user-c_none_pagesize=3.json) +user-c | https://rancherurl/v1/secrets?pagesize=3&page=2&revision=nondeterministicint | [json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json](json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json) +user-c | https://rancherurl/v1/secrets/test-ns-1?pagesize=3 | [json/user-c_test-ns-1_pagesize=3.json](json/user-c_test-ns-1_pagesize=3.json) +user-c | https://rancherurl/v1/secrets/test-ns-5?pagesize=3 | [json/user-c_test-ns-5_pagesize=3.json](json/user-c_test-ns-5_pagesize=3.json) +user-c | https://rancherurl/v1/secrets?filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1 | [json/user-c_none_filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1.json](json/user-c_none_filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1.json) +user-c | https://rancherurl/v1/secrets?filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint | [json/user-c_none_filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json](json/user-c_none_filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json) +user-d | https://rancherurl/v1/secrets | [json/user-d_none_none.json](json/user-d_none_none.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2 | [json/user-d_none_projectsornamespaces=test-prj-2.json](json/user-d_none_projectsornamespaces=test-prj-2.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces=test-prj-1,test-prj-2 | [json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json](json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1 | [json/user-d_none_projectsornamespaces=test-ns-1.json](json/user-d_none_projectsornamespaces=test-ns-1.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1,test-ns-2 | [json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json](json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2,test-ns-2,test-ns-3 | [json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json](json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces=test-ns-8,test-ns-9 | [json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json](json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1 | [json/user-d_none_projectsornamespaces!=test-prj-1.json](json/user-d_none_projectsornamespaces!=test-prj-1.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-prj-2 | [json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json) +user-d | https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8 | [json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json](json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json) +user-d | https://rancherurl/v1/secrets/test-ns-6 | [json/user-d_test-ns-6_none.json](json/user-d_test-ns-6_none.json) +user-d | https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-2 | [json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json](json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json) +user-d | https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-1 | [json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json](json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json) +user-d | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7 | [json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json](json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json) +user-d | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1 | [json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json](json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json) +user-d | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,test-prj-2 | [json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json) +user-e | https://rancherurl/v1/secrets | [json/user-e_none_none.json](json/user-e_none_none.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2 | [json/user-e_none_projectsornamespaces=test-prj-2.json](json/user-e_none_projectsornamespaces=test-prj-2.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces=test-prj-1,test-prj-2 | [json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json](json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1 | [json/user-e_none_projectsornamespaces=test-ns-1.json](json/user-e_none_projectsornamespaces=test-ns-1.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1,test-ns-2 | [json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json](json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2,test-ns-2,test-ns-3 | [json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json](json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces=test-ns-8,test-ns-9 | [json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json](json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1 | [json/user-e_none_projectsornamespaces!=test-prj-1.json](json/user-e_none_projectsornamespaces!=test-prj-1.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-prj-2 | [json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json) +user-e | https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8 | [json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json](json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json) +user-e | https://rancherurl/v1/secrets/test-ns-6 | [json/user-e_test-ns-6_none.json](json/user-e_test-ns-6_none.json) +user-e | https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-2 | [json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json](json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json) +user-e | https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-1 | [json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json](json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json) +user-e | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7 | [json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json](json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json) +user-e | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1 | [json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json](json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json) +user-e | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,test-prj-2 | [json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json) +user-e | https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8 | [json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json](json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json) + diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..504390fe8 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,147 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..57d83a1f6 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,180 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.name!=test1.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.name!=test1.json new file mode 100644 index 000000000..e82a5d03c --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.name!=test1.json @@ -0,0 +1,678 @@ +{ + "actions": {}, + "count": 20, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..bc7ba5453 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json @@ -0,0 +1,307 @@ +{ + "actions": {}, + "count": 9, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1.json new file mode 100644 index 000000000..5665f11e9 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test1.json @@ -0,0 +1,175 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test6.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test6.json new file mode 100644 index 000000000..181d40495 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.name=test6.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-a_none_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..29908b565 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_none.json b/tests/integration/steveapi/json/user-a_none_none.json new file mode 100644 index 000000000..80f24557d --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_none.json @@ -0,0 +1,838 @@ +{ + "actions": {}, + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..734027dcd --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json @@ -0,0 +1,286 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets", + "next": "https://rancherurl/v1/secrets?continue=nondeterministictoken\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026page=2\u0026pagesize=8\u0026revision=nondeterministicint", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_pagesize=8.json b/tests/integration/steveapi/json/user-a_none_pagesize=8.json new file mode 100644 index 000000000..5037fe2da --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_pagesize=8.json @@ -0,0 +1,283 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets", + "next": "https://rancherurl/v1/secrets?continue=nondeterministictoken\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=8", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_sort=-metadata.name.json b/tests/integration/steveapi/json/user-a_none_sort=-metadata.name.json new file mode 100644 index 000000000..f921e2613 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_sort=-metadata.name.json @@ -0,0 +1,838 @@ +{ + "actions": {}, + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_sort=metadata.name,-metadata.namespace.json b/tests/integration/steveapi/json/user-a_none_sort=metadata.name,-metadata.namespace.json new file mode 100644 index 000000000..65221474f --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_sort=metadata.name,-metadata.namespace.json @@ -0,0 +1,838 @@ +{ + "actions": {}, + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_sort=metadata.name,metadata.namespace.json b/tests/integration/steveapi/json/user-a_none_sort=metadata.name,metadata.namespace.json new file mode 100644 index 000000000..94f7bb0f7 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_sort=metadata.name,metadata.namespace.json @@ -0,0 +1,838 @@ +{ + "actions": {}, + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_none_sort=metadata.name.json b/tests/integration/steveapi/json/user-a_none_sort=metadata.name.json new file mode 100644 index 000000000..94f7bb0f7 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_none_sort=metadata.name.json @@ -0,0 +1,838 @@ +{ + "actions": {}, + "count": 25, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.name=test1.json new file mode 100644 index 000000000..b7d893ef3 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.name=test1.json @@ -0,0 +1,47 @@ +{ + "actions": {}, + "count": 1, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..853cf972a --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_none.json b/tests/integration/steveapi/json/user-a_test-ns-1_none.json new file mode 100644 index 000000000..853cf972a --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_none.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..418b77cf0 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json @@ -0,0 +1,81 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3.json b/tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3.json new file mode 100644 index 000000000..a313f3627 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_pagesize=3.json @@ -0,0 +1,119 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets/test-ns-1", + "next": "https://rancherurl/v1/secrets/test-ns-1?continue=nondeterministictoken\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=3", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_sort=-metadata.name.json b/tests/integration/steveapi/json/user-a_test-ns-1_sort=-metadata.name.json new file mode 100644 index 000000000..87d225c78 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_sort=-metadata.name.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-1_sort=metadata.name.json b/tests/integration/steveapi/json/user-a_test-ns-1_sort=metadata.name.json new file mode 100644 index 000000000..853cf972a --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-1_sort=metadata.name.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=potatoes.json b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=potatoes.json new file mode 100644 index 000000000..af9d66590 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=potatoes.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=spuds.json b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=spuds.json new file mode 100644 index 000000000..6aa97bd77 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=spuds.json @@ -0,0 +1,51 @@ +{ + "actions": {}, + "count": 1, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..ff602ac31 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,48 @@ +{ + "actions": {}, + "count": 1, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..af9d66590 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-2_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-a_test-ns-5_none.json b/tests/integration/steveapi/json/user-a_test-ns-5_none.json new file mode 100644 index 000000000..3c1fd6230 --- /dev/null +++ b/tests/integration/steveapi/json/user-a_test-ns-5_none.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..3caadc1ba --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json @@ -0,0 +1,42 @@ +{ + "actions": {}, + "count": 3, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json new file mode 100644 index 000000000..b2cd75042 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json @@ -0,0 +1,78 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 3, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets", + "next": "https://rancherurl/v1/secrets?continue=nondeterministictoken\u0026filter=metadata.labels.test-label-gte%3D3\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=2\u0026sort=-metadata.name", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..892864881 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,132 @@ +{ + "actions": {}, + "count": 4, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..444947d1a --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,42 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.name!=test1.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.name!=test1.json new file mode 100644 index 000000000..892864881 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.name!=test1.json @@ -0,0 +1,132 @@ +{ + "actions": {}, + "count": 4, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..8b3f44535 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1.json new file mode 100644 index 000000000..978213329 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.name=test1.json @@ -0,0 +1,41 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..8b3f44535 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-2.json b/tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-2.json new file mode 100644 index 000000000..fc66adfa2 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_filter=metadata.namespace~test-ns-2.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_none.json b/tests/integration/steveapi/json/user-b_none_none.json new file mode 100644 index 000000000..8b3f44535 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_none.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..6e325da75 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json @@ -0,0 +1,72 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_pagesize=3.json b/tests/integration/steveapi/json/user-b_none_pagesize=3.json new file mode 100644 index 000000000..3111c6296 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_pagesize=3.json @@ -0,0 +1,107 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets", + "next": "https://rancherurl/v1/secrets?continue=nondeterministictoken\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=3", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_sort=-metadata.name,metadata.namespace.json b/tests/integration/steveapi/json/user-b_none_sort=-metadata.name,metadata.namespace.json new file mode 100644 index 000000000..54e505841 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_sort=-metadata.name,metadata.namespace.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_sort=-metadata.name.json b/tests/integration/steveapi/json/user-b_none_sort=-metadata.name.json new file mode 100644 index 000000000..54e505841 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_sort=-metadata.name.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_sort=metadata.name,metadata.namespace.json b/tests/integration/steveapi/json/user-b_none_sort=metadata.name,metadata.namespace.json new file mode 100644 index 000000000..8b3f44535 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_sort=metadata.name,metadata.namespace.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_none_sort=metadata.name.json b/tests/integration/steveapi/json/user-b_none_sort=metadata.name.json new file mode 100644 index 000000000..8b3f44535 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_none_sort=metadata.name.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..9b8b7d440 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,42 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test1.json new file mode 100644 index 000000000..8c01a09df --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test1.json @@ -0,0 +1,41 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test6.json b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test6.json new file mode 100644 index 000000000..06d94f7e7 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.name=test6.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..f0722edbf --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-2.json b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-2.json new file mode 100644 index 000000000..06d94f7e7 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_filter=metadata.namespace~test-ns-2.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_none.json b/tests/integration/steveapi/json/user-b_test-ns-1_none.json new file mode 100644 index 000000000..f0722edbf --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_none.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..6fc64b5b0 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json @@ -0,0 +1,72 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3.json b/tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3.json new file mode 100644 index 000000000..de0194ad7 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_pagesize=3.json @@ -0,0 +1,107 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets/test-ns-1", + "next": "https://rancherurl/v1/secrets/test-ns-1?continue=nondeterministictoken\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=3", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_sort=-metadata.name.json b/tests/integration/steveapi/json/user-b_test-ns-1_sort=-metadata.name.json new file mode 100644 index 000000000..cb65fd22f --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_sort=-metadata.name.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-1_sort=metadata.name.json b/tests/integration/steveapi/json/user-b_test-ns-1_sort=metadata.name.json new file mode 100644 index 000000000..f0722edbf --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-1_sort=metadata.name.json @@ -0,0 +1,161 @@ +{ + "actions": {}, + "count": 5, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..8b634ea25 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.name=test1.json new file mode 100644 index 000000000..8b634ea25 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.name=test1.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..8b634ea25 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-2_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-5_none.json b/tests/integration/steveapi/json/user-b_test-ns-5_none.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-5_none.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-5_pagesize=3.json b/tests/integration/steveapi/json/user-b_test-ns-5_pagesize=3.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-5_pagesize=3.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-b_test-ns-5_sort=metadata.name.json b/tests/integration/steveapi/json/user-b_test-ns-5_sort=metadata.name.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-b_test-ns-5_sort=metadata.name.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..444947d1a --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,42 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..4b616b45d --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,102 @@ +{ + "actions": {}, + "count": 3, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.name!=test1.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.name!=test1.json new file mode 100644 index 000000000..4b616b45d --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.name!=test1.json @@ -0,0 +1,102 @@ +{ + "actions": {}, + "count": 3, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..94d6342a5 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json @@ -0,0 +1,129 @@ +{ + "actions": {}, + "count": 4, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1.json new file mode 100644 index 000000000..5af060674 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test1.json @@ -0,0 +1,99 @@ +{ + "actions": {}, + "count": 3, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test5.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test5.json new file mode 100644 index 000000000..fc66adfa2 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.name=test5.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..4e3878ba5 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-2.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-2.json new file mode 100644 index 000000000..9a2f8321e --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-2.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..d214255fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json @@ -0,0 +1,41 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1.json new file mode 100644 index 000000000..3ff20e81c --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1.json @@ -0,0 +1,48 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets", + "next": "https://rancherurl/v1/secrets?continue=nondeterministictoken\u0026filter=metadata.namespace~test-ns-3\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=1\u0026sort=-metadata.name", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-5.json b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-5.json new file mode 100644 index 000000000..fc66adfa2 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_filter=metadata.namespace~test-ns-5.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_none.json b/tests/integration/steveapi/json/user-c_none_none.json new file mode 100644 index 000000000..90b318a3c --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_none.json @@ -0,0 +1,189 @@ +{ + "actions": {}, + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json b/tests/integration/steveapi/json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json new file mode 100644 index 000000000..572425347 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json @@ -0,0 +1,101 @@ +{ + "actions": {}, + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_pagesize=3.json b/tests/integration/steveapi/json/user-c_none_pagesize=3.json new file mode 100644 index 000000000..763d1a139 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_pagesize=3.json @@ -0,0 +1,106 @@ +{ + "actions": {}, + "continue": "nondeterministictoken", + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "pagination": { + "first": "https://rancherurl/v1/secrets", + "next": "https://rancherurl/v1/secrets?continue=nondeterministictoken\u0026filter=metadata.labels%5Btest.cattle.io%2Fsteveapi%5D~MYTAG\u0026pagesize=3", + "partial": true + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_sort=-metadata.name.json b/tests/integration/steveapi/json/user-c_none_sort=-metadata.name.json new file mode 100644 index 000000000..ef637c409 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_sort=-metadata.name.json @@ -0,0 +1,189 @@ +{ + "actions": {}, + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_sort=metadata.name,-metadata.namespace.json b/tests/integration/steveapi/json/user-c_none_sort=metadata.name,-metadata.namespace.json new file mode 100644 index 000000000..a2306802c --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_sort=metadata.name,-metadata.namespace.json @@ -0,0 +1,189 @@ +{ + "actions": {}, + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_sort=metadata.name,metadata.namespace.json b/tests/integration/steveapi/json/user-c_none_sort=metadata.name,metadata.namespace.json new file mode 100644 index 000000000..f4ca8941c --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_sort=metadata.name,metadata.namespace.json @@ -0,0 +1,189 @@ +{ + "actions": {}, + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_none_sort=metadata.name.json b/tests/integration/steveapi/json/user-c_none_sort=metadata.name.json new file mode 100644 index 000000000..f4ca8941c --- /dev/null +++ b/tests/integration/steveapi/json/user-c_none_sort=metadata.name.json @@ -0,0 +1,189 @@ +{ + "actions": {}, + "count": 6, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..9b8b7d440 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,42 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test1.json new file mode 100644 index 000000000..8c01a09df --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test1.json @@ -0,0 +1,41 @@ +{ + "actions": {}, + "count": 1, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test3.json b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test3.json new file mode 100644 index 000000000..06d94f7e7 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test3.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test5.json b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test5.json new file mode 100644 index 000000000..06d94f7e7 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.name=test5.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..a7ddf61fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-2.json b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-2.json new file mode 100644 index 000000000..06d94f7e7 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_filter=metadata.namespace~test-ns-2.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_none.json b/tests/integration/steveapi/json/user-c_test-ns-1_none.json new file mode 100644 index 000000000..a7ddf61fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_none.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_pagesize=3.json b/tests/integration/steveapi/json/user-c_test-ns-1_pagesize=3.json new file mode 100644 index 000000000..a7ddf61fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_pagesize=3.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_sort=-metadata.name.json b/tests/integration/steveapi/json/user-c_test-ns-1_sort=-metadata.name.json new file mode 100644 index 000000000..aca6691b7 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_sort=-metadata.name.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json b/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json new file mode 100644 index 000000000..a7ddf61fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json b/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json new file mode 100644 index 000000000..a7ddf61fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name.json b/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name.json new file mode 100644 index 000000000..a7ddf61fa --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-1_sort=metadata.name.json @@ -0,0 +1,71 @@ +{ + "actions": {}, + "count": 2, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-2_filter=metadata.namespace~test-ns-1.json b/tests/integration/steveapi/json/user-c_test-ns-2_filter=metadata.namespace~test-ns-1.json new file mode 100644 index 000000000..8b634ea25 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-2_filter=metadata.namespace~test-ns-1.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-2" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.labels[test-label]=2.json b/tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.labels[test-label]=2.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.labels[test-label]=2.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.name=test1.json b/tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.name=test1.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-5_filter=metadata.name=test1.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-5_none.json b/tests/integration/steveapi/json/user-c_test-ns-5_none.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-5_none.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-5_pagesize=3.json b/tests/integration/steveapi/json/user-c_test-ns-5_pagesize=3.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-5_pagesize=3.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-c_test-ns-5_sort=metadata.name.json b/tests/integration/steveapi/json/user-c_test-ns-5_sort=metadata.name.json new file mode 100644 index 000000000..53fc39255 --- /dev/null +++ b/tests/integration/steveapi/json/user-c_test-ns-5_sort=metadata.name.json @@ -0,0 +1,9 @@ +{ + "actions": {}, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-5" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_none.json b/tests/integration/steveapi/json/user-d_none_none.json new file mode 100644 index 000000000..24db034a7 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_none.json @@ -0,0 +1,1086 @@ +{ + "actions": {}, + "count": 33, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json new file mode 100644 index 000000000..933e7db0a --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json @@ -0,0 +1,139 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json new file mode 100644 index 000000000..a0355d977 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json @@ -0,0 +1,133 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1.json new file mode 100644 index 000000000..c0a12692e --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces!=test-prj-1.json @@ -0,0 +1,263 @@ +{ + "actions": {}, + "count": 8, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json new file mode 100644 index 000000000..423eca82d --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json @@ -0,0 +1,346 @@ +{ + "actions": {}, + "count": 10, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1.json new file mode 100644 index 000000000..29908b565 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-1.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json new file mode 100644 index 000000000..a0355d977 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json @@ -0,0 +1,133 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json new file mode 100644 index 000000000..b06f3188e --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json @@ -0,0 +1,968 @@ +{ + "actions": {}, + "count": 29, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json new file mode 100644 index 000000000..d4e102706 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json @@ -0,0 +1,476 @@ +{ + "actions": {}, + "count": 14, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2.json b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2.json new file mode 100644 index 000000000..3837eca26 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_none_projectsornamespaces=test-prj-2.json @@ -0,0 +1,145 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json b/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json new file mode 100644 index 000000000..a9a034b09 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json b/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json new file mode 100644 index 000000000..a9a034b09 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json b/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json new file mode 100644 index 000000000..853cf972a --- /dev/null +++ b/tests/integration/steveapi/json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_test-ns-6_none.json b/tests/integration/steveapi/json/user-d_test-ns-6_none.json new file mode 100644 index 000000000..987066c79 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_test-ns-6_none.json @@ -0,0 +1,80 @@ +{ + "actions": {}, + "count": 2, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-6" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json b/tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json new file mode 100644 index 000000000..f2c9598fd --- /dev/null +++ b/tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-6" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json b/tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json new file mode 100644 index 000000000..987066c79 --- /dev/null +++ b/tests/integration/steveapi/json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json @@ -0,0 +1,80 @@ +{ + "actions": {}, + "count": 2, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-6" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_none.json b/tests/integration/steveapi/json/user-e_none_none.json new file mode 100644 index 000000000..8f8e45595 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_none.json @@ -0,0 +1,1098 @@ +{ + "actions": {}, + "count": 33, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test1", + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "update": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test2", + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "update": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test1", + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "update": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test2", + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "update": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json new file mode 100644 index 000000000..0872c5988 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json @@ -0,0 +1,145 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test1", + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "update": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test2", + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "update": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json new file mode 100644 index 000000000..c7265d01d --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json @@ -0,0 +1,145 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test1", + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "update": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test2", + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "update": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test1", + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "update": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test2", + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "update": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1.json new file mode 100644 index 000000000..6d1ecc8c0 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces!=test-prj-1.json @@ -0,0 +1,275 @@ +{ + "actions": {}, + "count": 8, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test1", + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "update": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test2", + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "update": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test1", + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "update": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test2", + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "update": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json new file mode 100644 index 000000000..423eca82d --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json @@ -0,0 +1,346 @@ +{ + "actions": {}, + "count": 10, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1.json new file mode 100644 index 000000000..29908b565 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-1.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json new file mode 100644 index 000000000..c7265d01d --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json @@ -0,0 +1,145 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test1", + "self": "https://rancherurl/v1/secrets/test-ns-8/test1", + "update": "https://rancherurl/v1/secrets/test-ns-8/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-8/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-8/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-8/test2", + "self": "https://rancherurl/v1/secrets/test-ns-8/test2", + "update": "https://rancherurl/v1/secrets/test-ns-8/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-8/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-8", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test1", + "self": "https://rancherurl/v1/secrets/test-ns-9/test1", + "update": "https://rancherurl/v1/secrets/test-ns-9/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-9/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-9/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-9/test2", + "self": "https://rancherurl/v1/secrets/test-ns-9/test2", + "update": "https://rancherurl/v1/secrets/test-ns-9/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-9/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-9", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json new file mode 100644 index 000000000..b06f3188e --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json @@ -0,0 +1,968 @@ +{ + "actions": {}, + "count": 29, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test1", + "self": "https://rancherurl/v1/secrets/test-ns-4/test1", + "update": "https://rancherurl/v1/secrets/test-ns-4/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test2", + "self": "https://rancherurl/v1/secrets/test-ns-4/test2", + "update": "https://rancherurl/v1/secrets/test-ns-4/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test3", + "self": "https://rancherurl/v1/secrets/test-ns-4/test3", + "update": "https://rancherurl/v1/secrets/test-ns-4/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test4", + "self": "https://rancherurl/v1/secrets/test-ns-4/test4", + "update": "https://rancherurl/v1/secrets/test-ns-4/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-4/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-4/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-4/test5", + "self": "https://rancherurl/v1/secrets/test-ns-4/test5", + "update": "https://rancherurl/v1/secrets/test-ns-4/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-4/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-4", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test1", + "self": "https://rancherurl/v1/secrets/test-ns-5/test1", + "update": "https://rancherurl/v1/secrets/test-ns-5/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test2", + "self": "https://rancherurl/v1/secrets/test-ns-5/test2", + "update": "https://rancherurl/v1/secrets/test-ns-5/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test3", + "self": "https://rancherurl/v1/secrets/test-ns-5/test3", + "update": "https://rancherurl/v1/secrets/test-ns-5/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test4", + "self": "https://rancherurl/v1/secrets/test-ns-5/test4", + "update": "https://rancherurl/v1/secrets/test-ns-5/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-5/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-5/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-5/test5", + "self": "https://rancherurl/v1/secrets/test-ns-5/test5", + "update": "https://rancherurl/v1/secrets/test-ns-5/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-5/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-5", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json new file mode 100644 index 000000000..d4e102706 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json @@ -0,0 +1,476 @@ +{ + "actions": {}, + "count": 14, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test1", + "self": "https://rancherurl/v1/secrets/test-ns-2/test1", + "update": "https://rancherurl/v1/secrets/test-ns-2/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test2", + "self": "https://rancherurl/v1/secrets/test-ns-2/test2", + "update": "https://rancherurl/v1/secrets/test-ns-2/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test3", + "self": "https://rancherurl/v1/secrets/test-ns-2/test3", + "update": "https://rancherurl/v1/secrets/test-ns-2/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test4", + "self": "https://rancherurl/v1/secrets/test-ns-2/test4", + "update": "https://rancherurl/v1/secrets/test-ns-2/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test4" + }, + "metadata": { + "annotations": { + "management.cattle.io/project-scoped-secret-copy": "spuds" + }, + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-2/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-2/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-2/test5", + "self": "https://rancherurl/v1/secrets/test-ns-2/test5", + "update": "https://rancherurl/v1/secrets/test-ns-2/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-2/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-2", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test1", + "self": "https://rancherurl/v1/secrets/test-ns-3/test1", + "update": "https://rancherurl/v1/secrets/test-ns-3/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test2", + "self": "https://rancherurl/v1/secrets/test-ns-3/test2", + "update": "https://rancherurl/v1/secrets/test-ns-3/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test3", + "self": "https://rancherurl/v1/secrets/test-ns-3/test3", + "update": "https://rancherurl/v1/secrets/test-ns-3/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test4", + "self": "https://rancherurl/v1/secrets/test-ns-3/test4", + "update": "https://rancherurl/v1/secrets/test-ns-3/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-3/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-3/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-3/test5", + "self": "https://rancherurl/v1/secrets/test-ns-3/test5", + "update": "https://rancherurl/v1/secrets/test-ns-3/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-3/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-3", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2.json b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2.json new file mode 100644 index 000000000..3837eca26 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_none_projectsornamespaces=test-prj-2.json @@ -0,0 +1,145 @@ +{ + "actions": {}, + "count": 4, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test1", + "self": "https://rancherurl/v1/secrets/test-ns-7/test1", + "update": "https://rancherurl/v1/secrets/test-ns-7/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-7/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-7/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-7/test2", + "self": "https://rancherurl/v1/secrets/test-ns-7/test2", + "update": "https://rancherurl/v1/secrets/test-ns-7/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-7/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-7", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json new file mode 100644 index 000000000..a9a034b09 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json new file mode 100644 index 000000000..a9a034b09 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json new file mode 100644 index 000000000..a9a034b09 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json new file mode 100644 index 000000000..853cf972a --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json @@ -0,0 +1,179 @@ +{ + "actions": {}, + "count": 5, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test1", + "self": "https://rancherurl/v1/secrets/test-ns-1/test1", + "update": "https://rancherurl/v1/secrets/test-ns-1/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test2", + "self": "https://rancherurl/v1/secrets/test-ns-1/test2", + "update": "https://rancherurl/v1/secrets/test-ns-1/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test3", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test3", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test3", + "self": "https://rancherurl/v1/secrets/test-ns-1/test3", + "update": "https://rancherurl/v1/secrets/test-ns-1/test3", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test3" + }, + "metadata": { + "fields": [ + "test3", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test3", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test4", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test4", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test4", + "self": "https://rancherurl/v1/secrets/test-ns-1/test4", + "update": "https://rancherurl/v1/secrets/test-ns-1/test4", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test4" + }, + "metadata": { + "fields": [ + "test4", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test4", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-1/test5", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-1/test5", + "remove": "https://rancherurl/v1/secrets/test-ns-1/test5", + "self": "https://rancherurl/v1/secrets/test-ns-1/test5", + "update": "https://rancherurl/v1/secrets/test-ns-1/test5", + "view": "https://rancherurl/api/v1/namespaces/test-ns-1/secrets/test5" + }, + "metadata": { + "fields": [ + "test5", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label-gte": "3", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test5", + "namespace": "test-ns-1", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-1" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-6_none.json b/tests/integration/steveapi/json/user-e_test-ns-6_none.json new file mode 100644 index 000000000..987066c79 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-6_none.json @@ -0,0 +1,80 @@ +{ + "actions": {}, + "count": 2, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-6" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json b/tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json new file mode 100644 index 000000000..f2c9598fd --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json @@ -0,0 +1,12 @@ +{ + "actions": {}, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-6" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json b/tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json new file mode 100644 index 000000000..987066c79 --- /dev/null +++ b/tests/integration/steveapi/json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json @@ -0,0 +1,80 @@ +{ + "actions": {}, + "count": 2, + "createTypes": { + "secret": "https://rancherurl/v1/secrets" + }, + "data": [ + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test1", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test1", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test1", + "self": "https://rancherurl/v1/secrets/test-ns-6/test1", + "update": "https://rancherurl/v1/secrets/test-ns-6/test1", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test1" + }, + "metadata": { + "fields": [ + "test1", + "Opaque", + 0, + "0s" + ], + "labels": { + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test1", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + }, + { + "actions": null, + "apiVersion": "v1", + "id": "test-ns-6/test2", + "kind": "Secret", + "links": { + "patch": "https://rancherurl/v1/secrets/test-ns-6/test2", + "remove": "https://rancherurl/v1/secrets/test-ns-6/test2", + "self": "https://rancherurl/v1/secrets/test-ns-6/test2", + "update": "https://rancherurl/v1/secrets/test-ns-6/test2", + "view": "https://rancherurl/api/v1/namespaces/test-ns-6/secrets/test2" + }, + "metadata": { + "fields": [ + "test2", + "Opaque", + 0, + "0s" + ], + "labels": { + "test-label": "2", + "test.cattle.io/steveapi": "nondeterministicid" + }, + "name": "test2", + "namespace": "test-ns-6", + "resourceVersion": "1000", + "state": { + "message": "Resource is always ready", + "name": "active" + } + }, + "type": "secret" + } + ], + "links": { + "self": "https://rancherurl/v1/secrets/test-ns-6" + }, + "resourceType": "secret", + "revision": "100", + "type": "collection" +} \ No newline at end of file diff --git a/tests/integration/steveapi/make-table.sh b/tests/integration/steveapi/make-table.sh new file mode 100755 index 000000000..c0ab08321 --- /dev/null +++ b/tests/integration/steveapi/make-table.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +command -v csv2md >/dev/null || { echo "Install csv2md with 'npm install -g csv2md'"; exit 1; } +command -v jq >/dev/null || { echo "Install jq"; exit 1; } + +for j in json/* ; do + jq . $j >/dev/null + if [ $? -ne 0 ] ; then + echo "INVALID JSON IN FILE $j" + exit 1 + fi +done + +sed -i -e '/INSERT TABLE HERE/q' README.md +csv2md output.csv >> README.md diff --git a/tests/integration/steveapi/output.csv b/tests/integration/steveapi/output.csv new file mode 100644 index 000000000..22f86b9e3 --- /dev/null +++ b/tests/integration/steveapi/output.csv @@ -0,0 +1,134 @@ +user,url,response +user-a,https://rancherurl/v1/secrets,[json/user-a_none_none.json](json/user-a_none_none.json) +user-a,https://rancherurl/v1/secrets/test-ns-1,[json/user-a_test-ns-1_none.json](json/user-a_test-ns-1_none.json) +user-a,https://rancherurl/v1/secrets/test-ns-5,[json/user-a_test-ns-5_none.json](json/user-a_test-ns-5_none.json) +user-a,https://rancherurl/v1/secrets?filter=metadata.labels[test-label]=2,[json/user-a_none_filter=metadata.labels[test-label]=2.json](json/user-a_none_filter=metadata.labels[test-label]=2.json) +user-a,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.labels[test-label]=2,[json/user-a_test-ns-2_filter=metadata.labels[test-label]=2.json](json/user-a_test-ns-2_filter=metadata.labels[test-label]=2.json) +user-a,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-1,[json/user-a_none_filter=metadata.namespace~test-ns-1.json](json/user-a_none_filter=metadata.namespace~test-ns-1.json) +user-a,https://rancherurl/v1/secrets?filter=metadata.name=test1,[json/user-a_none_filter=metadata.name=test1.json](json/user-a_none_filter=metadata.name=test1.json) +user-a,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.namespace~test-ns-1,[json/user-a_test-ns-1_filter=metadata.namespace~test-ns-1.json](json/user-a_test-ns-1_filter=metadata.namespace~test-ns-1.json) +user-a,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.namespace~test-ns-1,[json/user-a_test-ns-2_filter=metadata.namespace~test-ns-1.json](json/user-a_test-ns-2_filter=metadata.namespace~test-ns-1.json) +user-a,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1,[json/user-a_test-ns-1_filter=metadata.name=test1.json](json/user-a_test-ns-1_filter=metadata.name=test1.json) +user-a,https://rancherurl/v1/secrets?filter=metadata.name=test1,[json/user-a_none_filter=metadata.name=test1.json](json/user-a_none_filter=metadata.name=test1.json) +user-a,https://rancherurl/v1/secrets?filter=metadata.name=test6,[json/user-a_none_filter=metadata.name=test6.json](json/user-a_none_filter=metadata.name=test6.json) +user-a,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1,[json/user-a_test-ns-1_filter=metadata.name=test1.json](json/user-a_test-ns-1_filter=metadata.name=test1.json) +user-a,"https://rancherurl/v1/secrets?filter=metadata.name=test1,metadata.namespace~test-ns-1","[json/user-a_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json](json/user-a_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json)" +user-a,"https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1","[json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json](json/user-a_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json)" +user-a,https://rancherurl/v1/secrets?filter=metadata.name!=test1,[json/user-a_none_filter=metadata.name!=test1.json](json/user-a_none_filter=metadata.name!=test1.json) +user-a,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.annotations[management.cattle.io/project-scoped-secret-copy]=spuds,[json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=spuds.json](json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=spuds.json) +user-a,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.annotations[management.cattle.io/project-scoped-secret-copy]=potatoes,[json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=potatoes.json](json/user-a_test-ns-2_filter=metadata.annotations[management.cattle.io%2Fproject-scoped-secret-copy]=potatoes.json) +user-a,https://rancherurl/v1/secrets?sort=metadata.name,[json/user-a_none_sort=metadata.name.json](json/user-a_none_sort=metadata.name.json) +user-a,https://rancherurl/v1/secrets?sort=-metadata.name,[json/user-a_none_sort=-metadata.name.json](json/user-a_none_sort=-metadata.name.json) +user-a,"https://rancherurl/v1/secrets?sort=metadata.name,metadata.namespace","[json/user-a_none_sort=metadata.name,metadata.namespace.json](json/user-a_none_sort=metadata.name,metadata.namespace.json)" +user-a,"https://rancherurl/v1/secrets?sort=metadata.name,-metadata.namespace","[json/user-a_none_sort=metadata.name,-metadata.namespace.json](json/user-a_none_sort=metadata.name,-metadata.namespace.json)" +user-a,https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,[json/user-a_test-ns-1_sort=metadata.name.json](json/user-a_test-ns-1_sort=metadata.name.json) +user-a,https://rancherurl/v1/secrets/test-ns-1?sort=-metadata.name,[json/user-a_test-ns-1_sort=-metadata.name.json](json/user-a_test-ns-1_sort=-metadata.name.json) +user-a,https://rancherurl/v1/secrets?pagesize=8,[json/user-a_none_pagesize=8.json](json/user-a_none_pagesize=8.json) +user-a,https://rancherurl/v1/secrets?pagesize=8&page=2&revision=nondeterministicint,[json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json](json/user-a_none_pagesize=8&page=2&revision=nondeterministicint.json) +user-a,https://rancherurl/v1/secrets/test-ns-1?pagesize=3,[json/user-a_test-ns-1_pagesize=3.json](json/user-a_test-ns-1_pagesize=3.json) +user-a,https://rancherurl/v1/secrets/test-ns-1?pagesize=3&page=2&revision=nondeterministicint,[json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json](json/user-a_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json) +user-b,https://rancherurl/v1/secrets,[json/user-b_none_none.json](json/user-b_none_none.json) +user-b,https://rancherurl/v1/secrets/test-ns-1,[json/user-b_test-ns-1_none.json](json/user-b_test-ns-1_none.json) +user-b,https://rancherurl/v1/secrets/test-ns-5,[json/user-b_test-ns-5_none.json](json/user-b_test-ns-5_none.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.labels[test-label]=2,[json/user-b_none_filter=metadata.labels[test-label]=2.json](json/user-b_none_filter=metadata.labels[test-label]=2.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.labels[test-label]=2,[json/user-b_test-ns-1_filter=metadata.labels[test-label]=2.json](json/user-b_test-ns-1_filter=metadata.labels[test-label]=2.json) +user-b,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.labels[test-label]=2,[json/user-b_test-ns-2_filter=metadata.labels[test-label]=2.json](json/user-b_test-ns-2_filter=metadata.labels[test-label]=2.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-1,[json/user-b_none_filter=metadata.namespace~test-ns-1.json](json/user-b_none_filter=metadata.namespace~test-ns-1.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-2,[json/user-b_none_filter=metadata.namespace~test-ns-2.json](json/user-b_none_filter=metadata.namespace~test-ns-2.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.name=test1,[json/user-b_none_filter=metadata.name=test1.json](json/user-b_none_filter=metadata.name=test1.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.namespace~test-ns-1,[json/user-b_test-ns-1_filter=metadata.namespace~test-ns-1.json](json/user-b_test-ns-1_filter=metadata.namespace~test-ns-1.json) +user-b,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.namespace~test-ns-1,[json/user-b_test-ns-2_filter=metadata.namespace~test-ns-1.json](json/user-b_test-ns-2_filter=metadata.namespace~test-ns-1.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.namespace~test-ns-2,[json/user-b_test-ns-1_filter=metadata.namespace~test-ns-2.json](json/user-b_test-ns-1_filter=metadata.namespace~test-ns-2.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1,[json/user-b_test-ns-1_filter=metadata.name=test1.json](json/user-b_test-ns-1_filter=metadata.name=test1.json) +user-b,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.name=test1,[json/user-b_test-ns-2_filter=metadata.name=test1.json](json/user-b_test-ns-2_filter=metadata.name=test1.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.name=test1,[json/user-b_none_filter=metadata.name=test1.json](json/user-b_none_filter=metadata.name=test1.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1,[json/user-b_test-ns-1_filter=metadata.name=test1.json](json/user-b_test-ns-1_filter=metadata.name=test1.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test6,[json/user-b_test-ns-1_filter=metadata.name=test6.json](json/user-b_test-ns-1_filter=metadata.name=test6.json) +user-b,"https://rancherurl/v1/secrets?filter=metadata.name=test1,metadata.namespace~test-ns-1","[json/user-b_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json](json/user-b_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json)" +user-b,"https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1","[json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json](json/user-b_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json)" +user-b,https://rancherurl/v1/secrets?filter=metadata.name!=test1,[json/user-b_none_filter=metadata.name!=test1.json](json/user-b_none_filter=metadata.name!=test1.json) +user-b,https://rancherurl/v1/secrets?sort=metadata.name,[json/user-b_none_sort=metadata.name.json](json/user-b_none_sort=metadata.name.json) +user-b,https://rancherurl/v1/secrets?sort=-metadata.name,[json/user-b_none_sort=-metadata.name.json](json/user-b_none_sort=-metadata.name.json) +user-b,"https://rancherurl/v1/secrets?sort=metadata.name,metadata.namespace","[json/user-b_none_sort=metadata.name,metadata.namespace.json](json/user-b_none_sort=metadata.name,metadata.namespace.json)" +user-b,"https://rancherurl/v1/secrets?sort=-metadata.name,metadata.namespace","[json/user-b_none_sort=-metadata.name,metadata.namespace.json](json/user-b_none_sort=-metadata.name,metadata.namespace.json)" +user-b,https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,[json/user-b_test-ns-1_sort=metadata.name.json](json/user-b_test-ns-1_sort=metadata.name.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?sort=-metadata.name,[json/user-b_test-ns-1_sort=-metadata.name.json](json/user-b_test-ns-1_sort=-metadata.name.json) +user-b,https://rancherurl/v1/secrets/test-ns-5?sort=metadata.name,[json/user-b_test-ns-5_sort=metadata.name.json](json/user-b_test-ns-5_sort=metadata.name.json) +user-b,https://rancherurl/v1/secrets?pagesize=3,[json/user-b_none_pagesize=3.json](json/user-b_none_pagesize=3.json) +user-b,https://rancherurl/v1/secrets?pagesize=3&page=2&revision=nondeterministicint,[json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json](json/user-b_none_pagesize=3&page=2&revision=nondeterministicint.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?pagesize=3,[json/user-b_test-ns-1_pagesize=3.json](json/user-b_test-ns-1_pagesize=3.json) +user-b,https://rancherurl/v1/secrets/test-ns-1?pagesize=3&page=2&revision=nondeterministicint,[json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json](json/user-b_test-ns-1_pagesize=3&page=2&revision=nondeterministicint.json) +user-b,https://rancherurl/v1/secrets/test-ns-5?pagesize=3,[json/user-b_test-ns-5_pagesize=3.json](json/user-b_test-ns-5_pagesize=3.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2,[json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json](json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2.json) +user-b,https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint,[json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json](json/user-b_none_filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=nondeterministicint.json) +user-c,https://rancherurl/v1/secrets,[json/user-c_none_none.json](json/user-c_none_none.json) +user-c,https://rancherurl/v1/secrets/test-ns-1,[json/user-c_test-ns-1_none.json](json/user-c_test-ns-1_none.json) +user-c,https://rancherurl/v1/secrets/test-ns-5,[json/user-c_test-ns-5_none.json](json/user-c_test-ns-5_none.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.labels[test-label]=2,[json/user-c_none_filter=metadata.labels[test-label]=2.json](json/user-c_none_filter=metadata.labels[test-label]=2.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.labels[test-label]=2,[json/user-c_test-ns-1_filter=metadata.labels[test-label]=2.json](json/user-c_test-ns-1_filter=metadata.labels[test-label]=2.json) +user-c,https://rancherurl/v1/secrets/test-ns-5?filter=metadata.labels[test-label]=2,[json/user-c_test-ns-5_filter=metadata.labels[test-label]=2.json](json/user-c_test-ns-5_filter=metadata.labels[test-label]=2.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-1,[json/user-c_none_filter=metadata.namespace~test-ns-1.json](json/user-c_none_filter=metadata.namespace~test-ns-1.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-2,[json/user-c_none_filter=metadata.namespace~test-ns-2.json](json/user-c_none_filter=metadata.namespace~test-ns-2.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-5,[json/user-c_none_filter=metadata.namespace~test-ns-5.json](json/user-c_none_filter=metadata.namespace~test-ns-5.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.name=test1,[json/user-c_none_filter=metadata.name=test1.json](json/user-c_none_filter=metadata.name=test1.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.name=test5,[json/user-c_none_filter=metadata.name=test5.json](json/user-c_none_filter=metadata.name=test5.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.namespace~test-ns-1,[json/user-c_test-ns-1_filter=metadata.namespace~test-ns-1.json](json/user-c_test-ns-1_filter=metadata.namespace~test-ns-1.json) +user-c,https://rancherurl/v1/secrets/test-ns-2?filter=metadata.namespace~test-ns-1,[json/user-c_test-ns-2_filter=metadata.namespace~test-ns-1.json](json/user-c_test-ns-2_filter=metadata.namespace~test-ns-1.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.namespace~test-ns-2,[json/user-c_test-ns-1_filter=metadata.namespace~test-ns-2.json](json/user-c_test-ns-1_filter=metadata.namespace~test-ns-2.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1,[json/user-c_test-ns-1_filter=metadata.name=test1.json](json/user-c_test-ns-1_filter=metadata.name=test1.json) +user-c,https://rancherurl/v1/secrets/test-ns-5?filter=metadata.name=test1,[json/user-c_test-ns-5_filter=metadata.name=test1.json](json/user-c_test-ns-5_filter=metadata.name=test1.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test5,[json/user-c_test-ns-1_filter=metadata.name=test5.json](json/user-c_test-ns-1_filter=metadata.name=test5.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.name=test1,[json/user-c_none_filter=metadata.name=test1.json](json/user-c_none_filter=metadata.name=test1.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test1,[json/user-c_test-ns-1_filter=metadata.name=test1.json](json/user-c_test-ns-1_filter=metadata.name=test1.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?filter=metadata.name=test3,[json/user-c_test-ns-1_filter=metadata.name=test3.json](json/user-c_test-ns-1_filter=metadata.name=test3.json) +user-c,"https://rancherurl/v1/secrets?filter=metadata.name=test1,metadata.namespace~test-ns-1","[json/user-c_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json](json/user-c_none_filter=metadata.name=test1,metadata.namespace~test-ns-1.json)" +user-c,https://rancherurl/v1/secrets?filter=metadata.name!=test1,[json/user-c_none_filter=metadata.name!=test1.json](json/user-c_none_filter=metadata.name!=test1.json) +user-c,"https://rancherurl/v1/secrets?filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1","[json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json](json/user-c_none_filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace~test-ns-1.json)" +user-c,https://rancherurl/v1/secrets?sort=metadata.name,[json/user-c_none_sort=metadata.name.json](json/user-c_none_sort=metadata.name.json) +user-c,https://rancherurl/v1/secrets?sort=-metadata.name,[json/user-c_none_sort=-metadata.name.json](json/user-c_none_sort=-metadata.name.json) +user-c,"https://rancherurl/v1/secrets?sort=metadata.name,metadata.namespace","[json/user-c_none_sort=metadata.name,metadata.namespace.json](json/user-c_none_sort=metadata.name,metadata.namespace.json)" +user-c,"https://rancherurl/v1/secrets?sort=metadata.name,-metadata.namespace","[json/user-c_none_sort=metadata.name,-metadata.namespace.json](json/user-c_none_sort=metadata.name,-metadata.namespace.json)" +user-c,https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,[json/user-c_test-ns-1_sort=metadata.name.json](json/user-c_test-ns-1_sort=metadata.name.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?sort=-metadata.name,[json/user-c_test-ns-1_sort=-metadata.name.json](json/user-c_test-ns-1_sort=-metadata.name.json) +user-c,"https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,metadata.namespace","[json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json](json/user-c_test-ns-1_sort=metadata.name,metadata.namespace.json)" +user-c,"https://rancherurl/v1/secrets/test-ns-1?sort=metadata.name,-metadata.namespace","[json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json](json/user-c_test-ns-1_sort=metadata.name,-metadata.namespace.json)" +user-c,https://rancherurl/v1/secrets/test-ns-5?sort=metadata.name,[json/user-c_test-ns-5_sort=metadata.name.json](json/user-c_test-ns-5_sort=metadata.name.json) +user-c,https://rancherurl/v1/secrets?pagesize=3,[json/user-c_none_pagesize=3.json](json/user-c_none_pagesize=3.json) +user-c,https://rancherurl/v1/secrets?pagesize=3&page=2&revision=nondeterministicint,[json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json](json/user-c_none_pagesize=3&page=2&revision=nondeterministicint.json) +user-c,https://rancherurl/v1/secrets/test-ns-1?pagesize=3,[json/user-c_test-ns-1_pagesize=3.json](json/user-c_test-ns-1_pagesize=3.json) +user-c,https://rancherurl/v1/secrets/test-ns-5?pagesize=3,[json/user-c_test-ns-5_pagesize=3.json](json/user-c_test-ns-5_pagesize=3.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1,[json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1.json](json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1.json) +user-c,https://rancherurl/v1/secrets?filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint,[json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json](json/user-c_none_filter=metadata.namespace~test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=nondeterministicint.json) +user-d,https://rancherurl/v1/secrets,[json/user-d_none_none.json](json/user-d_none_none.json) +user-d,https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2,[json/user-d_none_projectsornamespaces=test-prj-2.json](json/user-d_none_projectsornamespaces=test-prj-2.json) +user-d,"https://rancherurl/v1/secrets?projectsornamespaces=test-prj-1,test-prj-2","[json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json](json/user-d_none_projectsornamespaces=test-prj-1,test-prj-2.json)" +user-d,https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1,[json/user-d_none_projectsornamespaces=test-ns-1.json](json/user-d_none_projectsornamespaces=test-ns-1.json) +user-d,"https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1,test-ns-2","[json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json](json/user-d_none_projectsornamespaces=test-ns-1,test-ns-2.json)" +user-d,"https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2,test-ns-2,test-ns-3","[json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json](json/user-d_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json)" +user-d,"https://rancherurl/v1/secrets?projectsornamespaces=test-ns-8,test-ns-9","[json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json](json/user-d_none_projectsornamespaces=test-ns-8,test-ns-9.json)" +user-d,https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,[json/user-d_none_projectsornamespaces!=test-prj-1.json](json/user-d_none_projectsornamespaces!=test-prj-1.json) +user-d,"https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-prj-2","[json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-d_none_projectsornamespaces!=test-prj-1,test-prj-2.json)" +user-d,"https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8","[json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json](json/user-d_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json)" +user-d,https://rancherurl/v1/secrets/test-ns-6,[json/user-d_test-ns-6_none.json](json/user-d_test-ns-6_none.json) +user-d,https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-2,[json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json](json/user-d_test-ns-6_projectsornamespaces=test-prj-2.json) +user-d,https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-1,[json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json](json/user-d_test-ns-6_projectsornamespaces=test-prj-1.json) +user-d,"https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7","[json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json](json/user-d_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json)" +user-d,https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,[json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json](json/user-d_test-ns-1_projectsornamespaces!=test-prj-1.json) +user-d,"https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,test-prj-2","[json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-d_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json)" +user-e,https://rancherurl/v1/secrets,[json/user-e_none_none.json](json/user-e_none_none.json) +user-e,https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2,[json/user-e_none_projectsornamespaces=test-prj-2.json](json/user-e_none_projectsornamespaces=test-prj-2.json) +user-e,"https://rancherurl/v1/secrets?projectsornamespaces=test-prj-1,test-prj-2","[json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json](json/user-e_none_projectsornamespaces=test-prj-1,test-prj-2.json)" +user-e,https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1,[json/user-e_none_projectsornamespaces=test-ns-1.json](json/user-e_none_projectsornamespaces=test-ns-1.json) +user-e,"https://rancherurl/v1/secrets?projectsornamespaces=test-ns-1,test-ns-2","[json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json](json/user-e_none_projectsornamespaces=test-ns-1,test-ns-2.json)" +user-e,"https://rancherurl/v1/secrets?projectsornamespaces=test-prj-2,test-ns-2,test-ns-3","[json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json](json/user-e_none_projectsornamespaces=test-prj-2,test-ns-2,test-ns-3.json)" +user-e,"https://rancherurl/v1/secrets?projectsornamespaces=test-ns-8,test-ns-9","[json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json](json/user-e_none_projectsornamespaces=test-ns-8,test-ns-9.json)" +user-e,https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,[json/user-e_none_projectsornamespaces!=test-prj-1.json](json/user-e_none_projectsornamespaces!=test-prj-1.json) +user-e,"https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-prj-2","[json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-e_none_projectsornamespaces!=test-prj-1,test-prj-2.json)" +user-e,"https://rancherurl/v1/secrets?projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8","[json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json](json/user-e_none_projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8.json)" +user-e,https://rancherurl/v1/secrets/test-ns-6,[json/user-e_test-ns-6_none.json](json/user-e_test-ns-6_none.json) +user-e,https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-2,[json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json](json/user-e_test-ns-6_projectsornamespaces=test-prj-2.json) +user-e,https://rancherurl/v1/secrets/test-ns-6?projectsornamespaces=test-prj-1,[json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json](json/user-e_test-ns-6_projectsornamespaces=test-prj-1.json) +user-e,"https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7","[json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json](json/user-e_test-ns-1_projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7.json)" +user-e,https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,[json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json](json/user-e_test-ns-1_projectsornamespaces!=test-prj-1.json) +user-e,"https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,test-prj-2","[json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json](json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-prj-2.json)" +user-e,"https://rancherurl/v1/secrets/test-ns-1?projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8","[json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json](json/user-e_test-ns-1_projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8.json)" diff --git a/tests/integration/steveapi/steve_api_test.go b/tests/integration/steveapi/steve_api_test.go new file mode 100644 index 000000000..47aa5a215 --- /dev/null +++ b/tests/integration/steveapi/steve_api_test.go @@ -0,0 +1,3275 @@ +package steveapi + +import ( + "bufio" + "bytes" + "context" + "encoding/csv" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path/filepath" + "regexp" + "slices" + "strings" + "testing" + "time" + + extv1 "github.com/rancher/rancher/pkg/apis/ext.cattle.io/v1" + "github.com/rancher/shepherd/clients/rancher" + management "github.com/rancher/shepherd/clients/rancher/generated/management/v3" + clientv1 "github.com/rancher/shepherd/clients/rancher/v1" + "github.com/rancher/shepherd/extensions/clusters" + "github.com/rancher/shepherd/extensions/unstructured" + "github.com/rancher/shepherd/extensions/users" + password "github.com/rancher/shepherd/extensions/users/passwordgenerator" + "github.com/rancher/shepherd/pkg/config" + "github.com/rancher/shepherd/pkg/namegenerator" + "github.com/rancher/shepherd/pkg/session" + kubenamespaces "github.com/rancher/steve/tests/integration/actions/kubeapi/namespaces" + "github.com/rancher/steve/tests/integration/actions/kubeapi/rbac" + "github.com/rancher/steve/tests/integration/actions/kubeapi/secrets" + stevesecrets "github.com/rancher/steve/tests/integration/actions/secrets" + "github.com/rancher/steve/tests/integration/actions/serviceaccounts" + + "github.com/rancher/steve/tests/integration/actions/namespaces" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + corev1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/discovery" + "k8s.io/client-go/rest" + "k8s.io/client-go/util/retry" + + v1 "k8s.io/api/core/v1" +) + +const ( + labelKey = "test-label" + labelGTEKey = "test-label-gte" + continueToken = "nondeterministictoken" + revisionNum = "nondeterministicint" + fakeTestID = "nondeterministicid" + defautlUrlString = "https://rancherurl/" + steveAPITestLabel = "test.cattle.io/steveapi" +) + +var ( + testID = namegenerator.RandStringLower(5) + userEnabled = true + impersonationNamespace = "cattle-impersonation-system" + impersonationSABase = "cattle-impersonation-" + urlRegex = regexp.MustCompile(`https://([\w.:]+)/`) + continueReg = regexp.MustCompile(`(continue=)[\w]+(%3D){0,2}`) + revisionReg = regexp.MustCompile(`(revision=)[\d]+`) + testLabelReg = regexp.MustCompile(`(labelSelector=test.cattle.io%2Fsteveapi%3D)[\w]+`) + projectTag = regexp.MustCompile(`(test-prj-[1-9])`) + namespaceTag = regexp.MustCompile(`(test-ns-[1-9])`) + namespaceSecretManagerRole = rbacv1.Role{ + ObjectMeta: metav1.ObjectMeta{ + Name: "namespace-secret-manager", + }, + Rules: []rbacv1.PolicyRule{ + { + Verbs: []string{ + "get", + "list", + }, + APIGroups: []string{ + "", + }, + Resources: []string{ + "secrets", + }, + }, + }, + } + mixedSecretUserRole = rbacv1.Role{ + ObjectMeta: metav1.ObjectMeta{ + Name: "mixed-secret-user", + }, + Rules: []rbacv1.PolicyRule{ + { + Verbs: []string{ + "get", + "list", + }, + APIGroups: []string{ + "", + }, + Resources: []string{ + "secrets", + }, + ResourceNames: []string{ + "test1", + "test2", + }, + }, + }, + } + testUsers = map[string][]interface{}{ + "user-a": { + management.ProjectRoleTemplateBinding{ + RoleTemplateID: "project-owner", + ProjectID: "test-prj-1", + }, + }, + "user-b": { + rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "namespace-secret-manager", + Namespace: "test-ns-1", + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: "namespace-secret-manager", + }, + }, + }, + "user-c": { + rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "mixed-secret-user", + Namespace: "test-ns-1", + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: "mixed-secret-user", + }, + }, + rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "mixed-secret-user", + Namespace: "test-ns-2", + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: "mixed-secret-user", + }, + }, + rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "mixed-secret-user", + Namespace: "test-ns-3", + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: "mixed-secret-user", + }, + }, + }, + "user-d": { + management.ProjectRoleTemplateBinding{ + RoleTemplateID: "project-owner", + ProjectID: "test-prj-1", + }, + management.ProjectRoleTemplateBinding{ + RoleTemplateID: "project-owner", + ProjectID: "test-prj-2", + }, + rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "namespace-secret-manager", + Namespace: "test-ns-8", + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: "namespace-secret-manager", + }, + }, + rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "namespace-secret-manager", + Namespace: "test-ns-9", + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: rbacv1.SchemeGroupVersion.Group, + Kind: "Role", + Name: "namespace-secret-manager", + }, + }, + }, + "user-e": { + management.ClusterRoleTemplateBinding{ + RoleTemplateID: "cluster-owner", + }, + }, + } + namespaceMap = map[string]string{ + "test-ns-1": "", + "test-ns-2": "", + "test-ns-3": "", + "test-ns-4": "", + "test-ns-5": "", + "test-ns-6": "", + "test-ns-7": "", + "test-ns-8": "", + "test-ns-9": "", + } + projectMap = map[string]*management.Project{ + "test-prj-1": nil, + "test-prj-2": nil, + } + projectNamespaceMap = map[string]string{ + "test-ns-1": "test-prj-1", + "test-ns-2": "test-prj-1", + "test-ns-3": "test-prj-1", + "test-ns-4": "test-prj-1", + "test-ns-5": "test-prj-1", + "test-ns-6": "test-prj-2", + "test-ns-7": "test-prj-2", + "test-ns-8": "", + "test-ns-9": "", + } +) + +type steveAPITestSuite struct { + suite.Suite + client *rancher.Client + session *session.Session + clusterID string + userClients map[string]*rancher.Client + lastContinueToken string + lastRevision string +} + +type LocalSteveAPITestSuite struct { + steveAPITestSuite +} + +func (s *LocalSteveAPITestSuite) TestExtensionAPIServer() { + restConfig := newExtensionAPIRestConfig(s.client.RancherConfig, s.clusterID, s.client.RancherConfig.AdminToken) + discClient, err := discovery.NewDiscoveryClientForConfig(restConfig) + require.NoError(s.T(), err) + + groups, err := discClient.ServerGroups() + require.NoError(s.T(), err) + require.GreaterOrEqual(s.T(), len(groups.Groups), 0) + + v2Document, err := discClient.OpenAPISchema() + require.NoError(s.T(), err) + require.NotNil(s.T(), v2Document) + + v3Client := discClient.OpenAPIV3() + paths, err := v3Client.Paths() + require.NoError(s.T(), err) + require.GreaterOrEqual(s.T(), len(paths), 0) + + // No auth + unauthRestConfig := newExtensionAPIRestConfig(s.client.RancherConfig, s.clusterID, "") + unauthDiscClient, err := discovery.NewDiscoveryClientForConfig(unauthRestConfig) + require.NoError(s.T(), err) + + _, err = unauthDiscClient.ServerGroups() + require.Error(s.T(), err) + require.True(s.T(), apierrors.IsForbidden(err)) + + _, err = unauthDiscClient.OpenAPISchema() + require.Error(s.T(), err) + require.True(s.T(), apierrors.IsForbidden(err)) + + unauthV3Client := unauthDiscClient.OpenAPIV3() + _, err = unauthV3Client.Paths() + require.Error(s.T(), err) + require.True(s.T(), apierrors.IsForbidden(err)) +} + +func (s *LocalSteveAPITestSuite) TestExtensionAPIServerAuthorization() { + restConfig := newExtensionAPIRestConfig(s.client.RancherConfig, s.clusterID, s.client.RancherConfig.AdminToken) + client, err := rest.HTTPClientFor(restConfig) + require.NoError(s.T(), err) + + tests := []struct { + path string + expectedStatusCode int + }{ + { + path: "/openapi/v2", + expectedStatusCode: http.StatusOK, + }, + { + path: "/openapi/v3", + expectedStatusCode: http.StatusOK, + }, + { + path: "/openapi/v3/version", + expectedStatusCode: http.StatusOK, + }, + { + path: "/metrics", + expectedStatusCode: http.StatusForbidden, + }, + { + path: "/healthz", + expectedStatusCode: http.StatusForbidden, + }, + { + path: "/readyz", + expectedStatusCode: http.StatusForbidden, + }, + { + path: "/livez", + expectedStatusCode: http.StatusForbidden, + }, + { + path: "/version", + expectedStatusCode: http.StatusForbidden, + }, + } + + for _, test := range tests { + name := strings.ReplaceAll(test.path, "/", "_") + s.T().Run(name, func(t *testing.T) { + resp, err := client.Get(fmt.Sprintf("%s/%s", restConfig.Host, test.path)) + require.NoError(t, err) + require.Equal(t, test.expectedStatusCode, resp.StatusCode) + }) + } +} + +func (s *LocalSteveAPITestSuite) TestExtensionAPIServerCreateRequests() { + client, err := rest.HTTPClientFor(s.client.WranglerContext.RESTConfig) + require.NoError(s.T(), err) + + tests := []struct { + name string + path string + body io.Reader + + expectedCode int + }{ + { + name: "create kubeconfig", + path: "/v1/ext.cattle.io.kubeconfig", + body: strings.NewReader(` + { + "apiVersion":"ext.cattle.io/v1", + "kind":"kubeconfig", + "metadata": { + "name": "test-kubeconfig" + }, + "spec": { + "clusters": ["local"], + "currentContent": "local", + "description": "kubeconfig for testing new kubeconfigs", + "ttl": 100 + } + }`), + expectedCode: http.StatusCreated, + }, + { + name: "create self user", + path: "/v1/ext.cattle.io.selfusers", + body: strings.NewReader(` + { + "apiVersion":"ext.cattle.io/v1", + "kind":"selfuser" + }`), + expectedCode: http.StatusCreated, + }, + } + + for _, test := range tests { + s.T().Run(test.name, func(t *testing.T) { + resp, err := client.Post( + fmt.Sprintf("https://%s%s", s.client.WranglerContext.RESTConfig.Host, test.path), + "application/json", + test.body, + ) + assert.NoError(t, err) + assert.Equal(t, test.expectedCode, resp.StatusCode) + }) + } +} + +func (s *LocalSteveAPITestSuite) TestExtensionAPIServerUpdateRequests() { + client, err := rest.HTTPClientFor(s.client.WranglerContext.RESTConfig) + require.NoError(s.T(), err) + + kubeconfig := s.createKubeconfig(client) + + tests := []struct { + name string + path string + kubeconfig extv1.Kubeconfig + expectedCode int + }{ + { + name: "update kubeconfig", + path: "/v1/ext.cattle.io.kubeconfig/" + kubeconfig.Name, + kubeconfig: extv1.Kubeconfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: kubeconfig.Name, + ResourceVersion: kubeconfig.ResourceVersion, + }, + Spec: extv1.KubeconfigSpec{ + Clusters: kubeconfig.Spec.Clusters, + CurrentContext: kubeconfig.Spec.CurrentContext, + Description: "kubeconfig updated", + TTL: kubeconfig.Spec.TTL, + }, + }, + expectedCode: http.StatusOK, + }, + { + name: "update non-existant kubeconfig", + path: "/v1/ext.cattle.io/kubeconfig/does-not-exist", + kubeconfig: extv1.Kubeconfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: kubeconfig.Name, + ResourceVersion: kubeconfig.ResourceVersion, + }, + Spec: extv1.KubeconfigSpec{ + Clusters: kubeconfig.Spec.Clusters, + CurrentContext: kubeconfig.Spec.CurrentContext, + Description: "kubeconfig updated", + TTL: kubeconfig.Spec.TTL, + }, + }, + expectedCode: http.StatusNotFound, + }, + } + + for _, test := range tests { + s.T().Run(test.name, func(t *testing.T) { + data, err := json.Marshal(test.kubeconfig) + require.NoError(t, err) + + req, err := http.NewRequest(http.MethodPut, fmt.Sprintf("https://%s%s", s.client.WranglerContext.RESTConfig.Host, test.path), bytes.NewBuffer(data)) + require.NoError(t, err) + + resp, err := client.Do(req) + assert.NoError(t, err) + assert.Equal(t, test.expectedCode, resp.StatusCode) + }) + } +} + +func (s *LocalSteveAPITestSuite) TestExtensionAPIServerDeleteRequests() { + client, err := rest.HTTPClientFor(s.client.WranglerContext.RESTConfig) + require.NoError(s.T(), err) + + kubeconfig := s.createKubeconfig(client) + + tests := []struct { + name string + path string + expectedCode int + }{ + { + name: "delete kubeconfig", + path: "/v1/ext.cattle.io.kubeconfig/" + kubeconfig.Name, + expectedCode: http.StatusNoContent, + }, + { + name: "delete non-existant kubeconfig", + path: "/v1/ext.cattle.io/kubeconfig/does-not-exist", + expectedCode: http.StatusNotFound, + }, + } + + for _, test := range tests { + s.T().Run(test.name, func(t *testing.T) { + req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("https://%s%s", s.client.WranglerContext.RESTConfig.Host, test.path), nil) + require.NoError(t, err) + + resp, err := client.Do(req) + assert.NoError(t, err) + assert.Equal(t, test.expectedCode, resp.StatusCode) + }) + } +} + +type DownstreamSteveAPITestSuite struct { + steveAPITestSuite +} + +func (s *steveAPITestSuite) TearDownSuite() { + s.session.Cleanup() +} + +// Tests that everything in /ext returns 404 since the Downstream cluster shouldn't be served +func (s *DownstreamSteveAPITestSuite) TestExtensionAPIServer() { + restConfig := newExtensionAPIRestConfig(s.client.RancherConfig, s.clusterID, s.client.RancherConfig.AdminToken) + discClient, err := discovery.NewDiscoveryClientForConfig(restConfig) + require.NoError(s.T(), err) + + _, err = discClient.ServerGroups() + require.Error(s.T(), err) + require.True(s.T(), apierrors.IsNotFound(err)) + + _, err = discClient.OpenAPISchema() + require.Error(s.T(), err) + require.True(s.T(), apierrors.IsNotFound(err)) + + v3Client := discClient.OpenAPIV3() + _, err = v3Client.Paths() + require.Error(s.T(), err) + require.True(s.T(), apierrors.IsNotFound(err)) +} + +func (s *LocalSteveAPITestSuite) SetupSuite() { + s.steveAPITestSuite.setupSuite("local") +} + +func (s *DownstreamSteveAPITestSuite) SetupSuite() { + s.steveAPITestSuite.setupSuite("") +} + +func (s *steveAPITestSuite) setupSuite(clusterName string) { + testSession := session.NewSession() + s.session = testSession + + configPath := os.Getenv("CATTLE_TEST_CONFIG") + fmt.Printf("Config path: %s\n", configPath) + + // Load config first to ensure pointer fields are set + rancherConfig := new(rancher.Config) + config.LoadConfig(rancher.ConfigurationFileKey, rancherConfig) + + // Debug: log config values + s.T().Logf("Loaded config - Host: %s, AdminToken: %s (len: %d)", + rancherConfig.Host, + func() string { + if rancherConfig.AdminToken == "" { + return "" + } + return rancherConfig.AdminToken[:20] + "..." + }(), + len(rancherConfig.AdminToken)) + + // Ensure Host is set (it might be empty when loaded from YAML) + if rancherConfig.Host == "" { + // Try to get host from environment or use default + if host := os.Getenv("CATTLE_SERVER_URL"); host != "" { + // Remove https:// prefix if present + host = strings.TrimPrefix(host, "https://") + host = strings.TrimPrefix(host, "http://") + rancherConfig.Host = host + } else { + s.T().Fatalf("CATTLE_SERVER_URL is not set") + } + } + + // Ensure Cleanup is set (it might be nil when loaded from YAML) + if rancherConfig.Cleanup == nil { + cleanup := true + rancherConfig.Cleanup = &cleanup + } + + // Ensure Insecure is set (it might be nil when loaded from YAML) + if rancherConfig.Insecure == nil { + insecure := true // Default to insecure for local testing + rancherConfig.Insecure = &insecure + } + + // Ensure AdminToken is set (use bearerToken parameter if AdminToken is empty) + bearerToken := "" + if rancherConfig.AdminToken != "" { + bearerToken = rancherConfig.AdminToken + } + + // Use NewClientForConfig to pass the config directly + + // print all config values + fmt.Printf("Config values: %+v\n", rancherConfig) + fmt.Printf("Bearer token: %s\n", bearerToken) + fmt.Printf("Test session: %+v\n", testSession) + fmt.Printf("Cluster name: %s\n", clusterName) + fmt.Printf("Cluster ID: %s\n", s.clusterID) + fmt.Printf("Project map: %+v\n", projectMap) + fmt.Printf("Project namespace map: %+v\n", projectNamespaceMap) + fmt.Printf("Namespace map: %+v\n", namespaceMap) + + client, err := rancher.NewClientForConfig(bearerToken, rancherConfig, testSession) + require.NoError(s.T(), err) + s.client = client + + s.userClients = make(map[string]*rancher.Client) + + if clusterName == "" { + clusterName = s.client.RancherConfig.ClusterName + } + s.clusterID, err = clusters.GetClusterIDByName(client, clusterName) + require.NoError(s.T(), err) + + mgmtCluster, err := client.Management.Cluster.ByID(s.clusterID) + require.NoError(s.T(), err) + + // create projects + for p := range projectMap { + project, err := s.client.Management.Project.Create(&management.Project{ + ClusterID: s.clusterID, + Name: p, + }) + require.NoError(s.T(), err) + projectMap[p] = project + } + + userID, err := users.GetUserIDByName(client, "admin") + require.NoError(s.T(), err) + + impersonationSA := impersonationSABase + userID + err = serviceaccounts.IsServiceAccountReady(client, s.clusterID, impersonationNamespace, impersonationSA) + require.NoError(s.T(), err) + + // create project namespaces + for n := range namespaceMap { + if projectMap[projectNamespaceMap[n]] == nil { + continue + } + name := namegenerator.AppendRandomString(n) + _, err := namespaces.CreateNamespace(client, name, "", nil, nil, projectMap[projectNamespaceMap[n]]) + require.NoError(s.T(), err) + namespaceMap[n] = name + } + // create non project namespaces + for n := range namespaceMap { + if projectMap[projectNamespaceMap[n]] != nil { + continue + } + name := namegenerator.AppendRandomString(n) + ns := &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + dynamicClient, err := client.GetDownStreamClusterClient(s.clusterID) + require.NoError(s.T(), err) + namespaceResource := dynamicClient.Resource(kubenamespaces.NamespaceGroupVersionResource) + resp, err := namespaceResource.Create(context.TODO(), unstructured.MustToUnstructured(ns), metav1.CreateOptions{}) + require.NoError(s.T(), err) + s.client.Session.RegisterCleanupFunc(func() error { + err := namespaceResource.Delete(context.TODO(), resp.GetName(), metav1.DeleteOptions{}) + if apierrors.IsNotFound(err) { + return nil + } + return err + }) + scheme := runtime.NewScheme() + v1.SchemeBuilder.AddToScheme(scheme) + + err = scheme.Convert(resp, ns, resp.GroupVersionKind()) + require.NoError(s.T(), err) + err = wait.Poll(time.Second, time.Minute, func() (done bool, err error) { + ns, _ := kubenamespaces.GetNamespaceByName(s.client, s.clusterID, ns.Name) + if ns != nil { + return true, nil + } + return false, nil + }) + require.NoError(s.T(), err) + namespaceMap[n] = name + } + + // create resources in all namespaces + for name, n := range namespaceMap { + for i := 1; i <= 5; i++ { + if i > 2 && (projectNamespaceMap[name] == "test-prj-2" || projectNamespaceMap[name] == "") { + break + } + secret := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("test%d", i), + }, + } + labels := map[string]string{steveAPITestLabel: testID} + if i == 2 { + labels[labelKey] = "2" + } + if i >= 3 { + labels[labelGTEKey] = "3" + } + secret.ObjectMeta.SetLabels(labels) + if i == 4 && name == "test-ns-2" { + // test4 in namespace test-ns-2 has this annotation + annotations := map[string]string{"management.cattle.io/project-scoped-secret-copy": "spuds"} + secret.ObjectMeta.SetAnnotations(annotations) + } + err := retryRequest(func() error { + _, err := secrets.CreateSecretForCluster(s.client, secret, s.clusterID, n) + if apierrors.IsAlreadyExists(err) { + return nil + } + return err + }) + require.NoError(s.T(), err) + } + } + + // create test roles in all namespaces + for _, n := range namespaceMap { + role := namespaceSecretManagerRole + role.Namespace = n + err := retryRequest(func() error { + _, err = rbac.CreateRole(s.client, s.clusterID, &role) + if apierrors.IsAlreadyExists(err) { + return nil + } + return err + }) + require.NoError(s.T(), err) + role = mixedSecretUserRole + role.Namespace = n + err = retryRequest(func() error { + _, err = rbac.CreateRole(s.client, s.clusterID, &role) + if apierrors.IsAlreadyExists(err) { + return nil + } + return err + }) + require.NoError(s.T(), err) + } + + // create users and assign access + for user, access := range testUsers { + username := namegenerator.AppendRandomString(user) + password := password.GenerateUserPassword("testpass") + userObj := &management.User{ + Username: username, + Password: password, + Name: username, + Enabled: &userEnabled, + } + userObj, err := s.client.Management.User.Create(userObj) + require.NoError(s.T(), err) + userObj.Password = password + // users either have access to a whole project or to select namespaces or resources in a project + for _, binding := range access { + switch b := binding.(type) { + case management.ClusterRoleTemplateBinding: + err = users.AddClusterRoleToUser(client, mgmtCluster, userObj, b.RoleTemplateID, nil) + require.NoError(s.T(), err) + case management.ProjectRoleTemplateBinding: + err = users.AddProjectMember(client, projectMap[b.ProjectID], userObj, b.RoleTemplateID, nil) + require.NoError(s.T(), err) + case rbacv1.RoleBinding: + _ = users.AddClusterRoleToUser(client, mgmtCluster, userObj, "cluster-member", nil) + subject := rbacv1.Subject{ + Kind: "User", + Name: userObj.ID, + } + err := retryRequest(func() error { + _, err = rbac.CreateRoleBinding(s.client, s.clusterID, namegenerator.AppendRandomString(b.Name), namespaceMap[b.Namespace], b.RoleRef.Name, subject) + if apierrors.IsAlreadyExists(err) { + return nil + } + return err + }) + require.NoError(s.T(), err) + } + } + s.userClients[user], err = s.client.AsUser(userObj) + require.NoError(s.T(), err) + } +} + +type listTestType struct { + description string + user string + namespace string + query string + expect []map[string]string + expectExcludes bool + expectContains bool +} + +var nonSQLListTests = []listTestType{ + { + description: "user:user-a,namespace:none,query:limit=8", + user: "user-a", + namespace: "", + query: "limit=8", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-a,namespace:none,query:limit=8&continue=" + continueToken, + user: "user-a", + namespace: "", + query: "limit=8&continue=" + continueToken, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:limit=3", + user: "user-a", + namespace: "test-ns-1", + query: "limit=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:limit=3&continue=" + continueToken, + user: "user-a", + namespace: "test-ns-1", + query: "limit=3&continue=" + continueToken, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&limit=20", + user: "user-a", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&limit=20", + // limit is applied BEFORE filter and pagesize, which is why not all test5 secrets appear in the result + expect: []map[string]string{ + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test4"}, + {"name": "test4"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=2&revision=" + revisionNum + "&limit=20", + user: "user-a", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=2&revision=" + revisionNum + "&limit=20", + expect: []map[string]string{ + {"name": "test4"}, + {"name": "test4"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=1&limit=20&continue=" + continueToken, + user: "user-a", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=6&page=1&limit=20&continue=" + continueToken, + // the remaining chunk is all from test-ns-5 + expect: []map[string]string{ + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-b,namespace:none,query:limit=3", + user: "user-b", + namespace: "", + query: "limit=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:limit=3&continue=" + continueToken, + user: "user-b", + namespace: "", + query: "limit=3&continue=" + continueToken, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:limit=3", + user: "user-b", + namespace: "test-ns-1", + query: "limit=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:limit=3&continue=" + continueToken, + user: "user-b", + namespace: "test-ns-1", + query: "limit=3&continue=" + continueToken, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-5,query:limit=3", + user: "user-b", + namespace: "test-ns-5", + query: "limit=3", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:limit=3", + user: "user-c", + namespace: "", + query: "limit=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-c,namespace:none,query:limit=3&continue=" + continueToken, + user: "user-c", + namespace: "", + query: "limit=3&continue=" + continueToken, + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:limit=3", + user: "user-c", + namespace: "test-ns-1", + query: "limit=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-5,query:limit=3", + user: "user-c", + namespace: "test-ns-5", + query: "limit=3", + expect: []map[string]string{}, + }, +} + +func (s *steveAPITestSuite) TestList() { + subSession := s.session.NewSession() + defer subSession.Cleanup() + usingSQLCache := true + relativeDateRx := regexp.MustCompile(`^(\d+[smhd])+$`) + containsNamespaceTag := regexp.MustCompile(`(%2Fsteveapi%5D~)[a-z]+`) + containsSortNamespace := regexp.MustCompile(`sort=.*metadata.namespace\b`) + containsSortName := regexp.MustCompile(`sort=.*metadata.name\b`) + containsReverseOrderSortName := regexp.MustCompile(`sort=.*-metadata.name\b`) + replacementNamespaceTag := "${1}MYTAG" + + tests := []listTestType{ + // user-a + { + description: "user:user-a,namespace:none,query:none", + user: "user-a", + namespace: "", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:none", + user: "user-a", + namespace: "test-ns-1", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-5,query:none", + user: "user-a", + namespace: "test-ns-5", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:none,query:labelSelector=test-label=2", + user: "user-a", + namespace: "", + query: "labelSelector=test-label=2", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-2,query:labelSelector=test-label=2", + user: "user-a", + namespace: "test-ns-2", + query: "labelSelector=test-label=2", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-a,namespace:none,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-a", + namespace: "", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:fieldSelector=metadata.name=test1", + user: "user-a", + namespace: "", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-a", + namespace: "test-ns-1", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-2,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-a", + namespace: "test-ns-2", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{}, + }, + { + description: "user:user-a,namespace:test-ns-1,query:fieldSelector=metadata.name=test1", + user: "user-a", + namespace: "test-ns-1", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.name=test1", + user: "user-a", + namespace: "", + query: "filter=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.name=test6", + user: "user-a", + namespace: "", + query: "filter=metadata.name=test6", + expect: []map[string]string{}, + }, + { + description: "user:user-a,namespace:test-ns-1,query:filter=metadata.name=test1", + user: "user-a", + namespace: "test-ns-1", + query: "filter=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.name=test1,metadata.namespace=test-ns-1", + user: "user-a", + namespace: "", + query: "filter=metadata.name=test1,metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=test-ns-1", + user: "user-a", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:filter=metadata.name!=test1", + user: "user-a", + namespace: "", + query: "filter=metadata.name!=test1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-2,query:filter=metadata.annotations[management.cattle.io/project-scoped-secret-copy]=spuds", + user: "user-a", + namespace: "test-ns-2", + query: "filter=metadata.annotations[management.cattle.io/project-scoped-secret-copy]=spuds", + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-2,query:filter=metadata.annotations[management.cattle.io/project-scoped-secret-copy]=potatoes", + user: "user-a", + namespace: "test-ns-2", + query: "filter=metadata.annotations[management.cattle.io/project-scoped-secret-copy]=potatoes", + expect: []map[string]string{}, + }, + { + description: "user:user-a,namespace:none,query:sort=metadata.name", + user: "user-a", + namespace: "", + query: "sort=metadata.name", + expect: []map[string]string{ + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + }, + }, + { + description: "user:user-a,namespace:none,query:sort=-metadata.name", + user: "user-a", + namespace: "", + query: "sort=-metadata.name", + expect: []map[string]string{ + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test5"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test4"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test3"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:sort=metadata.name,metadata.namespace", + user: "user-a", + namespace: "", + query: "sort=metadata.name,metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-5"}, + }, + }, + { + description: "user:user-a,namespace:none,query:sort=metadata.name,-metadata.namespace", + user: "user-a", + namespace: "", + query: "sort=metadata.name,-metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:sort=metadata.name", + user: "user-a", + namespace: "test-ns-1", + query: "sort=metadata.name", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:sort=-metadata.name", + user: "user-a", + namespace: "test-ns-1", + query: "sort=-metadata.name", + expect: []map[string]string{ + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:none,query:pagesize=8", + user: "user-a", + namespace: "", + query: "pagesize=8", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-a,namespace:none,query:pagesize=8&page=2&revision=" + revisionNum, + user: "user-a", + namespace: "", + query: "pagesize=8&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:pagesize=3", + user: "user-a", + namespace: "test-ns-1", + query: "pagesize=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-a,namespace:test-ns-1,query:pagesize=3&page=2&revision=" + revisionNum, + user: "user-a", + namespace: "test-ns-1", + query: "pagesize=3&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + + // user-b + { + description: "user:user-b,namespace:none,query:none", + user: "user-b", + namespace: "", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:none", + user: "user-b", + namespace: "test-ns-1", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-5,query:none", + user: "user-b", + namespace: "test-ns-5", + query: "", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:labelSelector=test-label=2", + user: "user-b", + namespace: "", + query: "labelSelector=test-label=2", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:labelSelector=test-label=2", + user: "user-b", + namespace: "test-ns-1", + query: "labelSelector=test-label=2", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-2,query:labelSelector=test-label=2", + user: "user-b", + namespace: "test-ns-2", + query: "labelSelector=test-label=2", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-b", + namespace: "", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:fieldSelector=metadata.namespace=test-ns-2", + user: "user-b", + namespace: "", + query: "fieldSelector=metadata.namespace=test-ns-2", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:fieldSelector=metadata.name=test1", + user: "user-b", + namespace: "", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-b", + namespace: "test-ns-1", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-2,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-b", + namespace: "test-ns-2", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:test-ns-1,query:fieldSelector=metadata.namespace=test-ns-2", + user: "user-b", + namespace: "test-ns-1", + query: "fieldSelector=metadata.namespace=test-ns-2", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:test-ns-1,query:fieldSelector=metadata.name=test1", + user: "user-b", + namespace: "test-ns-1", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-2,query:fieldSelector=metadata.name=test1", + user: "user-b", + namespace: "test-ns-2", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:filter=metadata.name=test1", + user: "user-b", + namespace: "", + query: "filter=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:filter=metadata.name=test1", + user: "user-b", + namespace: "test-ns-1", + query: "filter=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:filter=metadata.name=test6", + user: "user-b", + namespace: "test-ns-1", + query: "filter=metadata.name=test6", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:filter=metadata.name=test1,metadata.namespace=test-ns-1", + user: "user-b", + namespace: "", + query: "filter=metadata.name=test1,metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=test-ns-1", + user: "user-b", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:filter=metadata.name!=test1", + user: "user-b", + namespace: "", + query: "filter=metadata.name!=test1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:sort=metadata.name", + user: "user-b", + namespace: "", + query: "sort=metadata.name", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:sort=-metadata.name", + user: "user-b", + namespace: "", + query: "sort=-metadata.name", + expect: []map[string]string{ + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:sort=metadata.name,metadata.namespace", + user: "user-b", + namespace: "", + query: "sort=metadata.name,metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:sort=-metadata.name,metadata.namespace", + user: "user-b", + namespace: "", + query: "sort=-metadata.name,metadata.namespace", + expect: []map[string]string{ + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:sort=metadata.name", + user: "user-b", + namespace: "test-ns-1", + query: "sort=metadata.name", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:sort=-metadata.name", + user: "user-b", + namespace: "test-ns-1", + query: "sort=-metadata.name", + expect: []map[string]string{ + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-5,query:sort=metadata.name", + user: "user-b", + namespace: "test-ns-5", + query: "sort=metadata.name", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:pagesize=3", + user: "user-b", + namespace: "", + query: "pagesize=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:pagesize=3&page=2&revision=" + revisionNum, + user: "user-b", + namespace: "", + query: "pagesize=3&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:pagesize=3", + user: "user-b", + namespace: "test-ns-1", + query: "pagesize=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-1,query:pagesize=3&page=2&revision=" + revisionNum, + user: "user-b", + namespace: "test-ns-1", + query: "pagesize=3&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:test-ns-5,query:pagesize=3", + user: "user-b", + namespace: "test-ns-5", + query: "pagesize=3", + expect: []map[string]string{}, + }, + { + description: "user:user-b,namespace:none,query:filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2", + user: "user-b", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2", + expect: []map[string]string{ + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-b,namespace:none,query:filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=" + revisionNum, + user: "user-b", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3&sort=-metadata.name&pagesize=2&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test3", "namespace": "test-ns-1"}, + }, + }, + + // user-c + { + description: "user:user-c,namespace:none,query:none", + user: "user-c", + namespace: "", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:none", + user: "user-c", + namespace: "test-ns-1", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-5,query:none", + user: "user-c", + namespace: "test-ns-5", + query: "", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:labelSelector=test-label=2", + user: "user-c", + namespace: "", + query: "labelSelector=test-label=2", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:labelSelector=test-label=2", + user: "user-c", + namespace: "test-ns-1", + query: "labelSelector=test-label=2", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-5,query:labelSelector=test-label=2", + user: "user-c", + namespace: "test-ns-5", + query: "labelSelector=test-label=2", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-c", + namespace: "", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:none,query:fieldSelector=metadata.namespace=test-ns-2", + user: "user-c", + namespace: "", + query: "fieldSelector=metadata.namespace=test-ns-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-c,namespace:none,query:fieldSelector=metadata.namespace=test-ns-5", + user: "user-c", + namespace: "", + query: "fieldSelector=metadata.namespace=test-ns-5", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:fieldSelector=metadata.name=test1", + user: "user-c", + namespace: "", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:none,query:fieldSelector=metadata.name=test5", + user: "user-c", + namespace: "", + query: "fieldSelector=metadata.name=test5", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:test-ns-1,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-c", + namespace: "test-ns-1", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-2,query:fieldSelector=metadata.namespace=test-ns-1", + user: "user-c", + namespace: "test-ns-2", + query: "fieldSelector=metadata.namespace=test-ns-1", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:test-ns-1,query:fieldSelector=metadata.namespace=test-ns-2", + user: "user-c", + namespace: "test-ns-1", + query: "fieldSelector=metadata.namespace=test-ns-2", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:test-ns-1,query:fieldSelector=metadata.name=test1", + user: "user-c", + namespace: "test-ns-1", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-5,query:fieldSelector=metadata.name=test1", + user: "user-c", + namespace: "test-ns-5", + query: "fieldSelector=metadata.name=test1", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:test-ns-1,query:fieldSelector=metadata.name=test5", + user: "user-c", + namespace: "test-ns-1", + query: "fieldSelector=metadata.name=test5", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:filter=metadata.name=test1", + user: "user-c", + namespace: "", + query: "filter=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:filter=metadata.name=test1", + user: "user-c", + namespace: "test-ns-1", + query: "filter=metadata.name=test1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:filter=metadata.name=test3", + user: "user-c", + namespace: "test-ns-1", + query: "filter=metadata.name=test3", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:filter=metadata.name=test1,metadata.namespace=test-ns-1", + user: "user-c", + namespace: "", + query: "filter=metadata.name=test1,metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:filter=metadata.name!=test1", + user: "user-c", + namespace: "", + query: "filter=metadata.name!=test1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:none,query:filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=test-ns-1", + user: "user-c", + namespace: "", + query: "filter=metadata.labels.test-label-gte=3,metadata.labels.test-label=2&filter=metadata.namespace=test-ns-1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:none,query:sort=metadata.name", + user: "user-c", + namespace: "", + query: "sort=metadata.name", + expect: []map[string]string{ + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + }, + }, + { + description: "user:user-c,namespace:none,query:sort=-metadata.name", + user: "user-c", + namespace: "", + query: "sort=-metadata.name", + expect: []map[string]string{ + {"name": "test2"}, + {"name": "test2"}, + {"name": "test2"}, + {"name": "test1"}, + {"name": "test1"}, + {"name": "test1"}, + }, + }, + { + description: "user:user-c,namespace:none,query:sort=metadata.name,metadata.namespace", + user: "user-c", + namespace: "", + query: "sort=metadata.name,metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:none,query:sort=metadata.name,-metadata.namespace", + user: "user-c", + namespace: "", + query: "sort=metadata.name,-metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:sort=metadata.name", + user: "user-c", + namespace: "test-ns-1", + query: "sort=metadata.name", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:sort=-metadata.name", + user: "user-c", + namespace: "test-ns-1", + query: "sort=-metadata.name", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:sort=metadata.name,metadata.namespace", + user: "user-c", + namespace: "test-ns-1", + query: "sort=metadata.name,metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:sort=metadata.name,-metadata.namespace", + user: "user-c", + namespace: "test-ns-1", + query: "sort=metadata.name,-metadata.namespace", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-5,query:sort=metadata.name", + user: "user-c", + namespace: "test-ns-5", + query: "sort=metadata.name", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:pagesize=3", + user: "user-c", + namespace: "", + query: "pagesize=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-c,namespace:none,query:pagesize=3&page=2&revision=" + revisionNum, + user: "user-c", + namespace: "", + query: "pagesize=3&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-1,query:pagesize=3", + user: "user-c", + namespace: "test-ns-1", + query: "pagesize=3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-c,namespace:test-ns-5,query:pagesize=3", + user: "user-c", + namespace: "test-ns-5", + query: "pagesize=3", + expect: []map[string]string{}, + }, + { + description: "user:user-c,namespace:none,query:filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1", + user: "user-c", + namespace: "", + query: "filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1", + expect: []map[string]string{ + {"name": "test2", "namespace": "test-ns-3"}, + }, + }, + { + description: "user:user-c,namespace:none,query:filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=" + revisionNum, + user: "user-c", + namespace: "", + query: "filter=metadata.namespace=test-ns-3&sort=-metadata.name&pagesize=1&page=2&revision=" + revisionNum, + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-3"}, + }, + }, + + // user-d + { + description: "user:user-d,namespace:none,query:none", + user: "user-d", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces=test-prj-2", + user: "user-d", + query: "projectsornamespaces=test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces=test-prj-1,test-prj-2", + user: "user-d", + query: "projectsornamespaces=test-prj-1,test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces=test-ns-1", + user: "user-d", + query: "projectsornamespaces=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces=test-ns-1,test-ns-2", + user: "user-d", + query: "projectsornamespaces=test-ns-1,test-ns-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces=test-prj-2,test-ns-2,test-ns-3", + user: "user-d", + query: "projectsornamespaces=test-prj-2,test-ns-2,test-ns-3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces=test-ns-8,test-ns-9", + user: "user-d", + query: "projectsornamespaces=test-ns-8,test-ns-9", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces!=test-prj-1", + user: "user-d", + query: "projectsornamespaces!=test-prj-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces!=test-prj-1,test-prj-2", + user: "user-d", + query: "projectsornamespaces!=test-prj-1,test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + }, + { + description: "user:user-d,namespace:none,query:projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8", + user: "user-d", + query: "projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + }, + { + description: "user:user-d,namespace:test-ns-6,query:none", + user: "user-d", + namespace: "test-ns-6", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + }, + }, + { + description: "user:user-d,namespace:test-ns-6,query:projectsornamespaces=test-prj-2", + user: "user-d", + namespace: "test-ns-6", + query: "projectsornamespaces=test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + }, + }, + { + description: "user:user-d,namespace:test-ns-6,query:projectsornamespaces=test-prj-2", + user: "user-d", + namespace: "test-ns-6", + query: "projectsornamespaces=test-prj-1", + expect: []map[string]string{}, + }, + { + description: "user:user-d,namespace:test-ns-1,query:projectsornamespaces=test-ns-1,test-ns-2,-test-prj-2,test-ns-7", + user: "user-d", + namespace: "test-ns-1", + query: "projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-d,namespace:test-ns-1,query:projectsornamespaces!=test-prj-1", + user: "user-d", + namespace: "test-ns-1", + query: "projectsornamespaces!=test-prj-1", + expect: []map[string]string{}, + }, + { + description: "user:user-d,namespace:test-ns-1,query:projectsornamespaces!=test-prj-1,test-prj-2", + user: "user-d", + namespace: "test-ns-1", + query: "projectsornamespaces!=test-prj-1,test-prj-2", + expect: []map[string]string{}, + }, + + // user-e + { + description: "user:user-e,namespace:none,query:none", + user: "user-e", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + expectContains: true, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces=test-prj-2", + user: "user-e", + query: "projectsornamespaces=test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces=test-prj-1,test-prj-2", + user: "user-e", + query: "projectsornamespaces=test-prj-1,test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces=test-ns-1", + user: "user-e", + query: "projectsornamespaces=test-ns-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces=test-ns-1,test-ns-2", + user: "user-e", + query: "projectsornamespaces=test-ns-1,test-ns-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + }, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces=test-prj-2,test-ns-2,test-ns-3", + user: "user-e", + query: "projectsornamespaces=test-prj-2,test-ns-2,test-ns-3", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces=test-ns-8,test-ns-9", + user: "user-e", + query: "projectsornamespaces=test-ns-8,test-ns-9", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + {"name": "test1", "namespace": "test-ns-9"}, + {"name": "test2", "namespace": "test-ns-9"}, + }, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces!=test-prj-1", + user: "user-e", + query: "projectsornamespaces!=test-prj-1", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + }, + expectExcludes: true, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces!=test-prj-1,test-prj-2", + user: "user-e", + query: "projectsornamespaces!=test-prj-1,test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-7"}, + {"name": "test2", "namespace": "test-ns-7"}, + }, + expectExcludes: true, + }, + { + description: "user:user-e,namespace:none,query:projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8", + user: "user-e", + query: "projectsornamespaces!=test-prj-1,test-ns-6,test-ns-8", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + {"name": "test1", "namespace": "test-ns-2"}, + {"name": "test2", "namespace": "test-ns-2"}, + {"name": "test3", "namespace": "test-ns-2"}, + {"name": "test4", "namespace": "test-ns-2"}, + {"name": "test5", "namespace": "test-ns-2"}, + {"name": "test1", "namespace": "test-ns-3"}, + {"name": "test2", "namespace": "test-ns-3"}, + {"name": "test3", "namespace": "test-ns-3"}, + {"name": "test4", "namespace": "test-ns-3"}, + {"name": "test5", "namespace": "test-ns-3"}, + {"name": "test1", "namespace": "test-ns-4"}, + {"name": "test2", "namespace": "test-ns-4"}, + {"name": "test3", "namespace": "test-ns-4"}, + {"name": "test4", "namespace": "test-ns-4"}, + {"name": "test5", "namespace": "test-ns-4"}, + {"name": "test1", "namespace": "test-ns-5"}, + {"name": "test2", "namespace": "test-ns-5"}, + {"name": "test3", "namespace": "test-ns-5"}, + {"name": "test4", "namespace": "test-ns-5"}, + {"name": "test5", "namespace": "test-ns-5"}, + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + {"name": "test1", "namespace": "test-ns-8"}, + {"name": "test2", "namespace": "test-ns-8"}, + }, + expectExcludes: true, + }, + { + description: "user:user-e,namespace:test-ns-6,query:none", + user: "user-e", + namespace: "test-ns-6", + query: "", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + }, + }, + { + description: "user:user-e,namespace:test-ns-6,query:projectsornamespaces=test-prj-2", + user: "user-e", + namespace: "test-ns-6", + query: "projectsornamespaces=test-prj-2", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-6"}, + {"name": "test2", "namespace": "test-ns-6"}, + }, + }, + { + description: "user:user-e,namespace:test-ns-6,query:projectsornamespaces=test-prj-1", + user: "user-e", + namespace: "test-ns-6", + query: "projectsornamespaces=test-prj-1", + expect: []map[string]string{}, + }, + { + description: "user:user-e,namespace:test-ns-1,query:projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7", + user: "user-e", + namespace: "test-ns-1", + query: "projectsornamespaces=test-ns-1,test-ns-2,test-prj-2,test-ns-7", + expect: []map[string]string{ + {"name": "test1", "namespace": "test-ns-1"}, + {"name": "test2", "namespace": "test-ns-1"}, + {"name": "test3", "namespace": "test-ns-1"}, + {"name": "test4", "namespace": "test-ns-1"}, + {"name": "test5", "namespace": "test-ns-1"}, + }, + }, + { + description: "user:user-e,namespace:test-ns-1,query:projectsornamespaces!=test-prj-1", + user: "user-e", + namespace: "test-ns-1", + query: "projectsornamespaces!=test-prj-1", + expect: []map[string]string{}, + }, + { + description: "user:user-e,namespace:test-ns-1,query:projectsornamespaces!=test-prj-1,test-prj-2", + user: "user-e", + namespace: "test-ns-1", + query: "projectsornamespaces!=test-prj-1,test-prj-2", + expect: []map[string]string{}, + }, + { + description: "user:user-e,namespace:test-ns-1,query:projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8", + user: "user-e", + namespace: "test-ns-1", + query: "projectsornamespaces!=test-prj-1,test-ns-2,test-ns-8", + expect: []map[string]string{}, + }, + } + if !usingSQLCache { + tests = append(tests, nonSQLListTests...) + } else { + // map labelSelector and fieldSelector params to the VAI equivalents + // ensure metadata.namespace tests are doing partial matching because + // the actual namespaces are given an `auto` prefix and a random suffix + for i, test := range tests { + query := test.query + parts := strings.Split(query, "&") + changed := false + for j, part := range parts { + subparts := strings.Split(part, "=") + if subparts[0] == "labelSelector" { + parts[j] = fmt.Sprintf("filter=metadata.labels[%s]=%s", subparts[1], subparts[2]) + changed = true + } else if subparts[0] == "fieldSelector" { + op := "=" + if subparts[1] == "metadata.namespace" { + // Use the partial-match operator because actual namespaces have a random prefix and suffix + op = "~" + } + parts[j] = fmt.Sprintf("filter=%s%s%s", subparts[1], op, subparts[2]) + changed = true + } else if subparts[0] == "filter" { + if strings.Contains(part, "metadata.namespace=") { + // No need to break the filter down into sub-filters because in the test suite we don't + // have any VALUES that match 'metadata.namespace=' + changed = true + parts[j] = strings.ReplaceAll(part, "metadata.namespace=", "metadata.namespace~") + } + } + } + if changed { + query = strings.Join(parts, "&") + tests[i].query = query + } + } + } + + var csvWriter *csv.Writer + var jsonDir string + if s.clusterID == "local" { + var fp *os.File + var err error + csvWriter, fp, jsonDir, err = setUpResults() + defer fp.Close() + defer func() { + csvWriter.Flush() + require.NoError(s.T(), csvWriter.Error()) + }() + require.NoError(s.T(), err) + } + + for _, test := range tests { + s.Run(test.description, func() { + userClient := s.userClients[test.user] + + client, err := userClient.Steve.ProxyDownstream(s.clusterID) + require.NoError(s.T(), err) + var secretClient clientv1.SteveOperations + secretClient = client.SteveType(stevesecrets.SecretSteveType) + if test.namespace != "" { + secretClient = secretClient.(*clientv1.SteveClient).NamespacedSteveClient(namespaceMap[test.namespace]) + } + query, err := url.ParseQuery(test.query) + require.NoError(s.T(), err) + if _, ok := query["sort"]; !ok && s.clusterID != "local" { + // k8s does not guarantee any particular order but usually returns results sorted by namespace and name. + // k3d seems to have its own ideas, so we can't rely on a consistent order when testing on the downstream cluster. + query["sort"] = []string{"metadata.namespace,metadata.name"} + } + if _, ok := query["continue"]; ok { + query["continue"] = []string{s.lastContinueToken} + } + if fs, ok := query["fieldSelector"]; ok { + if strings.Contains(fs[0], "metadata.namespace") { + fieldParts := strings.Split(fs[0], "=") + ns := namespaceMap[fieldParts[1]] + query["fieldSelector"] = []string{"metadata.namespace=" + ns} + } + } + key := "projectsornamespaces" + projectsOrNamespaces, ok := query[key] + if !ok { + key += "!" + projectsOrNamespaces = query[key] + } + if len(projectsOrNamespaces) != 0 { + groups := projectTag.FindAllStringSubmatch(projectsOrNamespaces[0], -1) + for _, g := range groups { + name := string(g[1]) + projectID := projectMap[name].ID + projectID = strings.Split(projectID, ":")[1] + projectsOrNamespaces[0] = strings.ReplaceAll(projectsOrNamespaces[0], name, projectID) + } + groups = namespaceTag.FindAllStringSubmatch(projectsOrNamespaces[0], -1) + for _, g := range groups { + name := string(g[1]) + projectsOrNamespaces[0] = strings.ReplaceAll(projectsOrNamespaces[0], name, namespaceMap[name]) + } + query[key] = projectsOrNamespaces + } + if _, ok := query["revision"]; ok { + query["revision"] = []string{s.lastRevision} + } + if usingSQLCache { + query["filter"] = append(query["filter"], fmt.Sprintf("metadata.labels[%s]~%s", steveAPITestLabel, testID)) + } else { + query["labelSelector"] = append(query["labelSelector"], steveAPITestLabel+"="+testID) + } + secretList, err := secretClient.List(query) + require.NoError(s.T(), err) + + if secretList.Continue != "" { + s.lastContinueToken = secretList.Continue + } + s.lastRevision = secretList.Revision + + if test.expectContains { + s.assertListContains(test.expect, secretList.Data) + } else if test.expectExcludes { + s.assertListExcludes(test.expect, secretList.Data) + } else { + s.assertListIsEqual(test.expect, secretList.Data) + } + + // Write human-readable request and response examples + if s.clusterID == "local" { + curlURL, err := getCurlURL(client, test.namespace, test.query) + require.NoError(s.T(), err) + if containsSortName.MatchString(test.query) && !containsSortNamespace.MatchString(test.query) { + // We're getting objects with the same name returned in random order based on namespace, + // so save them consistently w.r.t their namespace + multiplier := 1 + if containsReverseOrderSortName.MatchString(test.query) { + multiplier = -1 + } + steveAPIObjects := make([]*clientv1.SteveAPIObject, len(secretList.Data)) + for i, secret := range secretList.Data { + steveAPIObjects[i] = &secret + } + isSorted := slices.IsSortedFunc(steveAPIObjects, func(x, y *clientv1.SteveAPIObject) int { + return multiplier * strings.Compare(x.Name, y.Name) + }) + assert.True(s.T(), isSorted, "secretList.Data is not sorted by name") + secretList.Data = slices.SortedStableFunc(slices.Values(secretList.Data), + func(x, y clientv1.SteveAPIObject) int { + nameDiff := strings.Compare(x.Name, y.Name) + if nameDiff != 0 { + return multiplier * nameDiff + } + return multiplier * strings.Compare(x.Namespace, y.Namespace) + }) + } + for _, steveAPIObj := range secretList.Data { + fields := steveAPIObj.Fields + if len(fields) > 3 { + fieldValue := fields[3].(string) + if fieldValue != "0s" && relativeDateRx.MatchString(fieldValue) { + fields[3] = "0s" + } + } + } + pagination := secretList.Pagination + if pagination != nil { + pagination.First = containsNamespaceTag.ReplaceAllString(pagination.First, replacementNamespaceTag) + pagination.Next = containsNamespaceTag.ReplaceAllString(pagination.Next, replacementNamespaceTag) + } + + jsonResp, err := formatJSON(secretList) + require.NoError(s.T(), err) + jsonFilePath := filepath.Join(jsonDir, getFileName(test.user, test.namespace, test.query)) + err = writeResp(csvWriter, test.user, curlURL, jsonFilePath, jsonResp) + require.NoError(s.T(), err) + } + }) + } +} + +func getFileName(user, ns, query string) string { + if user == "" { + user = "none" + } + if ns == "" { + ns = "none" + } + if query == "" { + query = "none" + } else { + query = strings.ReplaceAll(query, "/", "%2F") + } + return user + "_" + ns + "_" + query + ".json" +} + +func getCurlURL(client *clientv1.Client, namespace, query string) (string, error) { + curlURL, err := client.APIBaseClient.Ops.GetCollectionURL(stevesecrets.SecretSteveType, "GET") + if err != nil { + return "", err + } + if namespace != "" { + curlURL += "/" + namespace + } + if query != "" { + curlURL += "?" + query + } + + curlURL = urlRegex.ReplaceAllString(curlURL, defautlUrlString) + return curlURL, nil +} + +func formatJSON(obj *clientv1.SteveCollection) ([]byte, error) { + jsonResp, err := json.Marshal(obj) + if err != nil { + return nil, err + } + var mapResp map[string]interface{} + err = json.Unmarshal(jsonResp, &mapResp) + if err != nil { + return nil, err + } + + mapResp["revision"] = "100" + if _, ok := mapResp["continue"]; ok { + mapResp["continue"] = continueToken + } + if pagination, ok := mapResp["pagination"].(map[string]interface{}); ok { + if next, ok := pagination["next"].(string); ok { + next = continueReg.ReplaceAllString(next, "${1}"+continueToken) + next = revisionReg.ReplaceAllString(next, "${1}"+revisionNum) + next = testLabelReg.ReplaceAllString(next, "${1}"+fakeTestID) + pagination["next"] = next + mapResp["pagination"] = pagination + } + } + data, ok := mapResp["data"].([]interface{}) + if ok { + for i := range data { + delete(data[i].(map[string]interface{}), "JSONResp") + delete(data[i].(map[string]interface{})["metadata"].(map[string]interface{}), "creationTimestamp") + delete(data[i].(map[string]interface{})["metadata"].(map[string]interface{}), "managedFields") + delete(data[i].(map[string]interface{})["metadata"].(map[string]interface{}), "uid") + data[i].(map[string]interface{})["metadata"].(map[string]interface{})["labels"].(map[string]interface{})[steveAPITestLabel] = fakeTestID + data[i].(map[string]interface{})["metadata"].(map[string]interface{})["resourceVersion"] = "1000" + } + mapResp["data"] = data + } + jsonBytes, err := json.MarshalIndent(mapResp, "", " ") + if err != nil { + return nil, err + } + jsonString := string(jsonBytes) + for k, v := range namespaceMap { + jsonString = strings.ReplaceAll(jsonString, v, k) + } + jsonString = urlRegex.ReplaceAllString(jsonString, defautlUrlString) + return []byte(jsonString), nil +} + +func setUpResults() (*csv.Writer, *os.File, string, error) { + outputFile := "output.csv" + fields := []string{"user", "url", "response"} + csvFile, err := os.OpenFile(outputFile, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644) + if err != nil { + return nil, nil, "", err + } + csvWriter := csv.NewWriter(bufio.NewWriter(csvFile)) + csvWriter.Write(fields) + if csvWriter.Error() != nil { + return nil, csvFile, "", err + } + jsonDir := "json" + err = os.MkdirAll(jsonDir, 0o755) + if err != nil { + return nil, csvFile, "", err + } + return csvWriter, csvFile, jsonDir, nil +} + +func writeResp(csvWriter *csv.Writer, user, url, path string, resp []byte) error { + jsonFile, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644) + if err != nil { + return err + } + jsonFile.Write(resp) + csvWriter.Write([]string{user, url, fmt.Sprintf("[%s](%s)", path, path)}) + return nil +} + +func (s *steveAPITestSuite) TestLinks() { + subSession := s.session.NewSession() + defer subSession.Cleanup() + + client, err := s.client.Steve.ProxyDownstream(s.clusterID) + require.NoError(s.T(), err) + + secretClient := client.SteveType(stevesecrets.SecretSteveType) + + secretObj, err := secretClient.Create(corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: namegenerator.AppendRandomString("steve-secret-squirrel"), + Namespace: namespaceMap["test-ns-1"], + }, + Data: map[string][]byte{"foo": []byte("bar")}, + }) + require.NoError(s.T(), err) + + readObj, err := secretClient.ByID(secretObj.ID) + require.NoError(s.T(), err) + + host := s.client.RancherConfig.Host + + id := readObj.JSONResp["id"].(string) + expectedID := secretObj.Namespace + "/" + secretObj.Name + links := readObj.JSONResp["links"].(map[string]any) + expectedLinks := map[string]any{ + "patch": fmt.Sprintf("https://%s/v1/secrets/%s", host, expectedID), + "remove": fmt.Sprintf("https://%s/v1/secrets/%s", host, expectedID), + "update": fmt.Sprintf("https://%s/v1/secrets/%s", host, expectedID), + "self": fmt.Sprintf("https://%s/v1/secrets/%s", host, expectedID), + "view": fmt.Sprintf("https://%s/api/v1/namespaces/%s/secrets/%s", host, secretObj.Namespace, secretObj.Name), + } + + // delete + err = secretClient.Delete(readObj) + require.NoError(s.T(), err) + + assert.Equal(s.T(), expectedID, id) + assert.Equal(s.T(), expectedLinks, links) +} + +func (s *steveAPITestSuite) TestCRUD() { + subSession := s.session.NewSession() + defer subSession.Cleanup() + + client, err := s.client.Steve.ProxyDownstream(s.clusterID) + require.NoError(s.T(), err) + + s.Run("global", func() { + secretClient := client.SteveType(stevesecrets.SecretSteveType) + + // create + secretObj, err := secretClient.Create(corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: namegenerator.AppendRandomString("steve-secret-garden"), + Namespace: namespaceMap["test-ns-1"], // need to specify the namespace for a namespaced resource if using a global endpoint ("/v1/secrets") + }, + Data: map[string][]byte{"foo": []byte("bar")}, + }) + require.NoError(s.T(), err) + + // read + readObj, err := secretClient.ByID(secretObj.ID) + require.NoError(s.T(), err) + assert.Contains(s.T(), readObj.JSONResp["data"], "foo") + + // update + updatedSecret := secretObj.JSONResp + updatedSecret["data"] = map[string][]byte{"lorem": []byte("ipsum")} + secretObj, err = secretClient.Update(secretObj, &updatedSecret) + require.NoError(s.T(), err) + + // read again + readObj, err = secretClient.ByID(secretObj.ID) + require.NoError(s.T(), err) + assert.Contains(s.T(), readObj.JSONResp["data"], "lorem") + + // delete + err = secretClient.Delete(readObj) + require.NoError(s.T(), err) + + // read again + readObj, err = secretClient.ByID(secretObj.ID) + require.Error(s.T(), err) + assert.Nil(s.T(), readObj) + }) + + s.Run("namespaced", func() { + secretClient := client.SteveType(stevesecrets.SecretSteveType).NamespacedSteveClient(namespaceMap["test-ns-1"]) + + // create + secretObj, err := secretClient.Create(corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: namegenerator.AppendRandomString("steve-secret-six"), + // no need to provide a namespace since using a namespaced endpoint ("/v1/secrets/test-ns-1") + }, + Data: map[string][]byte{"foo": []byte("bar")}, + }) + require.NoError(s.T(), err) + + // read + readObj, err := secretClient.ByID(secretObj.ID) + require.NoError(s.T(), err) + assert.Contains(s.T(), readObj.JSONResp["data"], "foo") + + // update + updatedSecret := secretObj.JSONResp + updatedSecret["data"] = map[string][]byte{"lorem": []byte("ipsum")} + secretObj, err = secretClient.Update(secretObj, &updatedSecret) + require.NoError(s.T(), err) + + // read again + readObj, err = secretClient.ByID(secretObj.ID) + require.NoError(s.T(), err) + assert.Contains(s.T(), readObj.JSONResp["data"], "lorem") + + // delete + err = secretClient.Delete(readObj) + require.NoError(s.T(), err) + + // read again + readObj, err = secretClient.ByID(secretObj.ID) + require.Error(s.T(), err) + assert.Nil(s.T(), readObj) + }) +} + +func (s *steveAPITestSuite) assertListIsEqual(expectedList []map[string]string, receivedList []clientv1.SteveAPIObject) { + assert.Equal(s.T(), len(expectedList), len(receivedList)) + receivedSubset := make([]map[string]string, len(receivedList)) + includeNamespace := false + if len(expectedList) > 0 { + _, includeNamespace = expectedList[0]["namespace"] + } + + for i, r := range receivedList { + vals := map[string]string{"name": r.Name} + if includeNamespace { + vals["namespace"] = r.Namespace + } else { + vals["namespace"] = "" + } + receivedSubset[i] = vals + } + expectedSubset := make([]map[string]string, len(expectedList)) + for i, w := range expectedList { + vals := map[string]string{"name": w["name"]} + if includeNamespace { + vals["namespace"] = namespaceMap[w["namespace"]] + } else { + vals["namespace"] = "" + } + expectedSubset[i] = vals + } + assert.Equal(s.T(), expectedSubset, receivedSubset) + length := len(expectedList) + if length > len(receivedList) { + length = len(receivedList) + } + for i := range length { + w := expectedList[i] + if name, ok := w["name"]; ok { + assert.Equal(s.T(), name, receivedList[i].Name, fmt.Sprintf("diff at index %d: expecting name %q, got %q", i, name, receivedList[i].Name)) + } + if ns, ok := w["namespace"]; includeNamespace && ok { + assert.Equal(s.T(), namespaceMap[ns], receivedList[i].Namespace, fmt.Sprintf("diff at index %d: expecting namespace mapped:%q (raw:%q), got %q", i, namespaceMap[ns], ns, receivedList[i].Namespace)) + } + } +} + +func (s *steveAPITestSuite) assertListContains(expect []map[string]string, list []clientv1.SteveAPIObject) { + assert.GreaterOrEqual(s.T(), len(list), len(expect)) + matches := true + for _, w := range expect { + found := false + for _, obj := range list { + if obj.Name == w["name"] && obj.Namespace == namespaceMap[w["namespace"]] { + found = true + break + } + } + if !found { + matches = false + } + } + assert.True(s.T(), matches, "list did not contain expected results") +} + +func (s *steveAPITestSuite) assertListExcludes(expect []map[string]string, list []clientv1.SteveAPIObject) { + found := false + for _, w := range expect { + for _, obj := range list { + if obj.Name == w["name"] && obj.Namespace == namespaceMap[w["namespace"]] { + found = true + break + } + } + if found == true { + break + } + } + assert.False(s.T(), found, "list contained unexpected results") +} + +func (s *steveAPITestSuite) createKubeconfig(client *http.Client) *extv1.Kubeconfig { + var err error + + if client == nil { + client, err = rest.HTTPClientFor(s.client.WranglerContext.RESTConfig) + require.NoError(s.T(), err) + } + + kubeconfig := &extv1.Kubeconfig{} + + resp, err := client.Post( + fmt.Sprintf("https://%s/v1/ext.cattle.io.kubeconfig", s.client.WranglerContext.RESTConfig.Host), + "application/json", + strings.NewReader(` + { + "apiVersion": "ext.cattle.io/v1", + "kind": "kubeconfig", + "metadata": { + "name": "test-kubeconfig" + }, + "spec": { + "clusters": ["local"], + "currentContent": "local", + "description": "kubeconfig for testing new kubeconfigs", + "ttl": 100 + } + }`), + ) + require.NoError(s.T(), err) + + body, err := io.ReadAll(resp.Body) + require.NoError(s.T(), err) + + require.NoError(s.T(), json.Unmarshal(body, kubeconfig)) + + return kubeconfig +} + +func retryRequest(fn func() error) error { + retriable := func(err error) bool { return strings.Contains(err.Error(), "tunnel disconnect") } + return retry.OnError(retry.DefaultBackoff, retriable, fn) +} + +func TestSteveLocal(t *testing.T) { + suite.Run(t, new(LocalSteveAPITestSuite)) +} + +func TestSteveDownstream(t *testing.T) { + // TODO: Re-enable the test when the bug is fixed + t.Skip() + suite.Run(t, new(DownstreamSteveAPITestSuite)) +} + +func newExtensionAPIRestConfig(rancherConfig *rancher.Config, clusterID string, bearerToken string) *rest.Config { + host := fmt.Sprintf("https://%s/ext", rancherConfig.Host) + if clusterID != "" { + host = fmt.Sprintf("https://%s/k8s/clusters/%s/ext", rancherConfig.Host, clusterID) + } + return &rest.Config{ + Host: host, + BearerToken: bearerToken, + TLSClientConfig: rest.TLSClientConfig{ + Insecure: *rancherConfig.Insecure, + CAFile: rancherConfig.CAFile, + }, + } +} From 5cf615ad0dbaaa8cb9f385318be25df305953383 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Tue, 18 Nov 2025 18:12:44 -0300 Subject: [PATCH 02/20] updated deps to match r/r --- go.mod | 110 ++++++++++++++++++++++++--------- go.sum | 189 ++++++++++++++++++++++++++++++++++++++------------------- 2 files changed, 211 insertions(+), 88 deletions(-) diff --git a/go.mod b/go.mod index 6ec444bbf..e026472c1 100644 --- a/go.mod +++ b/go.mod @@ -11,16 +11,46 @@ replace ( github.com/stretchr/testify => github.com/stretchr/testify v1.10.0 // This is needed because github.com/google/gnostic-models v0.70 uses go.yaml.in gopkg.in/yaml.v3 => go.yaml.in/yaml/v3 v3.0.1 - // And these are needed because k8s.io/* v0.33 uses gnostic-models v0.69 + + k8s.io/api => k8s.io/api v0.34.1 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.34.1 + k8s.io/apimachinery => k8s.io/apimachinery v0.34.1 + k8s.io/apiserver => k8s.io/apiserver v0.34.1 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.34.1 + k8s.io/client-go => k8s.io/client-go v0.34.1 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.34.1 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.34.1 + k8s.io/code-generator => k8s.io/code-generator v0.34.1 + k8s.io/component-base => k8s.io/component-base v0.34.1 + k8s.io/component-helpers => k8s.io/component-helpers v0.34.1 + k8s.io/controller-manager => k8s.io/controller-manager v0.34.1 + k8s.io/cri-api => k8s.io/cri-api v0.34.1 + k8s.io/cri-client => k8s.io/cri-client v0.34.1 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.34.1 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.34.1 + k8s.io/endpointslice => k8s.io/endpointslice v0.34.1 + k8s.io/externaljwt => k8s.io/externaljwt v0.34.1 + k8s.io/kms => k8s.io/kms v0.34.1 k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.34.1 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.34.1 k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.34.1 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.34.1 + k8s.io/kubectl => k8s.io/kubectl v0.34.1 + k8s.io/kubelet => k8s.io/kubelet v0.34.1 + k8s.io/kubernetes => k8s.io/kubernetes v1.34.1 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.34.1 + k8s.io/metrics => k8s.io/metrics v0.34.1 + k8s.io/mount-utils => k8s.io/mount-utils v0.34.1 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.34.1 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.34.1 ) require ( github.com/adrg/xdg v0.5.3 + github.com/creasty/defaults v1.8.0 github.com/evanphx/json-patch v5.9.11+incompatible - github.com/go-logr/logr v1.4.2 + github.com/go-logr/logr v1.4.3 github.com/golang/protobuf v1.5.4 github.com/google/gnostic-models v0.7.0 github.com/google/go-cmp v0.7.0 @@ -32,10 +62,12 @@ require ( github.com/rancher/apiserver v0.8.0 github.com/rancher/dynamiclistener v0.7.2-rc.3 github.com/rancher/kubernetes-provider-detector v0.1.6-0.20240606163014-fcae75779379 - github.com/rancher/lasso v0.2.5-rc.1 + github.com/rancher/lasso v0.2.5 github.com/rancher/norman v0.8.0 + github.com/rancher/rancher/pkg/apis v0.0.0-20251114145111-1ede64712337 github.com/rancher/remotedialer v0.6.0-rc.1 - github.com/rancher/wrangler/v3 v3.3.0-rc.2 + github.com/rancher/shepherd v0.0.0-20251111151559-050d62ead063 + github.com/rancher/wrangler/v3 v3.3.1 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.11.1 github.com/tinylib/msgp v1.5.0 @@ -43,27 +75,29 @@ require ( go.uber.org/mock v0.6.0 go.yaml.in/yaml/v3 v3.0.4 golang.org/x/sync v0.17.0 - google.golang.org/protobuf v1.36.9 + google.golang.org/protobuf v1.36.10 k8s.io/api v0.34.1 k8s.io/apiextensions-apiserver v0.34.1 k8s.io/apimachinery v0.34.1 k8s.io/apiserver v0.34.1 - k8s.io/client-go v0.34.1 + k8s.io/client-go v12.0.0+incompatible k8s.io/component-base v0.34.1 k8s.io/klog/v2 v2.130.1 k8s.io/kube-aggregator v0.34.1 k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b - k8s.io/kubernetes v1.33.1 - k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 + k8s.io/kubernetes v1.34.1 + k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 modernc.org/sqlite v1.39.0 - sigs.k8s.io/controller-runtime v0.21.0 + sigs.k8s.io/controller-runtime v0.22.3 sigs.k8s.io/yaml v1.6.0 ) require ( cel.dev/expr v0.24.0 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/aws/aws-sdk-go v1.55.8 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -79,6 +113,7 @@ require ( github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect + github.com/go-errors/errors v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect @@ -87,71 +122,92 @@ require ( github.com/google/btree v1.1.3 // indirect github.com/google/cel-go v0.26.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kubereboot/kured v1.13.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect + github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/philhofer/fwd v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.52.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect + github.com/rancher/aks-operator v1.13.0-rc.4 // indirect + github.com/rancher/ali-operator v1.13.0-rc.2 // indirect + github.com/rancher/eks-operator v1.13.0-rc.4 // indirect + github.com/rancher/fleet/pkg/apis v0.14.0-rc.1 // indirect + github.com/rancher/gke-operator v1.13.0-rc.3 // indirect + github.com/rancher/rke v1.8.0-rc.4 // indirect + github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20250930163923-f2c9e60b1078 // indirect + github.com/rancher/wrangler v1.1.2 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/cobra v1.9.1 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/cobra v1.10.1 // indirect + github.com/spf13/pflag v1.0.9 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect + github.com/xlab/treeprint v1.2.0 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect go.etcd.io/etcd/api/v3 v3.6.4 // indirect go.etcd.io/etcd/client/pkg/v3 v3.6.4 // indirect go.etcd.io/etcd/client/v3 v3.6.4 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect - go.opentelemetry.io/otel v1.35.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect + go.opentelemetry.io/otel v1.37.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.35.0 // indirect - go.opentelemetry.io/otel/sdk v1.34.0 // indirect - go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/otel/metric v1.37.0 // indirect + go.opentelemetry.io/otel/sdk v1.37.0 // indirect + go.opentelemetry.io/otel/trace v1.37.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect - golang.org/x/crypto v0.42.0 // indirect + golang.org/x/crypto v0.43.0 // indirect golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect - golang.org/x/net v0.44.0 // indirect - golang.org/x/oauth2 v0.27.0 // indirect - golang.org/x/sys v0.36.0 // indirect - golang.org/x/term v0.35.0 // indirect - golang.org/x/text v0.29.0 // indirect - golang.org/x/time v0.9.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect - google.golang.org/grpc v1.72.1 // indirect + golang.org/x/net v0.46.0 // indirect + golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/sys v0.37.0 // indirect + golang.org/x/term v0.36.0 // indirect + golang.org/x/text v0.30.0 // indirect + golang.org/x/time v0.13.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 // indirect + google.golang.org/grpc v1.75.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/cli-runtime v0.34.1 // indirect k8s.io/kms v0.34.1 // indirect modernc.org/libc v1.66.3 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect sigs.k8s.io/cli-utils v0.37.2 // indirect + sigs.k8s.io/cluster-api v1.10.6 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + sigs.k8s.io/kustomize/api v0.20.1 // indirect + sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect ) diff --git a/go.sum b/go.sum index 40b73f465..e86f6a1aa 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,17 @@ cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78= github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ= +github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -21,6 +27,11 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creasty/defaults v1.8.0 h1:z27FJxCAa0JKt3utc0sCImAEb+spPucmKoOdLHvHYKk= +github.com/creasty/defaults v1.8.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,9 +51,11 @@ github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sa github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -58,8 +71,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -75,8 +88,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs= -github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -84,7 +97,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0 h1:FbSCl+KggFl+Ocym490i/EyXF4lPgLoUtcSWquBM0Rs= @@ -95,6 +109,10 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5uk github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I= github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -109,30 +127,40 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kubereboot/kured v1.13.1 h1:mEOtzWRaLNt4ekzHMsuTH1/+6iAuQ3qKg4c7FJc8AXE= +github.com/kubereboot/kured v1.13.1/go.mod h1:clIzvBID0k5PqWwm0K7NbovdRcaD45oEBMg9Qyah1uQ= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= -github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= -github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= -github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns= +github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM= github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -140,6 +168,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.52.0 h1:ANs+jxSJz7Xylkw9GGrN7IFaVrEjhDyeRqikccPXbW8= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.52.0/go.mod h1:f7HML3SGY4Bf10YMdSWKUf2BdIIzQqlAvYh84px05BQ= github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= @@ -148,36 +178,59 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rancher/aks-operator v1.13.0-rc.4 h1:tc7p2gZmRg4c6VBwWTQJYwmh1hlN68kftjoBIdGCnqw= +github.com/rancher/aks-operator v1.13.0-rc.4/go.mod h1:1ZjZB6zGHK+NGchN9KLplq+xPxRRi+q6Uzet5bjFwxo= +github.com/rancher/ali-operator v1.13.0-rc.2 h1:a0biHGez+Np9XybJVh3yKN4RGPdaCzfM6D6cAXJac6o= +github.com/rancher/ali-operator v1.13.0-rc.2/go.mod h1:s5HznpxsN9LsgtX6u5UoW9dZNKnDLuXcwzQRAEoDcog= github.com/rancher/apiserver v0.8.0 h1:yCXsCa67X/Y///NKJ/pq6pv6wmt3hq/OIzBaIna2grY= github.com/rancher/apiserver v0.8.0/go.mod h1:Wb+Z8ktNyIuqt9hw30geFBQFJQucWTqgu6trxxMtcyM= github.com/rancher/dynamiclistener v0.7.2-rc.3 h1:geymeVB2kxxT6cGWl6p4emjW6HxLq/O1vkBLpSJHung= github.com/rancher/dynamiclistener v0.7.2-rc.3/go.mod h1:maKY4eN3hrEm9hi65ltyGIpCk/H5uTezEvLmqOXHN4U= +github.com/rancher/eks-operator v1.13.0-rc.4 h1:XowN8+m3QZTIBOBLzar4frtz0xtREb9kcX6KXhF4eas= +github.com/rancher/eks-operator v1.13.0-rc.4/go.mod h1:SbaKX2ttFWCxGOYkrKYeWH/6E4oToq2rRTcrMa2Mmdk= +github.com/rancher/fleet/pkg/apis v0.14.0-rc.1 h1:ZsDc25j4/iuKJ8DhxaOSnHdqOskRRe7QxJAdD9HBn28= +github.com/rancher/fleet/pkg/apis v0.14.0-rc.1/go.mod h1:oc+QHbx4P9guY34dr6UbzCOgt17Q9eSZhlyOs7xSinY= +github.com/rancher/gke-operator v1.13.0-rc.3 h1:a6U+7+XIbJPH2CE7/vFUx6RpThNbFl7fqIqkEBb6zmA= +github.com/rancher/gke-operator v1.13.0-rc.3/go.mod h1:TroxpmqMh63Hf4H5bC+2GYcgOCQp9kIUDfyKdNAMo6Q= github.com/rancher/kubernetes-provider-detector v0.1.6-0.20240606163014-fcae75779379 h1:/DKzOm5Du2jPLE5rXPGhsb0XeT68kWEIRi6jnzMeyGk= github.com/rancher/kubernetes-provider-detector v0.1.6-0.20240606163014-fcae75779379/go.mod h1:IfqyXrTiCAg8rTJodbGApTiORgujJnBH+QyHHJlFSII= -github.com/rancher/lasso v0.2.5-rc.1 h1:E88eG3FDYGmccJjGDjv7HrknSaYQz4WNGgJ/gGjmGFc= -github.com/rancher/lasso v0.2.5-rc.1/go.mod h1:71rWfv+KkdSmSxZ9Ly5QYhxAu0nEUcaq9N2ByjcHqAM= +github.com/rancher/lasso v0.2.5 h1:K++lWDDdfeN98Ixc1kCfUq0/q6tLjoHN++Np6QntXw0= +github.com/rancher/lasso v0.2.5/go.mod h1:71rWfv+KkdSmSxZ9Ly5QYhxAu0nEUcaq9N2ByjcHqAM= github.com/rancher/norman v0.8.0 h1://ZSe+B53cMgPNAbR7QBhzvIfWBxR4KaPWTKqG+g+O4= github.com/rancher/norman v0.8.0/go.mod h1:vZ5qL+eKodJ7zOMQYdl6jwMrSFrqTKpA+KYSFEKew2M= +github.com/rancher/rancher/pkg/apis v0.0.0-20251114145111-1ede64712337 h1:9tkMyb1Yk1uFZXsxtdJIVc4NnnwPTwrR/bFF0OgRf4k= +github.com/rancher/rancher/pkg/apis v0.0.0-20251114145111-1ede64712337/go.mod h1:xyYMxIycb9QpdxZjUxf95Cc4E27rfma8Z77U5ysRx3A= github.com/rancher/remotedialer v0.6.0-rc.1 h1:HMwcJjjT4irqM+d++jPcpjoNfhPCaxoHIyPzdpghZhE= github.com/rancher/remotedialer v0.6.0-rc.1/go.mod h1:CW6Q8F8IESN05/yl48OSwhVi54nDwVQQriV16zAiGkg= -github.com/rancher/wrangler/v3 v3.3.0-rc.2 h1:o/jNO0uQmcAUTxIwu7q3VBTkS82XDh7gb0Ofv0DpVoQ= -github.com/rancher/wrangler/v3 v3.3.0-rc.2/go.mod h1:0RpxDgbQ4Lgzfuy7JPNk5jZfTKJQoCN6qUhlrDgNY9E= +github.com/rancher/rke v1.8.0-rc.4 h1:jowVyaF3LsJonC7vNsAwWf3MONHAtEFUD/j3UzNSE5U= +github.com/rancher/rke v1.8.0-rc.4/go.mod h1:x9N1abruzDFMwTpqq2cnaDYpKCptlNoW8VraNWB6Pc4= +github.com/rancher/shepherd v0.0.0-20251111151559-050d62ead063 h1:dOsgYdfXh/xTu4posp1nzCE/ePN/Ce2fCsIgh1XqXFk= +github.com/rancher/shepherd v0.0.0-20251111151559-050d62ead063/go.mod h1:SJtW8Jqv0rphZzsGnvB965YdyR2FqFtB+TbbzVLt8F4= +github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20250930163923-f2c9e60b1078 h1:1MJSgYkgXhr/Zc5idJkKa10SiBQd0HVtbxVOBoghlzY= +github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20250930163923-f2c9e60b1078/go.mod h1:CV2Soy/Skw8/SA9dDJVgpeHxoEdtjYkNpNy6xvvC5kA= +github.com/rancher/wrangler v1.1.2 h1:oXbXo9k7y/H4drUpb4RM1c++vT9O3rpoNEfyusGykiU= +github.com/rancher/wrangler v1.1.2/go.mod h1:2k9MyhlBdjcutcBGoOJSUAz0HgDAXnMjv81d3n/AaQc= +github.com/rancher/wrangler/v3 v3.3.1 h1:YFqRfhxjuLNudUrvWrn+64wUPZ8pnn2KWbTsha75JLg= +github.com/rancher/wrangler/v3 v3.3.1/go.mod h1:0D4kZDaOUkP5W2Zfww/75tQwF9w7kaZgzpZG+4XQDAI= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= -github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= +github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= @@ -192,6 +245,8 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk= github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -214,22 +269,22 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 h1:x7wzEgXfnzJcHDwStJT+mxOz4etr2EcexjqhBvmoakw= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0/go.mod h1:rg+RlpR5dKwaS95IyyZqj5Wd4E13lk/msnTS0Xl9lJM= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= +go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= +go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= +go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= +go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -249,8 +304,8 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= -golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= +golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= +golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -261,10 +316,10 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= -golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= -golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= -golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= +golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= +golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= +golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -273,18 +328,19 @@ golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= -golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= -golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q= +golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= -golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= -golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= -golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= +golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI= +golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -295,16 +351,18 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= -gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= -google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb h1:TLPQVbx1GJ8VKZxz52VAxl1EBgKXXbTiU9Fc5fZeLn4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= -google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= -google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= -google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= -google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= +gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU= +google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 h1:CirRxTOwnRWVLKzDNrs0CXAaVozJoR4G9xvdRecrdpk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797/go.mod h1:HSkG/KdJWusxU1F6CNrwNDjBMgisKxGnc5dAZfT0mjQ= +google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= +google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -314,6 +372,7 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM= @@ -324,6 +383,8 @@ k8s.io/apimachinery v0.34.1 h1:dTlxFls/eikpJxmAC7MVE8oOeP1zryV7iRyIjB0gky4= k8s.io/apimachinery v0.34.1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= k8s.io/apiserver v0.34.1 h1:U3JBGdgANK3dfFcyknWde1G6X1F4bg7PXuvlqt8lITA= k8s.io/apiserver v0.34.1/go.mod h1:eOOc9nrVqlBI1AFCvVzsob0OxtPZUCPiUJL45JOTBG0= +k8s.io/cli-runtime v0.34.1 h1:btlgAgTrYd4sk8vJTRG6zVtqBKt9ZMDeQZo2PIzbL7M= +k8s.io/cli-runtime v0.34.1/go.mod h1:aVA65c+f0MZiMUPbseU/M9l1Wo2byeaGwUuQEQVVveE= k8s.io/client-go v0.34.1 h1:ZUPJKgXsnKwVwmKKdPfw4tB58+7/Ik3CrjOEhsiZ7mY= k8s.io/client-go v0.34.1/go.mod h1:kA8v0FP+tk6sZA0yKLRG67LWjqufAoSHA2xVGKw9Of8= k8s.io/component-base v0.34.1 h1:v7xFgG+ONhytZNFpIz5/kecwD+sUhVE6HU7qQUiRM4A= @@ -336,10 +397,10 @@ k8s.io/kube-aggregator v0.34.1 h1:WNLV0dVNoFKmuyvdWLd92iDSyD/TSTjqwaPj0U9XAEU= k8s.io/kube-aggregator v0.34.1/go.mod h1:RU8j+5ERfp0h+gIvWtxRPfsa5nK7rboDm8RST8BJfYQ= k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE= k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= -k8s.io/kubernetes v1.33.1 h1:86+VVY/f11taZdpEZrNciLw1MIQhu6BFXf/OMFn5EUg= -k8s.io/kubernetes v1.33.1/go.mod h1:2nWuPk0seE4+6sd0x60wQ6rYEXcV7SoeMbU0YbFm/5k= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kubernetes v1.34.1 h1:F3p8dtpv+i8zQoebZeK5zBqM1g9x1aIdnA5vthvcuUk= +k8s.io/kubernetes v1.34.1/go.mod h1:iu+FhII+Oc/1gGWLJcer6wpyih441aNFHl7Pvm8yPto= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/cc/v4 v4.26.2 h1:991HMkLjJzYBIfha6ECZdjrIYz2/1ayr+FL8GN+CNzM= modernc.org/cc/v4 v4.26.2/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= modernc.org/ccgo/v4 v4.28.0 h1:rjznn6WWehKq7dG4JtLRKxb52Ecv8OUGah8+Z/SfpNU= @@ -370,10 +431,16 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUo sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/cli-utils v0.37.2 h1:GOfKw5RV2HDQZDJlru5KkfLO1tbxqMoyn1IYUxqBpNg= sigs.k8s.io/cli-utils v0.37.2/go.mod h1:V+IZZr4UoGj7gMJXklWBg6t5xbdThFBcpj4MrZuCYco= -sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= -sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM= +sigs.k8s.io/cluster-api v1.10.6 h1:0bnLTpT47R8KIvGZ3tTGek0DwMIc8fZi6IxA3Mlqq4g= +sigs.k8s.io/cluster-api v1.10.6/go.mod h1:vymugs3Jm3gxHVMuVqdzgp6BVy/SEqQVyUg/UM7bnT4= +sigs.k8s.io/controller-runtime v0.22.3 h1:I7mfqz/a/WdmDCEnXmSPm8/b/yRTy6JsKKENTijTq8Y= +sigs.k8s.io/controller-runtime v0.22.3/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/kustomize/api v0.20.1 h1:iWP1Ydh3/lmldBnH/S5RXgT98vWYMaTUL1ADcr+Sv7I= +sigs.k8s.io/kustomize/api v0.20.1/go.mod h1:t6hUFxO+Ph0VxIk1sKp1WS0dOjbPCtLJ4p8aADLwqjM= +sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A78= +sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco= From 48e08280c0ffbdb861bb096f9c68e6db3618e6e3 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Tue, 18 Nov 2025 22:23:24 -0300 Subject: [PATCH 03/20] added testing action --- .github/workflows/test-rancher.yml | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/test-rancher.yml diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml new file mode 100644 index 000000000..4df02fb8b --- /dev/null +++ b/.github/workflows/test-rancher.yml @@ -0,0 +1,58 @@ +name: Test Rancher Integration + +on: + workflow_dispatch: + inputs: + rancher_image: + description: 'Rancher server image (leave empty to auto-detect)' + required: false + type: string + agent_image: + description: 'Rancher agent image (leave empty to auto-detect)' + required: false + type: string + skip_setup: + description: 'Skip running the setup program' + required: false + type: boolean + default: false + +jobs: + test-rancher: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + + - name: Install Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: 'go.mod' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Install k3d + run: | + curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.8.3 bash + + - name: Verify Docker and k3d installation + run: | + docker --version + k3d version + + - name: Build Rancher + run: | + bash scripts/build-rancher.sh + env: + BUILD_SAFE_DIRS: ${{ github.workspace }} + + - name: Test Rancher + run: | + bash scripts/test-rancher.sh + env: + RANCHER_IMAGE: ${{ inputs.rancher_image }} + RANCHER_AGENT_IMAGE: ${{ inputs.agent_image }} + CATTLE_BOOTSTRAP_PASSWORD: admin + continue-on-error: false + From bda7e92edd590eef019beacb719db4c900b72aae Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Tue, 18 Nov 2025 22:41:09 -0300 Subject: [PATCH 04/20] removed ununsed comments --- .github/workflows/ci.yaml | 1 + .github/workflows/test-rancher.yml | 28 ++++++++++------------------ scripts/build-rancher.sh | 2 +- scripts/test-rancher.sh | 17 ----------------- 4 files changed, 12 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2b0e9d9f4..96f0cf469 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,3 +35,4 @@ jobs: run: make test - name: Validate run: make validate + diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index 4df02fb8b..c2a1b59d6 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -1,25 +1,19 @@ name: Test Rancher Integration on: - workflow_dispatch: - inputs: - rancher_image: - description: 'Rancher server image (leave empty to auto-detect)' - required: false - type: string - agent_image: - description: 'Rancher agent image (leave empty to auto-detect)' - required: false - type: string - skip_setup: - description: 'Skip running the setup program' - required: false - type: boolean - default: false + pull_request: {} + push: + branches: + - master + - release/* jobs: test-rancher: - runs-on: ubuntu-latest + runs-on: + - runs-on + - spot=true + - runner=8cpu-linux-amd64 + - run-id=${{ github.run_id }} steps: - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 @@ -51,8 +45,6 @@ jobs: run: | bash scripts/test-rancher.sh env: - RANCHER_IMAGE: ${{ inputs.rancher_image }} - RANCHER_AGENT_IMAGE: ${{ inputs.agent_image }} CATTLE_BOOTSTRAP_PASSWORD: admin continue-on-error: false diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index e0b0f119d..5048aa133 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -8,7 +8,7 @@ RANCHER_DIR="/tmp/rancher-build/rancher" if [ -d "$RANCHER_DIR" ]; then echo "Rancher repository already exists at $RANCHER_DIR" - echo "Skipping clone. To force a fresh clone, remove the directory first: rm -rf $RANCHER_DIR" + echo "Skipping clone" else echo "Cloning rancher repository to $RANCHER_DIR..." mkdir -p "$(dirname "$RANCHER_DIR")" diff --git a/scripts/test-rancher.sh b/scripts/test-rancher.sh index 818848a81..c0bed7afa 100755 --- a/scripts/test-rancher.sh +++ b/scripts/test-rancher.sh @@ -2,17 +2,14 @@ set -e -# Get the absolute path of the steve directory (this repo) STEVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -# Initialize variables from environment or defaults RANCHER_IMAGE="${RANCHER_IMAGE:-}" RANCHER_AGENT_IMAGE="${RANCHER_AGENT_IMAGE:-}" CONTAINER_NAME="rancher-server-test" BOOTSTRAP_PASSWORD="${CATTLE_BOOTSTRAP_PASSWORD:-admin}" SKIP_SETUP=false -# Function to detect Rancher images if not provided detect_rancher_images() { local rancher_image=$1 local agent_image=$2 @@ -37,12 +34,10 @@ detect_rancher_images() { fi fi - # Return values via global variables (bash limitation) RANCHER_IMAGE="${rancher_image}" RANCHER_AGENT_IMAGE="${agent_image}" } -# Function to cleanup on exit cleanup() { echo "" echo "Cleaning up..." @@ -55,19 +50,16 @@ cleanup() { trap cleanup EXIT -# Function to detect the machine's primary IP address detect_rancher_ip() { local ip=$(hostname -I | awk '{print $1}') if [ -z "$ip" ]; then echo "Error: Could not determine IP address" >&2 return 1 fi - # Set global variable RANCHER_IP="$ip" echo "Using IP address: $RANCHER_IP" } -# Function to remove existing container if it exists remove_existing_container() { local container_name=$1 if docker ps -a --format '{{.Names}}' | grep -q "^${container_name}$"; then @@ -77,7 +69,6 @@ remove_existing_container() { fi } -# Function to start Rancher server container start_rancher_server() { local container_name=$1 local rancher_image=$2 @@ -111,7 +102,6 @@ start_rancher_server() { trap cleanup_logs EXIT } -# Function to wait for Rancher to be ready wait_for_rancher() { local rancher_ip=$1 local max_wait=${2:-300} # Default 5 minutes @@ -157,7 +147,6 @@ wait_for_rancher() { return 1 } -# Function to run the integration test setup run_setup() { local steve_dir=$1 local bootstrap_password=$2 @@ -173,20 +162,17 @@ run_setup() { echo "Running integration test setup..." cd "${steve_dir}/tests/integration/setup" - # Build setup binary if it doesn't exist if [ ! -f "./setup" ] || [ "./setup" -ot "./main.go" ]; then echo "Building setup binary..." go build -o setup . fi - # Run setup with required environment variables export CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" export CATTLE_AGENT_IMAGE="${agent_image}" export CATTLE_TEST_CONFIG="${steve_dir}/tests/integration/steveapi/steveapi.yaml" ./setup } -# Function to run integration tests run_integration_tests() { local steve_dir=$1 local bootstrap_password=$2 @@ -208,9 +194,7 @@ run_integration_tests() { echo "Integration tests completed!" } -# Main function main() { - # Parse command line arguments while [[ $# -gt 0 ]]; do case $1 in --rancher-image) @@ -268,5 +252,4 @@ main() { run_integration_tests "${STEVE_DIR}" "${BOOTSTRAP_PASSWORD}" "${RANCHER_AGENT_IMAGE}" } -# Call main function with all arguments main "$@" From b05f6f39c1c5234ec1a33e5a54e637aaf33dbf96 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Tue, 18 Nov 2025 23:50:22 -0300 Subject: [PATCH 05/20] added extra config to .github --- .github/runs-on.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/runs-on.yml diff --git a/.github/runs-on.yml b/.github/runs-on.yml new file mode 100644 index 000000000..adec41405 --- /dev/null +++ b/.github/runs-on.yml @@ -0,0 +1 @@ +_extends: .github-private \ No newline at end of file From f6368ce8d5eb3b2f5ee91bfb94c5c00fda297996 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:17:48 -0300 Subject: [PATCH 06/20] added space account --- .github/workflows/test-rancher.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index c2a1b59d6..61216e3e5 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -10,10 +10,8 @@ on: jobs: test-rancher: runs-on: - - runs-on - - spot=true - - runner=8cpu-linux-amd64 - - run-id=${{ github.run_id }} + - ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 From 6f6a79237e9f7972a274d44d0a78d40d2dbeedf0 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:19:01 -0300 Subject: [PATCH 07/20] added space indication, changed make test to ./pkg --- scripts/build-rancher.sh | 40 ++++++++++++++++++++++++++++++++++++++++ scripts/test-rancher.sh | 28 ++++++++++++++-------------- scripts/test.sh | 2 +- 3 files changed, 55 insertions(+), 15 deletions(-) diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index 5048aa133..cb757cd4f 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -2,6 +2,26 @@ set -e +show_disk_space() { + echo "" + echo "=== Disk Space Usage ===" + echo "Root filesystem:" + df -h / + echo "" + echo "/tmp filesystem:" + df -h /tmp 2>/dev/null || df -h | grep -E "(tmp|Filesystem)" + echo "" + if command -v docker &> /dev/null; then + echo "Docker disk usage:" + docker system df 2>/dev/null || echo "Docker not available or not running" + fi + echo "========================" + echo "" +} + +echo "Initial disk space:" +show_disk_space + STEVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" RANCHER_DIR="/tmp/rancher-build/rancher" @@ -9,10 +29,17 @@ RANCHER_DIR="/tmp/rancher-build/rancher" if [ -d "$RANCHER_DIR" ]; then echo "Rancher repository already exists at $RANCHER_DIR" echo "Skipping clone" + if [ -d "$RANCHER_DIR/.git" ]; then + echo "Repository size: $(du -sh "$RANCHER_DIR" 2>/dev/null | cut -f1)" + fi else + echo "Disk space before cloning:" + show_disk_space echo "Cloning rancher repository to $RANCHER_DIR..." mkdir -p "$(dirname "$RANCHER_DIR")" git clone https://github.com/rancher/rancher.git "$RANCHER_DIR" + echo "Disk space after cloning:" + show_disk_space fi cd "$RANCHER_DIR" @@ -20,9 +47,15 @@ cd "$RANCHER_DIR" echo "Adding replace directive for steve module..." go mod edit -replace github.com/rancher/steve="$STEVE_DIR" +echo "Disk space before go mod tidy:" +show_disk_space + echo "Running go mod tidy..." go mod tidy +echo "Disk space after go mod tidy:" +show_disk_space + echo "Running make quick..." STEVE_PARENT_DIR=$(dirname "$STEVE_DIR") if [ -n "$BUILD_SAFE_DIRS" ]; then @@ -31,8 +64,15 @@ else export BUILD_SAFE_DIRS="${STEVE_PARENT_DIR}" fi echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" + +echo "Disk space before make quick:" +show_disk_space + make quick +echo "Disk space after make quick:" +show_disk_space + echo "" echo "Detecting built images..." RANCHER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) diff --git a/scripts/test-rancher.sh b/scripts/test-rancher.sh index c0bed7afa..76d141a9a 100755 --- a/scripts/test-rancher.sh +++ b/scripts/test-rancher.sh @@ -147,11 +147,19 @@ wait_for_rancher() { return 1 } -run_setup() { +export_env_vars() { local steve_dir=$1 local bootstrap_password=$2 local agent_image=$3 - local skip_setup=$4 + + export CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" + export CATTLE_AGENT_IMAGE="${agent_image}" + export CATTLE_TEST_CONFIG="${steve_dir}/tests/integration/steveapi/steveapi.yaml" +} + +run_setup() { + local steve_dir=$1 + local skip_setup=$2 if [ "$skip_setup" = true ]; then echo "Skipping integration test setup..." @@ -167,26 +175,16 @@ run_setup() { go build -o setup . fi - export CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" - export CATTLE_AGENT_IMAGE="${agent_image}" - export CATTLE_TEST_CONFIG="${steve_dir}/tests/integration/steveapi/steveapi.yaml" ./setup } run_integration_tests() { local steve_dir=$1 - local bootstrap_password=$2 - local agent_image=$3 echo "" echo "Running integration tests..." cd "${steve_dir}" - # Export environment variables for tests - export CATTLE_BOOTSTRAP_PASSWORD="${bootstrap_password}" - export CATTLE_AGENT_IMAGE="${agent_image}" - export CATTLE_TEST_CONFIG="${steve_dir}/tests/integration/steveapi/steveapi.yaml" - # Run the tests go test -v ./tests/integration/... @@ -247,9 +245,11 @@ main() { wait_for_rancher "${RANCHER_IP}" 300 || exit 1 - run_setup "${STEVE_DIR}" "${BOOTSTRAP_PASSWORD}" "${RANCHER_AGENT_IMAGE}" "${SKIP_SETUP}" + export_env_vars "${STEVE_DIR}" "${BOOTSTRAP_PASSWORD}" "${RANCHER_AGENT_IMAGE}" + + run_setup "${STEVE_DIR}" "${SKIP_SETUP}" - run_integration_tests "${STEVE_DIR}" "${BOOTSTRAP_PASSWORD}" "${RANCHER_AGENT_IMAGE}" + run_integration_tests "${STEVE_DIR}" } main "$@" diff --git a/scripts/test.sh b/scripts/test.sh index 14f7c8b75..412cfd3c3 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -10,4 +10,4 @@ minor=$(go mod graph | grep ' k8s.io/client-go@' | head -n1 | cut -d@ -f2 | cut version="1.$minor.x" export KUBEBUILDER_ASSETS=$(setup-envtest use -p path "$version") -go test ./... +go test ./pkg/... From 879a65bde2d615bbdf5914c07332d2b82afc5765 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:33:29 -0300 Subject: [PATCH 08/20] added free space --- .github/workflows/test-rancher.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index 61216e3e5..e94ed1480 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -13,6 +13,17 @@ jobs: - ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 From a41611cbd5016dd89fbd6a7af6e3cb13ad8f124e Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:37:16 -0300 Subject: [PATCH 09/20] fixed action --- .github/workflows/test-rancher.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index e94ed1480..abc66405b 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -9,8 +9,7 @@ on: jobs: test-rancher: - runs-on: - - ubuntu-latest + runs-on: ubuntu-latest steps: - name: Free Disk Space (Ubuntu) From 41107d788d29f0d8d81464f96f65f341a33c2660 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:38:41 -0300 Subject: [PATCH 10/20] fixed action again --- .github/workflows/test-rancher.yml | 86 +++++++++++++++--------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index abc66405b..41eba731e 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -12,47 +12,47 @@ jobs: runs-on: ubuntu-latest steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - - name: Checkout repository - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - - - name: Install Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 - with: - go-version-file: 'go.mod' - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Install k3d - run: | - curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.8.3 bash - - - name: Verify Docker and k3d installation - run: | - docker --version - k3d version - - - name: Build Rancher - run: | - bash scripts/build-rancher.sh - env: - BUILD_SAFE_DIRS: ${{ github.workspace }} - - - name: Test Rancher - run: | - bash scripts/test-rancher.sh - env: - CATTLE_BOOTSTRAP_PASSWORD: admin - continue-on-error: false + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + + - name: Checkout repository + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + + - name: Install Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: 'go.mod' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Install k3d + run: | + curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.8.3 bash + + - name: Verify Docker and k3d installation + run: | + docker --version + k3d version + + - name: Build Rancher + run: | + bash scripts/build-rancher.sh + env: + BUILD_SAFE_DIRS: ${{ github.workspace }} + + - name: Test Rancher + run: | + bash scripts/test-rancher.sh + env: + CATTLE_BOOTSTRAP_PASSWORD: admin + continue-on-error: false From a637889369edfe7b9acf23f17d7b60ce23701785 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:39:55 -0300 Subject: [PATCH 11/20] fixed action again #2 --- .github/workflows/test-rancher.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index 41eba731e..5aca30f78 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -10,7 +10,6 @@ on: jobs: test-rancher: runs-on: ubuntu-latest - steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main From 196790161593f83db54715086344bd98bcc2dee1 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:43:52 -0300 Subject: [PATCH 12/20] changed to be manual --- .github/workflows/test-rancher.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index 5aca30f78..5e8d6644b 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -1,11 +1,7 @@ name: Test Rancher Integration on: - pull_request: {} - push: - branches: - - master - - release/* + workflow_dispatch: jobs: test-rancher: From b33b07c01704fa9c6dd0644b29fa4b7d7e39379c Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:53:34 -0300 Subject: [PATCH 13/20] created our own free space action --- .github/actions/free-disk-space/action.yml | 271 +++++++++++++++++++++ .github/workflows/test-rancher.yml | 27 +- 2 files changed, 288 insertions(+), 10 deletions(-) create mode 100644 .github/actions/free-disk-space/action.yml diff --git a/.github/actions/free-disk-space/action.yml b/.github/actions/free-disk-space/action.yml new file mode 100644 index 000000000..547bb89ab --- /dev/null +++ b/.github/actions/free-disk-space/action.yml @@ -0,0 +1,271 @@ +name: 'Free Disk Space' +description: 'Free disk space on Ubuntu runners by cleaning Docker, Go cache, and build artifacts' + +inputs: + docker-images: + description: 'Remove Docker images, containers, volumes, and build cache' + required: false + default: 'true' + go-cache: + description: 'Clean Go module cache and build cache' + required: false + default: 'true' + apt-cache: + description: 'Clean apt package cache' + required: false + default: 'true' + build-artifacts: + description: 'Remove build artifacts from /tmp' + required: false + default: 'true' + android: + description: 'Remove Android SDK and tools' + required: false + default: 'false' + large-packages: + description: 'Remove large packages (aspnetcore, dotnet, llvm, php, mongodb, mysql, azure-cli, browsers, etc.)' + required: false + default: 'false' + tool-cache: + description: 'Remove tool cache (Node, Go, Python, Ruby, etc.) from AGENT_TOOLSDIRECTORY' + required: false + default: 'false' + dotnet: + description: 'Remove .NET runtime' + required: false + default: 'false' + haskell: + description: 'Remove Haskell runtime' + required: false + default: 'false' + +runs: + using: composite + steps: + - name: Show disk space before cleanup + shell: bash + run: | + echo "=== Disk Space Before Cleanup ===" + df -h / + echo "" + if command -v docker &> /dev/null; then + echo "Docker disk usage:" + docker system df 2>/dev/null || true + fi + echo "==================================" + + - name: Clean Docker images, containers, volumes, and build cache + if: inputs.docker-images == 'true' + shell: bash + run: | + getAvailableSpace() { + df / | awk 'NR==2 {print $4}' + } + + printSavedSpace() { + local saved=$1 + local label=$2 + if [ $saved -gt 0 ]; then + if command -v bc &> /dev/null; then + local saved_gb=$(echo "scale=2; $saved/1024/1024" | bc) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_gb}GiB" + echo "********************************************************************************" + else + local saved_mb=$((saved/1024)) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_mb}MiB" + echo "********************************************************************************" + fi + fi + } + + if command -v docker &> /dev/null; then + echo "Cleaning Docker images..." + BEFORE=$(getAvailableSpace) + sudo docker image prune --all --force || true + AFTER=$(getAvailableSpace) + SAVED=$((AFTER-BEFORE)) + printSavedSpace $SAVED "Docker images" + + echo "Cleaning Docker containers, volumes, and build cache..." + docker system prune -af --volumes 2>/dev/null || true + docker builder prune -af 2>/dev/null || true + echo "Docker cleanup complete" + else + echo "Docker not available, skipping Docker cleanup" + fi + + - name: Remove tool cache + if: inputs.tool-cache == 'true' + shell: bash + run: | + getAvailableSpace() { + df / | awk 'NR==2 {print $4}' + } + + printSavedSpace() { + local saved=$1 + local label=$2 + if [ $saved -gt 0 ]; then + if command -v bc &> /dev/null; then + local saved_gb=$(echo "scale=2; $saved/1024/1024" | bc) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_gb}GiB" + echo "********************************************************************************" + else + local saved_mb=$((saved/1024)) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_mb}MiB" + echo "********************************************************************************" + fi + fi + } + + if [[ -n "$AGENT_TOOLSDIRECTORY" ]]; then + echo "Removing tool cache from $AGENT_TOOLSDIRECTORY..." + BEFORE=$(getAvailableSpace) + sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true + AFTER=$(getAvailableSpace) + SAVED=$((AFTER-BEFORE)) + printSavedSpace $SAVED "Tool cache" + else + echo "AGENT_TOOLSDIRECTORY not set, skipping tool cache cleanup" + fi + + - name: Clean Go module and build cache + if: inputs.go-cache == 'true' + shell: bash + run: | + if command -v go &> /dev/null; then + echo "Cleaning Go cache..." + go clean -modcache -cache -testcache 2>/dev/null || true + echo "Go cache cleanup complete" + else + echo "Go not available, skipping Go cache cleanup" + fi + + - name: Clean apt package cache + if: inputs.apt-cache == 'true' + shell: bash + run: | + echo "Cleaning apt cache..." + sudo apt-get clean 2>/dev/null || true + sudo apt-get autoremove -y 2>/dev/null || true + echo "Apt cache cleanup complete" + + - name: Remove build artifacts from /tmp + if: inputs.build-artifacts == 'true' + shell: bash + run: | + echo "Cleaning /tmp build artifacts..." + sudo find /tmp -type f -atime +1 -delete 2>/dev/null || true + sudo find /tmp -type d -empty -delete 2>/dev/null || true + echo "Build artifacts cleanup complete" + + - name: Remove Android SDK and tools + if: inputs.android == 'true' + shell: bash + run: | + echo "Removing Android SDK and tools..." + sudo rm -rf /usr/local/lib/android || true + echo "Android cleanup complete" + + - name: Remove large packages + if: inputs.large-packages == 'true' + shell: bash + run: | + echo "Removing large packages..." + sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^llvm-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^llvm-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." + sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." + echo "Large packages cleanup complete" + + - name: Remove .NET runtime + if: inputs.dotnet == 'true' + shell: bash + run: | + getAvailableSpace() { + df / | awk 'NR==2 {print $4}' + } + + printSavedSpace() { + local saved=$1 + local label=$2 + if [ $saved -gt 0 ]; then + if command -v bc &> /dev/null; then + local saved_gb=$(echo "scale=2; $saved/1024/1024" | bc) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_gb}GiB" + echo "********************************************************************************" + else + local saved_mb=$((saved/1024)) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_mb}MiB" + echo "********************************************************************************" + fi + fi + } + + echo "Removing .NET runtime..." + BEFORE=$(getAvailableSpace) + sudo rm -rf /usr/share/dotnet || true + AFTER=$(getAvailableSpace) + SAVED=$((AFTER-BEFORE)) + printSavedSpace $SAVED ".NET runtime" + + - name: Remove Haskell runtime + if: inputs.haskell == 'true' + shell: bash + run: | + getAvailableSpace() { + df / | awk 'NR==2 {print $4}' + } + + printSavedSpace() { + local saved=$1 + local label=$2 + if [ $saved -gt 0 ]; then + if command -v bc &> /dev/null; then + local saved_gb=$(echo "scale=2; $saved/1024/1024" | bc) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_gb}GiB" + echo "********************************************************************************" + else + local saved_mb=$((saved/1024)) + echo "********************************************************************************" + echo "=> $label: Saved ${saved_mb}MiB" + echo "********************************************************************************" + fi + fi + } + + echo "Removing Haskell runtime..." + BEFORE=$(getAvailableSpace) + sudo rm -rf /opt/ghc || true + sudo rm -rf /usr/local/.ghcup || true + AFTER=$(getAvailableSpace) + SAVED=$((AFTER-BEFORE)) + printSavedSpace $SAVED "Haskell runtime" + + - name: Show disk space after cleanup + shell: bash + run: | + echo "" + echo "=== Disk Space After Cleanup ===" + df -h / + echo "" + if command -v docker &> /dev/null; then + echo "Docker disk usage:" + docker system df 2>/dev/null || true + fi + echo "==================================" + diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index 5e8d6644b..c643ff33c 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -1,22 +1,29 @@ name: Test Rancher Integration on: - workflow_dispatch: + pull_request: {} + push: + branches: + - master + - release/* jobs: test-rancher: runs-on: ubuntu-latest steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main + - name: Free Disk Space + uses: ./.github/actions/free-disk-space with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true + docker-images: 'true' + go-cache: 'true' + apt-cache: 'true' + build-artifacts: 'true' + tool-cache: 'true' + android: 'true' + large-packages: 'true' + swap-storage: 'true' + dotnet: 'true' + haskell: 'true' - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 From dd3880a7769e66eea6447c936d3348740ccd4b1d Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 09:54:55 -0300 Subject: [PATCH 14/20] fixing action --- .github/workflows/test-rancher.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index c643ff33c..eef0e14f5 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -11,6 +11,9 @@ jobs: test-rancher: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + - name: Free Disk Space uses: ./.github/actions/free-disk-space with: @@ -25,9 +28,6 @@ jobs: dotnet: 'true' haskell: 'true' - - name: Checkout repository - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - - name: Install Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: From 96669940660451520d3315ae23877ee2ff13726b Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 10:24:27 -0300 Subject: [PATCH 15/20] improving image detection after build --- .github/workflows/test-rancher.yml | 4 +- scripts/build-rancher.sh | 71 ++++++++++++------------------ scripts/test-rancher.sh | 18 ++++++++ 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test-rancher.yml b/.github/workflows/test-rancher.yml index eef0e14f5..87ced2db5 100644 --- a/.github/workflows/test-rancher.yml +++ b/.github/workflows/test-rancher.yml @@ -24,7 +24,6 @@ jobs: tool-cache: 'true' android: 'true' large-packages: 'true' - swap-storage: 'true' dotnet: 'true' haskell: 'true' @@ -46,6 +45,7 @@ jobs: k3d version - name: Build Rancher + id: build-rancher run: | bash scripts/build-rancher.sh env: @@ -56,5 +56,7 @@ jobs: bash scripts/test-rancher.sh env: CATTLE_BOOTSTRAP_PASSWORD: admin + RANCHER_IMAGE: ${{ steps.build-rancher.outputs.rancher-image }} + RANCHER_AGENT_IMAGE: ${{ steps.build-rancher.outputs.rancher-agent-image }} continue-on-error: false diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index cb757cd4f..e76004ba1 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -2,26 +2,6 @@ set -e -show_disk_space() { - echo "" - echo "=== Disk Space Usage ===" - echo "Root filesystem:" - df -h / - echo "" - echo "/tmp filesystem:" - df -h /tmp 2>/dev/null || df -h | grep -E "(tmp|Filesystem)" - echo "" - if command -v docker &> /dev/null; then - echo "Docker disk usage:" - docker system df 2>/dev/null || echo "Docker not available or not running" - fi - echo "========================" - echo "" -} - -echo "Initial disk space:" -show_disk_space - STEVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" RANCHER_DIR="/tmp/rancher-build/rancher" @@ -29,17 +9,10 @@ RANCHER_DIR="/tmp/rancher-build/rancher" if [ -d "$RANCHER_DIR" ]; then echo "Rancher repository already exists at $RANCHER_DIR" echo "Skipping clone" - if [ -d "$RANCHER_DIR/.git" ]; then - echo "Repository size: $(du -sh "$RANCHER_DIR" 2>/dev/null | cut -f1)" - fi else - echo "Disk space before cloning:" - show_disk_space echo "Cloning rancher repository to $RANCHER_DIR..." mkdir -p "$(dirname "$RANCHER_DIR")" git clone https://github.com/rancher/rancher.git "$RANCHER_DIR" - echo "Disk space after cloning:" - show_disk_space fi cd "$RANCHER_DIR" @@ -47,15 +20,9 @@ cd "$RANCHER_DIR" echo "Adding replace directive for steve module..." go mod edit -replace github.com/rancher/steve="$STEVE_DIR" -echo "Disk space before go mod tidy:" -show_disk_space - echo "Running go mod tidy..." go mod tidy -echo "Disk space after go mod tidy:" -show_disk_space - echo "Running make quick..." STEVE_PARENT_DIR=$(dirname "$STEVE_DIR") if [ -n "$BUILD_SAFE_DIRS" ]; then @@ -64,28 +31,34 @@ else export BUILD_SAFE_DIRS="${STEVE_PARENT_DIR}" fi echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" - -echo "Disk space before make quick:" -show_disk_space - make quick -echo "Disk space after make quick:" -show_disk_space - echo "" echo "Detecting built images..." +echo "All rancher images:" +docker images | grep rancher || echo "No rancher images found" + RANCHER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) RANCHER_AGENT_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) if [ -z "$RANCHER_IMAGE" ]; then - echo "Warning: Could not detect rancher image, using default rancher/rancher:dev" - RANCHER_IMAGE="rancher/rancher:dev" + echo "Warning: Could not detect rancher image" + echo "Trying alternative detection method..." + RANCHER_IMAGE=$(docker images rancher/rancher --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) + if [ -z "$RANCHER_IMAGE" ]; then + echo "Warning: Still could not detect rancher image, using default rancher/rancher:dev" + RANCHER_IMAGE="rancher/rancher:dev" + fi fi if [ -z "$RANCHER_AGENT_IMAGE" ]; then - echo "Warning: Could not detect rancher-agent image, using default rancher/rancher-agent:dev" - RANCHER_AGENT_IMAGE="rancher/rancher-agent:dev" + echo "Warning: Could not detect rancher-agent image" + echo "Trying alternative detection method..." + RANCHER_AGENT_IMAGE=$(docker images rancher/rancher-agent --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) + if [ -z "$RANCHER_AGENT_IMAGE" ]; then + echo "Warning: Still could not detect rancher-agent image, using default rancher/rancher-agent:dev" + RANCHER_AGENT_IMAGE="rancher/rancher-agent:dev" + fi fi echo "" @@ -93,3 +66,13 @@ echo "Build complete! Docker images created:" echo " Rancher server: ${RANCHER_IMAGE}" echo " Rancher agent: ${RANCHER_AGENT_IMAGE}" +# Output for GitHub Actions +if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "rancher-image=${RANCHER_IMAGE}" >> "$GITHUB_OUTPUT" + echo "rancher-agent-image=${RANCHER_AGENT_IMAGE}" >> "$GITHUB_OUTPUT" +else + # Fallback for older GitHub Actions or local runs + echo "::set-output name=rancher-image::${RANCHER_IMAGE}" + echo "::set-output name=rancher-agent-image::${RANCHER_AGENT_IMAGE}" +fi + diff --git a/scripts/test-rancher.sh b/scripts/test-rancher.sh index 76d141a9a..efc3712d8 100755 --- a/scripts/test-rancher.sh +++ b/scripts/test-rancher.sh @@ -14,28 +14,46 @@ detect_rancher_images() { local rancher_image=$1 local agent_image=$2 + echo "Image detection - Input: rancher_image=${rancher_image}, agent_image=${agent_image}" + if [ -z "$rancher_image" ] || [ -z "$agent_image" ]; then echo "Detecting most recently built Rancher images..." + echo "All rancher images:" + docker images | grep rancher || echo "No rancher images found" if [ -z "$rancher_image" ]; then local detected_server=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) + if [ -z "$detected_server" ]; then + echo "Trying alternative detection method for rancher server..." + detected_server=$(docker images rancher/rancher --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) + fi if [ -n "$detected_server" ]; then rancher_image="$detected_server" echo " Detected rancher server image: ${rancher_image}" + else + echo " Warning: Could not detect rancher server image" fi fi if [ -z "$agent_image" ]; then local detected_agent=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) + if [ -z "$detected_agent" ]; then + echo "Trying alternative detection method for rancher agent..." + detected_agent=$(docker images rancher/rancher-agent --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) + fi if [ -n "$detected_agent" ]; then agent_image="$detected_agent" echo " Detected rancher agent image: ${agent_image}" + else + echo " Warning: Could not detect rancher agent image" fi fi fi RANCHER_IMAGE="${rancher_image}" RANCHER_AGENT_IMAGE="${agent_image}" + + echo "Image detection - Final: RANCHER_IMAGE=${RANCHER_IMAGE}, RANCHER_AGENT_IMAGE=${RANCHER_AGENT_IMAGE}" } cleanup() { From 6f34d13d1700d521d3748e827142e9cd77d86e7c Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 11:20:39 -0300 Subject: [PATCH 16/20] looking images generated --- scripts/build-rancher.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index e76004ba1..3c3a152b2 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -35,11 +35,17 @@ make quick echo "" echo "Detecting built images..." -echo "All rancher images:" +echo "All images:" +docker images +echo "--------------------------------" +echo "Rancher images:" docker images | grep rancher || echo "No rancher images found" +echo "--------------------------------" RANCHER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) +echo "RANCHER_IMAGE: ${RANCHER_IMAGE}" RANCHER_AGENT_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) +echo "RANCHER_AGENT_IMAGE: ${RANCHER_AGENT_IMAGE}" if [ -z "$RANCHER_IMAGE" ]; then echo "Warning: Could not detect rancher image" From 572d4f30ed8b2200e19eb9585128b8e9279d2dd7 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Thu, 20 Nov 2025 12:06:33 -0300 Subject: [PATCH 17/20] updated to get buildx cached image to docker images --- scripts/build-rancher.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index 3c3a152b2..a29b7dee4 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -33,6 +33,25 @@ fi echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" make quick +echo "Loading images from buildx cache to local Docker daemon..." +echo "Using values: REPO=${REPO}, TAG=${TAG}, OS=${OS}, ARCH=${ARCH}" + +# Load rancher server image +echo "Loading rancher server image from buildx cache..." +docker buildx build --load \ + --tag "${REPO}/rancher:${TAG}" \ + --platform "${OS}/${ARCH}" \ + --target server \ + --file ./package/Dockerfile . || echo "Warning: Could not load rancher server image" + +# Load rancher agent image +echo "Loading rancher agent image from buildx cache..." +docker buildx build --load \ + --tag "${REPO}/rancher-agent:${TAG}" \ + --platform "${OS}/${ARCH}" \ + --target agent \ + --file ./package/agent/Dockerfile ./package/agent || echo "Warning: Could not load rancher agent image" + echo "" echo "Detecting built images..." echo "All images:" From 79ef6b856eb3a41e0b55e352d3e05a54be89a964 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Fri, 21 Nov 2025 10:46:18 -0300 Subject: [PATCH 18/20] added env vars --- scripts/build-rancher.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index a29b7dee4..5316f55b9 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -33,7 +33,16 @@ fi echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" make quick +echo "" echo "Loading images from buildx cache to local Docker daemon..." + +# copied from make quick +COMMIT=$(git rev-parse --short HEAD) +TAG="${TAG:-$(grep -m1 ' TAG:' .github/workflows/pull-request.yml | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/\${{ github.sha }}/$COMMIT/g" | cut -d' ' -f2)}" +OS="${OS:-linux}" +ARCH="${ARCH:-amd64}" +REPO="${REPO:-rancher}" + echo "Using values: REPO=${REPO}, TAG=${TAG}, OS=${OS}, ARCH=${ARCH}" # Load rancher server image From f2658833283dee7194f01c96cea02ee790fb9147 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Fri, 21 Nov 2025 12:13:07 -0300 Subject: [PATCH 19/20] testing... --- scripts/build-rancher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index 5316f55b9..8f556eff9 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -41,7 +41,7 @@ COMMIT=$(git rev-parse --short HEAD) TAG="${TAG:-$(grep -m1 ' TAG:' .github/workflows/pull-request.yml | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/\${{ github.sha }}/$COMMIT/g" | cut -d' ' -f2)}" OS="${OS:-linux}" ARCH="${ARCH:-amd64}" -REPO="${REPO:-rancher}" +REPO="${REPO:-rancher}" echo "Using values: REPO=${REPO}, TAG=${TAG}, OS=${OS}, ARCH=${ARCH}" From 26dfd9d9331d59d72113ceeebcfd2115b89c0373 Mon Sep 17 00:00:00 2001 From: Felipe Gehrke Date: Mon, 24 Nov 2025 11:07:40 -0300 Subject: [PATCH 20/20] removed make quick and created simplified version of it inside build rancher --- scripts/build-rancher.sh | 258 ++++++++++++++++++++++++--------------- 1 file changed, 160 insertions(+), 98 deletions(-) diff --git a/scripts/build-rancher.sh b/scripts/build-rancher.sh index 8f556eff9..f8d6158ea 100755 --- a/scripts/build-rancher.sh +++ b/scripts/build-rancher.sh @@ -2,111 +2,173 @@ set -e +# Variables STEVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - RANCHER_DIR="/tmp/rancher-build/rancher" - -if [ -d "$RANCHER_DIR" ]; then - echo "Rancher repository already exists at $RANCHER_DIR" - echo "Skipping clone" -else - echo "Cloning rancher repository to $RANCHER_DIR..." - mkdir -p "$(dirname "$RANCHER_DIR")" - git clone https://github.com/rancher/rancher.git "$RANCHER_DIR" -fi - -cd "$RANCHER_DIR" - -echo "Adding replace directive for steve module..." -go mod edit -replace github.com/rancher/steve="$STEVE_DIR" - -echo "Running go mod tidy..." -go mod tidy - -echo "Running make quick..." STEVE_PARENT_DIR=$(dirname "$STEVE_DIR") -if [ -n "$BUILD_SAFE_DIRS" ]; then - export BUILD_SAFE_DIRS="${BUILD_SAFE_DIRS}:${STEVE_PARENT_DIR}" -else - export BUILD_SAFE_DIRS="${STEVE_PARENT_DIR}" -fi -echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" -make quick - -echo "" -echo "Loading images from buildx cache to local Docker daemon..." - -# copied from make quick -COMMIT=$(git rev-parse --short HEAD) -TAG="${TAG:-$(grep -m1 ' TAG:' .github/workflows/pull-request.yml | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/\${{ github.sha }}/$COMMIT/g" | cut -d' ' -f2)}" + +# Build variables (can be overridden by environment) OS="${OS:-linux}" ARCH="${ARCH:-amd64}" -REPO="${REPO:-rancher}" - -echo "Using values: REPO=${REPO}, TAG=${TAG}, OS=${OS}, ARCH=${ARCH}" - -# Load rancher server image -echo "Loading rancher server image from buildx cache..." -docker buildx build --load \ - --tag "${REPO}/rancher:${TAG}" \ - --platform "${OS}/${ARCH}" \ - --target server \ - --file ./package/Dockerfile . || echo "Warning: Could not load rancher server image" - -# Load rancher agent image -echo "Loading rancher agent image from buildx cache..." -docker buildx build --load \ - --tag "${REPO}/rancher-agent:${TAG}" \ - --platform "${OS}/${ARCH}" \ - --target agent \ - --file ./package/agent/Dockerfile ./package/agent || echo "Warning: Could not load rancher agent image" - -echo "" -echo "Detecting built images..." -echo "All images:" -docker images -echo "--------------------------------" -echo "Rancher images:" -docker images | grep rancher || echo "No rancher images found" -echo "--------------------------------" - -RANCHER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) -echo "RANCHER_IMAGE: ${RANCHER_IMAGE}" -RANCHER_AGENT_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) -echo "RANCHER_AGENT_IMAGE: ${RANCHER_AGENT_IMAGE}" - -if [ -z "$RANCHER_IMAGE" ]; then - echo "Warning: Could not detect rancher image" - echo "Trying alternative detection method..." - RANCHER_IMAGE=$(docker images rancher/rancher --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) +REPO="${REPO:-rancher}" +BUILD_SAFE_DIRS="${STEVE_PARENT_DIR}" +export BUILD_SAFE_DIRS + +# Global variables for build +COMMIT="" +TAG="" +BUILD_ARGS=() +RANCHER_IMAGE="" +RANCHER_AGENT_IMAGE="" + +# because macos doesn't have realpath apparently +abs_path() { + echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")" +} + +setup_rancher_dir() { + if [ -d "$RANCHER_DIR" ]; then + echo "Rancher repository already exists at $RANCHER_DIR" + echo "Skipping clone" + else + echo "Cloning rancher repository to $RANCHER_DIR..." + mkdir -p "$(dirname "$RANCHER_DIR")" + git clone https://github.com/rancher/rancher.git "$RANCHER_DIR" + fi + + cd "$RANCHER_DIR" + + # Build variables that depend on RANCHER_DIR + COMMIT=$(git rev-parse --short HEAD) + TAG="${TAG:-$(grep -m1 ' TAG:' .github/workflows/pull-request.yml | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/\${{ github.sha }}/$COMMIT/g" | cut -d' ' -f2)}" +} + +setup_go_mod() { + echo "Adding replace directive for steve module..." + go mod edit -replace github.com/rancher/steve="$STEVE_DIR" + echo "Running go mod tidy..." + go mod tidy +} + + +setup_build_args() { + BUILD_ARGS=() + BUILD_ARGS+=("--build-arg=VERSION=${TAG}") + BUILD_ARGS+=("--build-arg=ARCH=${ARCH}") + BUILD_ARGS+=("--build-arg=IMAGE_REPO=${REPO}") + BUILD_ARGS+=("--build-arg=COMMIT=${COMMIT}") + BUILD_ARGS+=("--build-arg=RANCHER_TAG=${TAG}") + BUILD_ARGS+=("--build-arg=RANCHER_REPO=${REPO}") +} + +add_context() { + if ! replace=$(grep "$1 =>" go.mod); then + return 0 + fi + if [ -n "$(echo "$replace" | cut -d= -f2 | cut -d' ' -f3)" ]; then + return 0 + fi + + godep=$(echo "$replace" | cut -d= -f2 | cut -d' ' -f2) + path=$(abs_path "$godep") + + BUILD_ARGS+=("--build-context=$2=$path") + BUILD_ARGS+=("--build-arg=$3=$2") + BUILD_ARGS+=("--build-arg=$3_PATH=$path") +} + +setup_build_context() { + add_context "github.com/rancher/steve" "steve-context" "GODEP_STEVE" + BUILD_ARGS+=("--build-arg=BUILD_WORKDIR=$PWD") +} + +build_server_image() { + echo "Building rancher server image..." + docker buildx build \ + "${BUILD_ARGS[@]}" \ + --load \ + --tag "${REPO}"/rancher:"${TAG}" \ + --platform="${OS}/${ARCH}" \ + --target server \ + --file ./package/Dockerfile . +} + +build_agent_image() { + echo "Building rancher agent image..." + docker buildx build \ + "${BUILD_ARGS[@]}" \ + --load \ + --tag "${REPO}"/rancher-agent:"${TAG}" \ + --platform="${OS}/${ARCH}" \ + --target agent \ + --file ./package/Dockerfile . +} + +detect_images() { + echo "" + echo "Detecting built images..." + echo "All images:" + docker images + echo "--------------------------------" + echo "Rancher images:" + docker images | grep rancher || echo "No rancher images found" + echo "--------------------------------" + + RANCHER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher" 2>/dev/null | head -n1) + echo "RANCHER_IMAGE: ${RANCHER_IMAGE}" + RANCHER_AGENT_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" --filter "reference=rancher/rancher-agent" 2>/dev/null | head -n1) + echo "RANCHER_AGENT_IMAGE: ${RANCHER_AGENT_IMAGE}" + if [ -z "$RANCHER_IMAGE" ]; then - echo "Warning: Still could not detect rancher image, using default rancher/rancher:dev" - RANCHER_IMAGE="rancher/rancher:dev" + echo "Warning: Could not detect rancher image" + echo "Trying alternative detection method..." + RANCHER_IMAGE=$(docker images rancher/rancher --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) + if [ -z "$RANCHER_IMAGE" ]; then + echo "Warning: Still could not detect rancher image, using default rancher/rancher:dev" + RANCHER_IMAGE="rancher/rancher:dev" + fi fi -fi -if [ -z "$RANCHER_AGENT_IMAGE" ]; then - echo "Warning: Could not detect rancher-agent image" - echo "Trying alternative detection method..." - RANCHER_AGENT_IMAGE=$(docker images rancher/rancher-agent --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) if [ -z "$RANCHER_AGENT_IMAGE" ]; then - echo "Warning: Still could not detect rancher-agent image, using default rancher/rancher-agent:dev" - RANCHER_AGENT_IMAGE="rancher/rancher-agent:dev" + echo "Warning: Could not detect rancher-agent image" + echo "Trying alternative detection method..." + RANCHER_AGENT_IMAGE=$(docker images rancher/rancher-agent --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -n1) + if [ -z "$RANCHER_AGENT_IMAGE" ]; then + echo "Warning: Still could not detect rancher-agent image, using default rancher/rancher-agent:dev" + RANCHER_AGENT_IMAGE="rancher/rancher-agent:dev" + fi fi -fi - -echo "" -echo "Build complete! Docker images created:" -echo " Rancher server: ${RANCHER_IMAGE}" -echo " Rancher agent: ${RANCHER_AGENT_IMAGE}" - -# Output for GitHub Actions -if [ -n "${GITHUB_OUTPUT:-}" ]; then - echo "rancher-image=${RANCHER_IMAGE}" >> "$GITHUB_OUTPUT" - echo "rancher-agent-image=${RANCHER_AGENT_IMAGE}" >> "$GITHUB_OUTPUT" -else - # Fallback for older GitHub Actions or local runs - echo "::set-output name=rancher-image::${RANCHER_IMAGE}" - echo "::set-output name=rancher-agent-image::${RANCHER_AGENT_IMAGE}" -fi - +} + +output_results() { + echo "" + echo "Build complete! Docker images created:" + echo " Rancher server: ${RANCHER_IMAGE}" + echo " Rancher agent: ${RANCHER_AGENT_IMAGE}" + + # Output for GitHub Actions + if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "rancher-image=${RANCHER_IMAGE}" >> "$GITHUB_OUTPUT" + echo "rancher-agent-image=${RANCHER_AGENT_IMAGE}" >> "$GITHUB_OUTPUT" + else + # Fallback for older GitHub Actions or local runs + echo "::set-output name=rancher-image::${RANCHER_IMAGE}" + echo "::set-output name=rancher-agent-image::${RANCHER_AGENT_IMAGE}" + fi +} + +main() { + echo "Building Rancher images..." + echo "Setting BUILD_SAFE_DIRS=${BUILD_SAFE_DIRS} to allow local replace directive" + + setup_rancher_dir + setup_go_mod + setup_build_args + setup_build_context + build_server_image + build_agent_image + detect_images + output_results +} + +main "$@"