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

refactor: move config parsing & validation to seperate package #546

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

apricote
Copy link
Member

@apricote apricote commented Oct 25, 2023

This significantly reduces the scope of the hcloud.newCloud() method, and allows us to cleanly introduce new validations for the Robot support.

There are some further refactorings that this change enables, but I want to publish them as a separate PR to make reviewing easier.

Related to #525

BEGIN_COMMIT_OVERRIDE
feat(config): stricter validation for settings HCLOUD_LOAD_BALANCERS_ENABLED, HCLOUD_METRICS_ENABLED & HCLOUD_NETWORK_ROUTES_ENABLED (#546)
END_COMMIT_OVERRIDE

The hcloud.Setenv() method is needed in multiple packages and better
belongs into internal/testsupport.
Keeping it in hcloud causes cyclical imports for soon to follow tests.

hcloud.SkipEnv() is unused and removed.
@apricote apricote self-assigned this Oct 25, 2023
@apricote apricote requested a review from a team as a code owner October 25, 2023 12:13
hcloud/cloud.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
hcloud/cloud.go Outdated Show resolved Hide resolved
This significantly reduces the scope of the hcloud.newCloud() method,
and allows us to cleanly introduce new validations for the Robot
support.
@apricote apricote merged commit 335a2c9 into main Oct 26, 2023
8 checks passed
@apricote apricote deleted the refactor-config branch October 26, 2023 06:02
apricote pushed a commit that referenced this pull request Dec 1, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.19.0-rc.0](v1.18.0...v1.19.0-rc.0)
(2023-12-01)


### Features

* **chart:** add daemonset and node selector
([#537](#537))
([a94384f](a94384f))
* **config:** stricter validation for settings
`HCLOUD_LOAD_BALANCERS_ENABLED`, `HCLOUD_METRICS_ENABLED` &
`HCLOUD_NETWORK_ROUTES_ENABLED`
([#546](#546))
([335a2c9](335a2c9))
* **helm:** remove "v" prefix from chart version
([#565](#565))
([f11aa0d](f11aa0d)),
closes
[#529](#529)
* **load-balancer:** handle planned targets exceedings max targets
([#570](#570))
([8bb131f](8bb131f))
* remove unused variable NODE_NAME
([#545](#545))
([a659408](a659408))
* **robot:** handle ratelimiting with constant backoff
([#572](#572))
([2ddc201](2ddc201))
* support for Robot servers
([#561](#561))
([65dea11](65dea11))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
apricote added a commit that referenced this pull request Dec 7, 2023
## [1.19.0](v1.18.0...v1.19.0)
(2023-12-07)


### Features

* **chart:** add daemonset and node selector
([#537](#537))
([a94384f](a94384f))
* **config:** stricter validation for settings
`HCLOUD_LOAD_BALANCERS_ENABLED`, `HCLOUD_METRICS_ENABLED` &
`HCLOUD_NETWORK_ROUTES_ENABLED`
([#546](#546))
([335a2c9](335a2c9))
* **helm:** remove "v" prefix from chart version
([#565](#565))
([f11aa0d](f11aa0d)),
closes
[#529](#529)
* **load-balancer:** handle planned targets exceedings max targets
([#570](#570))
([8bb131f](8bb131f))
* remove unused variable NODE_NAME
([#545](#545))
([a659408](a659408))
* **robot:** handle ratelimiting with constant backoff
([#572](#572))
([2ddc201](2ddc201))
* support for Robot servers
([#561](#561))
([65dea11](65dea11))
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