cnti-testcatalog / testsuite

šŸ“žšŸ“±ā˜ŽļøšŸ“”šŸŒ Cloud Native Telecom Initiative (CNTI) Test Catalog is a tool to check for and provide feedback on the use of K8s + cloud native best practices in networking applications and platforms
https://wiki.lfnetworking.org/display/LN/Test+Catalog
Apache License 2.0
169 stars 70 forks source link

[BUG] `service_account_mapping` test does not fail if the CNF includes an auto-mounted service account. #2003

Open HashNuke opened 2 months ago

HashNuke commented 2 months ago

Describe the bug

service_account_mapping should fail if the CNF includes an auto-mounted service account.

CleanShot 2024-04-25 at 03 01 49@2x

Possible cause

When the resources for the CNF are collected, the Service Accounts are not collected.

KubectlClient::WORKLOAD_RESOURCES needs to be updated to include service accounts.

CleanShot 2024-04-25 at 03 08 08@2x

To reproduce

./cnf-testsuite cnf_setup cnf-config=./sample-cnfs/sample-service-accounts/cnf-testsuite.yml
./cnf-testsuite service_account_mapping

The test should fail, but it instead passes.

This output was from upgraded kubescape version from another branch. But that shouldn't matter, it looks like the bug should be present in the main branch too.

HashNuke commented 2 months ago

This is fixed in #2004 to help the build pass.

HashNuke commented 2 months ago

The dependency kubectl_client had to be fixed. Will open a PR for that soon.