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

fix: allow getting resources with number as name #571

Merged
merged 4 commits into from
Dec 20, 2024
Merged

Conversation

phm07
Copy link
Contributor

@phm07 phm07 commented Dec 19, 2024

If the name of a user-named resource was numeric, it was impossible to Get it from its name, since a number would always be interpreted as an ID. This PR fixes this behavior on user-namable resources by continuing to check if a resource with the given idOrName exists even though the idOrName is numeric and no resource with the given ID was found.

See hetznercloud/cli#874

@phm07 phm07 self-assigned this Dec 19, 2024
@phm07 phm07 requested a review from a team as a code owner December 19, 2024 16:41
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 4 lines in your changes missing coverage. Please review.

Project coverage is 68.00%. Comparing base (51baf8d) to head (75b6ace).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hcloud/image.go 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #571      +/-   ##
==========================================
+ Coverage   67.87%   68.00%   +0.12%     
==========================================
  Files          47       47              
  Lines        4912     4938      +26     
==========================================
+ Hits         3334     3358      +24     
- Misses       1170     1172       +2     
  Partials      408      408              

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

hcloud/certificate.go Outdated Show resolved Hide resolved
@phm07 phm07 requested a review from jooola December 20, 2024 09:18
@jooola
Copy link
Member

jooola commented Dec 20, 2024

I think the ISOs can be named by the customer, it is missing from this PR.

@phm07 phm07 merged commit b743a33 into main Dec 20, 2024
6 checks passed
@phm07 phm07 deleted the fix-numeric-names branch December 20, 2024 11:24
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