From 71e6a57dbf61beb405924c96280e777cf55fe0bc Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Fri, 5 Feb 2021 15:00:38 +0100 Subject: [PATCH] Add "You may not request a new project via this API" to potential fetch errors When trying to `kubectl get projectrequests -ojson` as a ServiceAccount with cluster-reader permissions on OpenShift 4, the API server responds with the following output and error: ``` 1000840000@object-dumper-test:/$ kubectl get projectrequests -o json { "apiVersion": "v1", "items": [], "kind": "List", "metadata": { "resourceVersion": "", "selfLink": "" } } Error from server (Forbidden): You may not request a new project via this API. ``` This commit adds that error to the list of allowed errors when fetching objects. --- CHANGELOG.md | 3 ++- dump-objects | 1 + known-to-fail | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 074040a..cb49390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- … +- Add "You may not request a new project via this API" to potential fetch errors [#9] ## [v0.1.0] - 2020-10-16 @@ -35,3 +35,4 @@ Release as open source code [#4]: https://github.com/projectsyn/k8s-object-dumper/pull/4 [#5]: https://github.com/projectsyn/k8s-object-dumper/pull/5 [#6]: https://github.com/projectsyn/k8s-object-dumper/pull/6 +[#9]: https://github.com/projectsyn/k8s-object-dumper/pull/9 diff --git a/dump-objects b/dump-objects index 16bcb1d..08d5c88 100755 --- a/dump-objects +++ b/dump-objects @@ -252,6 +252,7 @@ fetch_objects() { -e "^${errprefix}Unable to list {\".*\" \"v1\" \"${kind}\"}: the server could not find the requested resource\$" \ -e "^${errprefix}Unable to list \".*/v1, Resource=${kind}\": the server could not find the requested resource\$" \ -e "^${errprefix}the server doesn't have a resource type \"${kind}\"\$" \ + -e "^${errprefix}You may not request a new project via this API.\$" \ <<< "$error" then return "$EX_PROTOCOL" diff --git a/known-to-fail b/known-to-fail index c6c61f0..39c5d3f 100644 --- a/known-to-fail +++ b/known-to-fail @@ -8,5 +8,6 @@ imagestreamimages imagestreamimports imagestreammappings mutations +projectrequests useridentitymappings validations