Skip to content
Snippets Groups Projects
Unverified Commit 3037fee5 authored by Christian Groschupp's avatar Christian Groschupp Committed by GitHub
Browse files

feat: allow to set labels for all volumes (#932)

This pull request adds support for setting default labels on all newly
created volumes in the Hetzner Cloud CSI driver.

## Changes

- Introduced the environment variable `HCLOUD_VOLUME_DEFAULT_LABELS`,
which accepts a comma-separated list of key:value pairs.
- Added the `ParseEnvMap` function to parse and validate the environment
variable into a `map[string]string`.
- Extended `VolumeService` to apply the parsed labels during volume
creation.
- Added unit tests for the `ParseEnvMap` function in
`internal/app/app_test.go`.

## Notes

- Labels are only applied if `HCLOUD_VOLUME_DEFAULT_LABELS` is set and
contains valid key=value pairs.
- Invalid formats in the environment variable will cause the controller
to fail on startup.
parent bf29b677
No related branches found
No related tags found
Loading
Showing
with 302 additions and 1 deletion
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment