feat: Add k8smount provider#409
Merged
Merged
Conversation
763d35a to
e6f7ba6
Compare
Add a provider for [Kubernetes volume mounts]. This allows a process running in a Pod to read in configuration form ConfigMaps and Secrets, and watch for updates thereafter. This is intended as an upgrade to reading Pod configuration in as environment variables, allowing values to be updated in place instead of requiring a Pod restart. It is not intended to replace reading of structured data in a ConfigMap or Secret, such as JSON or YAML. In such cases, it is recommended to use the existing file provider. The following features are provided in this change: - Support for loading configuration from the symlink structure used by volume mounts of ConfigMap and Secrets in Kubernetes Pods. - Support for watching for configuration changes on said volume mounts. This feature is based on the existing file provider. - Support for transforming keys and values after the initial load. This feature is based on the existing environment variable provider. This change also upgrades the Go version in the workspace to 1.25. The provider uses [`os.Root`] to prevent access to files outside the intended mount. Go 1.25 is needed to use [`io/fs.ReadLinkFS`] which extends `os.Root` with methods that are useful for working with symlink-based structure of volume mounts. Without these methods, we'd be forced to use the equivalent functions in `os`, and so abandon the protection provided by `os.Root`. [Kubernetes volume mounts]: https://kubernetes.io/docs/concepts/storage/volumes/ [`os.Root`]: https://pkg.go.dev/os#Root [`io/fs.ReadLinkFS`]: https://pkg.go.dev/io/fs#ReadLinkFS
e6f7ba6 to
ac08649
Compare
Maks1mS
pushed a commit
to stplr-dev/stplr
that referenced
this pull request
May 30, 2026
This PR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [github.com/knadh/koanf/v2](https://github.com/knadh/koanf) | require | patch | `v2.3.4` → `v2.3.5` | [](https://securityscorecards.dev/viewer/?uri=github.com/knadh/koanf) | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information. --- ### Release Notes <details> <summary>knadh/koanf (github.com/knadh/koanf/v2)</summary> ### [`v2.3.5`](https://github.com/knadh/koanf/releases/tag/v2.3.5) [Compare Source](knadh/koanf@v2.3.4...v2.3.5) #### What's Changed - go-toml v3.3.0 by [@​GreyXor](https://github.com/GreyXor) in [#​410](knadh/koanf#410) - Bump github.com/go-jose/go-jose/v4 from 4.1.0 to 4.1.4 in /providers/vault by [@​dependabot](https://github.com/dependabot)\[bot] in [#​411](knadh/koanf#411) - go-toml v2.3.1 by [@​GreyXor](https://github.com/GreyXor) in [#​414](knadh/koanf#414) - feat: Add k8smount provider by [@​mattdowdell](https://github.com/mattdowdell) in [#​409](knadh/koanf#409) - Bools: return the matched \[]bool, not the nil intermediate by [@​c-tonneslan](https://github.com/c-tonneslan) in [#​416](knadh/koanf#416) - fix: report the full key path in MergeStrict type-mismatch error by [@​koriyoshi2041](https://github.com/koriyoshi2041) in [#​418](knadh/koanf#418) #### New Contributors - [@​mattdowdell](https://github.com/mattdowdell) made their first contribution in [#​409](knadh/koanf#409) - [@​c-tonneslan](https://github.com/c-tonneslan) made their first contribution in [#​416](knadh/koanf#416) - [@​koriyoshi2041](https://github.com/koriyoshi2041) made their first contribution in [#​418](knadh/koanf#418) **Full Changelog**: <knadh/koanf@v2.3.4...v2.3.5> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday (`* 0-4,22-23 * * 1-5`) - Only on Sunday and Saturday (`* * * * 0,6`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTUuMyIsInVwZGF0ZWRJblZlciI6IjQzLjE5NS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://altlinux.space/stapler/stplr/pulls/445
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a provider for Kubernetes volume mounts. This allows a process running in a Pod to read in configuration form ConfigMaps and Secrets, and watch for updates thereafter.
This is intended as an upgrade to reading Pod configuration in as environment variables, allowing values to be updated in place instead of requiring a Pod restart. It is not intended to replace reading of structured data in a ConfigMap or Secret, such as JSON or YAML. In such cases, it is recommended to use the existing file provider.
The following features are provided in this change:
This change also upgrades the Go version in the workspace to 1.25. The provider uses
os.Rootto prevent access to files outside the intended mount. Go 1.25 is needed to useio/fs.ReadLinkFSwhich extendsos.Rootwith methods that are useful for working with symlink-based structure of volume mounts. Without these methods, we'd be forced to use the equivalent functions inos, and so abandon the protection provided byos.Root.