Skip to content

Instantly share code, notes, and snippets.

@dmkvl
Created May 14, 2019 13:44
Show Gist options
  • Save dmkvl/d59e910d1599c7d7d70e1976e1aad118 to your computer and use it in GitHub Desktop.
Save dmkvl/d59e910d1599c7d7d70e1976e1aad118 to your computer and use it in GitHub Desktop.
k8s-role-comparison.sh
cat etl-role.json | \
jq '[[.rules[] | [.apiGroups, .resources, .verbs]][] | combinations | join(".")] | unique' | \
jq ". | inside(\
$(kubectl -n dashboard get role artifact-installer -o json | \
jq '[[.rules[] | [.apiGroups, .resources, .verbs]][] | combinations | join(".")] | unique'))" && \
echo $(cat etl-role.json | \
jq '[[.rules[] | [.apiGroups, .resources, .verbs]][] | combinations | join(".")] | unique | length') ' == ' \
$(kubectl -n dashboard get role artifact-installer -o json | \
jq '[[.rules[] | [.apiGroups, .resources, .verbs]][] | combinations | join(".")] | unique | length')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment