Skip to content

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
@codecov
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.

@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
jooola pushed a commit that referenced this pull request Jan 22, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.18.0](v2.17.1...v2.18.0)
(2025-01-22)


### Features

* **exp:** add `randutil.GenerateID` helper
([#580](#580))
([9515be7](9515be7))


### Bug Fixes

* allow getting resources with number as name
([#571](#571))
([b743a33](b743a33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
apricote pushed a commit to hetznercloud/fleeting-plugin-hetzner that referenced this pull request Jan 22, 2025
…8.0 (hetznercloud/fleeting-plugin-hetzner!208)

This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) | require | minor | `v2.17.1` -> `v2.18.0` |

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)</summary>

### [`v2.18.0`](https://github.com/hetznercloud/hcloud-go/releases/tag/v2.18.0)

[Compare Source](hetznercloud/hcloud-go@v2.17.1...v2.18.0)

##### Features

-   **exp:** add `randutil.GenerateID` helper ([#&#8203;580](hetznercloud/hcloud-go#580)) ([9515be7](hetznercloud/hcloud-go@9515be7))

##### Bug Fixes

-   allow getting resources with number as name ([#&#8203;571](hetznercloud/hcloud-go#571)) ([b743a33](hetznercloud/hcloud-go@b743a33))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjAuNCIsInVwZGF0ZWRJblZlciI6IjM5LjEyMC40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
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