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

Host analysers are not deduplicating during multiple spec merges #1485

Closed
ricardomaraschini opened this issue Feb 22, 2024 · 0 comments · Fixed by #1542
Closed

Host analysers are not deduplicating during multiple spec merges #1485

ricardomaraschini opened this issue Feb 22, 2024 · 0 comments · Fixed by #1542
Assignees

Comments

@ricardomaraschini
Copy link
Member

Bug Description

If I have the same host analyser defined in two different specs they end up showing twice when I run kubectl support-bundle spec0 spec1. The same does not happen with a regular analyser, only with host analysers. It seems like the same deduplication applied for analysers is not applied for host analysers.

Expected Behavior

My duplicated host analyser to show up only once.

Steps To Reproduce

Create two specs with the same host analyser:

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: embedded-cluster-host-support-bundle
spec:
  hostCollectors:
  - memory: {}
  hostAnalyzers:
  - memory:
      checkName: Amount of Memory
      outcomes:
      - warn:
          when: "< 2G"
          message: At least 2G of memory is recommended
      - pass:
          message: The system has at least 2G of memory

Then run the support-bundle passing both specs:

kubectl support-bundle spec0.yaml spec1.yaml

With the --dry-run flag I can see that the same host analyser is duplicated in the merged result.

@ricardomaraschini ricardomaraschini changed the title Host collectors are not deduplicating during multiple spec merges Host analysers are not deduplicating during multiple spec merges Feb 22, 2024
@nvanthao nvanthao self-assigned this May 1, 2024
nvanthao added a commit that referenced this issue May 16, 2024
… spec merges #1485 (#1542)

* dedupe host collector and analyzer

* dedup analyzer

* add unit test

* use generic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants