Skip to content
Snippets Groups Projects
  • Christian Groschupp's avatar
    3037fee5
    feat: allow to set labels for all volumes (#932) · 3037fee5
    Christian Groschupp authored
    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.
    3037fee5
    History
    feat: allow to set labels for all volumes (#932)
    Christian Groschupp authored
    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.