replicatedhq / troubleshoot

Preflight Checks and Support Bundles Framework for Kubernetes Applications
https://troubleshoot.sh
Apache License 2.0
539 stars 92 forks source link

WIP: feat(lint): add troubleshoot lint #1532

Open DexterYan opened 2 months ago

DexterYan commented 2 months ago

Description, Motivation and Context


It will return a error and tips

distribution is empty outcomes is misaligned in distribution Error: Warning: Wrong analyzer found


Screenshot:
<img width="992" alt="Screenshot 2024-04-26 at 6 31 10 PM" src="https://github.com/replicatedhq/troubleshoot/assets/5716585/597eca00-40f2-43c6-96bf-948b09013a00">

In a more complicated case like

apiVersion: troubleshoot.sh/v1beta2 kind: SupportBundle metadata: name: default spec: collectors:

it will return

====================
distribution analyzer is empty
--------------------
outcomes is misaligned in distribution
====================
textAnalyze analyzer is empty
--------------------
checkName is misaligned in textAnalyze
fileName is misaligned in textAnalyze
regexGroups is misaligned in textAnalyze
outcomes is misaligned in textAnalyze
Error: Warning: Wrong analyzer found
Screenshot 2024-04-26 at 11 17 49 PM

sc-103245

Checklist

Does this PR introduce a breaking change?