Skip to content

Fix(diagnostics): continue get/describe on errors in diagnostics#1492

Merged
randmonkey merged 2 commits intomainfrom
fix/diag_continue_describe_on_errors
Mar 11, 2026
Merged

Fix(diagnostics): continue get/describe on errors in diagnostics#1492
randmonkey merged 2 commits intomainfrom
fix/diag_continue_describe_on_errors

Conversation

@randmonkey
Copy link
Contributor

Currently the get all/dump all step in diagnostics stops on errors in executing commands. It would fail if there are resources gets deleted during the dumping:

could not get resources for cmd '/usr/bin/kubectl --kubeconfig /tmp/-kubeconfig-2ed3afab-13a2-4da2-846c-bf95ae6b02eb2970318129 describe --all-namespaces configmaps': err exit status 1, stderr: Error from server (NotFound): configmaps "kube-root-ca.crt" not found

When this happens, the getAll and describe all stops and dump of other resources are skipped. We should continue the dumping of other resources anyways to dump as much information as we can.

@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.28%. Comparing base (3b8e5ff) to head (056f8cf).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/clusters/diagnostics.go 50.00% 2 Missing ⚠️
pkg/clusters/addons/registry/addon.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1492      +/-   ##
==========================================
+ Coverage   41.27%   41.28%   +0.01%     
==========================================
  Files          57       57              
  Lines        3741     3742       +1     
==========================================
+ Hits         1544     1545       +1     
+ Misses       1952     1951       -1     
- Partials      245      246       +1     
Flag Coverage Δ
integration-test 45.18% <50.00%> (-0.11%) ⬇️
unit-test 2.41% <0.00%> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@randmonkey randmonkey merged commit 0922a0a into main Mar 11, 2026
46 checks passed
@randmonkey randmonkey deleted the fix/diag_continue_describe_on_errors branch March 11, 2026 08:54
Comment on lines +69 to +72
// Review: Should we traverse the list manually instead of describing all in one command? The `describe <resource-type> -A` actually performs like:
// - List all resources
// - Describe the resources one by one
// In the process of diagnostics, the cleanup is in process and some resources may disappear so errors may happen and we lose the describe result for remaining resources.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randmonkey I believe we merged this accidentally 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants