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

Add support for CPU architecture to cpu host collector/analyser #1584

Open
banjoh opened this issue Jul 23, 2024 · 0 comments
Open

Add support for CPU architecture to cpu host collector/analyser #1584

banjoh opened this issue Jul 23, 2024 · 0 comments
Labels
good first issue Good for newcomers type::feature New feature or request

Comments

@banjoh
Copy link
Member

banjoh commented Jul 23, 2024

Describe the rationale for the suggested feature.

In some environments, someone may want to check what CPU architecture the system is running on so as to be able to perform preflight checks before deployments e.g an application that's not built for ARM may have a preflight failure for arm64 architecture

Describe the feature

Extent https://troubleshoot.sh/docs/host-collect-analyze/cpu/ host collector/analyser

  hostAnalyzers:
    - cpu:
        checkName: "Check machine architecture"
        outcomes:
          - fail:
              when: "machineArch != x86_64"
              message: This server is not x86_64
          - fail:
              when: "machineArch == amd64"
              message: This server is amd64
  • Add Info.MachineArch template to allow crafting outcome messages such as {{ Info.MachineArch }} machine architecture is not supported

Describe alternatives you've considered

One can use a combination of run collector and regex analyser like so to achieve the same result. The message template bit would be missing though

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: run
spec:
  hostCollectors:
    - run:
        collectorName: "uname-m"
        command: "sh"
        args: ["-c", "uname -m"]
  hostAnalyzers:
    - textAnalyze:
        checkName: "uname-m"
        file: "host-collectors/run-host/uname-m.txt"
        matchRegex: "x86_64|aarch64|arm64"
        outcomes:
          - pass:
              when: "pass"
              message: "Architecture is supported"
          - fail:
              message: "Architecture is not supported"
@banjoh banjoh added type::feature New feature or request good first issue Good for newcomers labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type::feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant