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 function to look up arbitrary resource names in discovery cache #214

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

jinnovation
Copy link
Owner

To implement #212, we need the ability to convert from the kind name, e.g. Pod, to the plural form, e.g. pods. This would be analogous to the existing kele--get-singular-for-plural, e.g. kele--get-plural-for-kind.

Since we'd rather not implement one function for each 2-permutation of singular/plural/kind, we generalize the existing get-singular-for-plural to allow for looking up a "discovery resource" by any given key within it. This will allow us to look up with, say, singularName, and use the retval to get the kind.

To implement #212, we need the ability to convert from the kind name,
e.g. `Pod`, to the plural form, e.g. `pods`. This would be analogous to the
existing `kele--get-singular-for-plural`, e.g. `kele--get-plural-for-kind`.

Since we'd rather not implement one function for each 2-permutation of
singular/plural/kind, we generalize the existing `get-singular-for-plural` to
allow for looking up a "discovery resource" by any given key within it. This
will allow us to look up with, say, `singularName`, and use the retval to get
the `kind`.
@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.90%. Comparing base (8082e53) to head (96177be).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   62.86%   62.90%   +0.04%     
==========================================
  Files           1        1              
  Lines         762      763       +1     
==========================================
+ Hits          479      480       +1     
  Misses        283      283              

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

@jinnovation jinnovation merged commit feb048d into main Jun 6, 2024
5 checks passed
@jinnovation jinnovation deleted the jinnovation/discovery-resource-lookup branch June 6, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants