Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 use fully qualified names for k8s resources #4332

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Conversation

imilchev
Copy link
Member

We aren't using fully qualified names for the k8s resources when we request them from the API. This is causing issues when there is more than 1 resource that matches by name.

To reproduce the original problem start a fresh minikube instance and install a jobs crd:

kubectl apply -f https://raw.githubusercontent.com/crossplane-contrib/provider-aws/master/package/crds/batch.aws.crossplane.io_jobs.yaml

Then run cnspec scan k8s. You will see the following error:

cnspec scan k8s                                                  
→ loaded configuration from /Users/ivanmilchev/.config/mondoo/mondoo.yml using source default
→ using service account credentials
→ discover related assets for 1 asset(s)
x unable to create runtime for asset error="rpc error: code = Unknown desc = ambiguous kind \"jobs\". use one of these as the KIND disambiguate: [jobs.v1.batch, jobs.v1alpha1.batch.aws.crossplane.io]" asset=
Asset: 
-------

error: rpc error: code = Unknown desc = ambiguous kind "jobs". use one of these as the KIND disambiguate: [jobs.v1.batch, jobs.v1alpha1.batch.aws.crossplane.io]


Scanned 1 asset

When using the fully qualified names, the issue is resolved.

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
Copy link
Contributor

github-actions bot commented Jul 12, 2024

Test Results

3 073 tests  ±0   3 072 ✅ ±0   1m 21s ⏱️ -2s
  363 suites ±0       1 💤 ±0 
   27 files   ±0       0 ❌ ±0 

Results for commit ed0f3d0. ± Comparison against base commit bc3c52d.

♻️ This comment has been updated with latest results.

@imilchev imilchev force-pushed the ivan/k8s-resources branch from 232ce11 to ed0f3d0 Compare July 12, 2024 09:13
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
@imilchev imilchev force-pushed the ivan/k8s-resources branch from ed0f3d0 to 23830b7 Compare July 12, 2024 09:17
@imilchev imilchev merged commit 03f691f into main Jul 12, 2024
7 checks passed
@imilchev imilchev deleted the ivan/k8s-resources branch July 12, 2024 10:01
@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants