Skip to content

Commit

Permalink
fix(provider/kubernetes): v2 Fix validation to not require namespace (#…
Browse files Browse the repository at this point in the history
…2422)

Access to resources that do not belong to any namespace should be
permitted, since there is no namespace to use for restricting access.
  • Loading branch information
wjoel authored and lwander committed Mar 13, 2018
1 parent 7168d23 commit 79c3e7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public boolean validateV2Credentials(AccountCredentialsProvider provider, String
return false;
}

if (!validateNotEmpty("namespace", namespace)) {
return false;
if (StringUtils.isEmpty(namespace)) {
return true;
}

AccountCredentials credentials = provider.getCredentials(accountName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class KubernetesValidationUtilSpec extends Specification {

where:
testNamespace || expectedResult
null || true
"" || true
"test-namespace" || true
"omit-namespace" || false
"unknown-namespace" || false
Expand Down

0 comments on commit 79c3e7d

Please sign in to comment.