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

K8s metadata #38

Merged
merged 2 commits into from
Dec 11, 2023
Merged

K8s metadata #38

merged 2 commits into from
Dec 11, 2023

Conversation

rsevilla87
Copy link
Member

@rsevilla87 rsevilla87 commented Nov 21, 2023

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization
  • Documentation Update

Description

Some updates required to make this library compatible with vanilla k8s

  • When infrastructure or the clusterversion resources are not found, assume that this is not an OCP cluster and return empty fields rather than crashing
  • Omitting empty metadata fields
  • Count control-plane nodes as masters

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please describe the System Under Test.
  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dc2da49) 83.33% compared to head (7840ef7) 83.33%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #38   +/-   ##
=======================================
  Coverage   83.33%   83.33%           
=======================================
  Files           6        6           
  Lines         312      312           
=======================================
  Hits          260      260           
  Misses         38       38           
  Partials       14       14           

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

metadata.ClusterType = v.Value
}
}
metadata.SDNType, err = meta.getSDNInfo()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need SDNType as well to be populated only when there are infra nodes present?

Copy link
Member Author

@rsevilla87 rsevilla87 Dec 5, 2023

Choose a reason for hiding this comment

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

infra does not refer to infra nodes but to the "infrastructure" object, which is only present in OpenShift clusters, same as config.openshift.io/v1/networks. for that reason when the infra object is not present, we don't try to get the sdnType

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I made this mistake too @vishnuchalla

Copy link
Member

@jtaleric jtaleric left a comment

Choose a reason for hiding this comment

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

lgtm!

@rsevilla87 rsevilla87 merged commit 33ff998 into cloud-bulldozer:main Dec 11, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants