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

feat(analyzer): let cluster resource case insensitive to fix name inconsistent #1547

Merged
merged 3 commits into from
May 21, 2024

Conversation

DexterYan
Copy link
Member

@DexterYan DexterYan commented May 20, 2024

Description, Motivation and Context

  • align all the names of kind to lower case
  • avoiding name inconsistent
  • add support for configmap

Demo:

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: default
spec:
  collectors:
    - cluster-resources: {}
  analyzers:
    - clusterResource:
        checkName: check-access-mode
        kind: deployment
        namespace: default
        name: strapi-db
        yamlPath: "spec.replicas"
        regex: "1"
        outcomes:
          - fail:
              when: "false"
              message: is not ReadWriteOnce
          - pass:
              when: "true"
              message: is ReadWriteOnce
    - clusterResource:
        checkName: check-cm-confg
        kind: configmap
        namespace: kube-public
        name: kube-root-ca.crt
        yamlPath: "metadata.name"
        regex: "kube-root-ca.crt"
        outcomes:
          - fail:
              when: "false"
              message: is not kube-root-ca
          - pass:
              when: "true"
              message: is kube-root-ca

Fixes : #1523

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR here

Does this PR introduce a breaking change?

  • Yes
  • No

@DexterYan DexterYan added type::bug Something isn't working bug::normal labels May 20, 2024
@DexterYan DexterYan requested a review from a team as a code owner May 20, 2024 04:18
@xavpaice xavpaice merged commit 51c07b4 into main May 21, 2024
27 checks passed
@xavpaice xavpaice deleted the dx/sc-103751/improve-cluster-resources-analyzer branch May 21, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug::normal type::bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClusterResource Analyzer Improvements
3 participants