Skip to content

Commit

Permalink
Add "You may not request a new project via this API" to potential fet…
Browse files Browse the repository at this point in the history
…ch 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.
  • Loading branch information
simu committed Feb 5, 2021
1 parent d5d0c5b commit 71e6a57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions dump-objects
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions known-to-fail
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ imagestreamimages
imagestreamimports
imagestreammappings
mutations
projectrequests
useridentitymappings
validations

0 comments on commit 71e6a57

Please sign in to comment.