-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added plugins to show provider and consumer permissions. (#1193)
The plugins take namespace in which Kubeplus is installed as input. They retrieve the permissions associated with kubeplus-saas-provider and kubeplus-saas-consumer serveraccounts, which Kubeplus creates for the provider and consumer. Fixes: #1188
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
source utils.sh | ||
|
||
print_help () { | ||
echo "NAME" | ||
echo " kubectl show consumer permissions" | ||
echo "" | ||
echo "SYNOPSIS" | ||
echo " kubectl show consumer permissions <Namespace>" | ||
echo "" | ||
echo "DESCRIPTION" | ||
echo " kubectl show consumer permissions shows the permissions for kubeplus-saas-consumer service account in the namespace where kubeplus is installed." | ||
exit 0 | ||
} | ||
|
||
if (( $# < 1 || $# >= 2)); then | ||
print_help | ||
fi | ||
|
||
namespace="$1" | ||
|
||
check_namespace $namespace | ||
|
||
kubectl auth can-i --list --as=system:serviceaccount:$namespace:kubeplus-saas-consumer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
source utils.sh | ||
|
||
print_help () { | ||
echo "NAME" | ||
echo " kubectl show provider permissions" | ||
echo "" | ||
echo "SYNOPSIS" | ||
echo " kubectl show provider permissions <Namespace>" | ||
echo "" | ||
echo "DESCRIPTION" | ||
echo " kubectl show provider permissions shows the permissions for kubeplus-saas-provider service account in the namespace where kubeplus is installed." | ||
exit 0 | ||
} | ||
|
||
if (( $# < 1 || $# >= 2)); then | ||
print_help | ||
fi | ||
|
||
namespace="$1" | ||
|
||
check_namespace $namespace | ||
|
||
kubectl auth can-i --list --as=system:serviceaccount:$namespace:kubeplus-saas-provider |