Skip to content
Snippets Groups Projects
Commit 76b252ec authored by Yas Naoi's avatar Yas Naoi
Browse files

Issue #3261006 by yas, Xiaohua Guan: Fix an error to handle an empty apiGroups...

Issue #3261006 by yas, Xiaohua Guan: Fix an error to handle an empty apiGroups field in a rule of K8s role
parent da383484
No related branches found
No related tags found
1 merge request!626Issue #3261006: Fix an error to handle an empty apiGroups field in a rule of K8s role
......@@ -32,9 +32,9 @@ class K8sClient extends Client {
) {
try {
if ($method === 'PUT' || $method === 'POST') {
// If the resource type is cluster role, the apiGroups maybe empty,
// and it cannot be removed.
if ($uri !== '/clusterroles') {
// If the resource type is role or cluster role, the apiGroups maybe
// empty, and it cannot be removed.
if (!in_array($uri, ['/roles', '/clusterroles'], TRUE)) {
$array = $this->removeEmptyProperties(json_decode($body, TRUE));
$body = json_encode($array, JSON_PRETTY_PRINT);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment