Skip to content

Commit

Permalink
Propagate labels from PVCs to Listener objects (#158)
Browse files Browse the repository at this point in the history
* Propagate labels from PVCs to Listener objects

* changelog
  • Loading branch information
sbernauer authored Mar 1, 2024
1 parent 046ccc1 commit 52f0e4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ All notable changes to this project will be documented in this file.
### Added

- Helm: support labels in values.yaml ([#142]).
- Propagate labels from PVCs to Listener objects ([#158]).

### Fixed

- Replace "Release.Name" with "operator.fullname" in Helm resource names ([#131])

[#131]: https://github.com/stackabletech/listener-operator/pull/131
[#142]: https://github.com/stackabletech/listener-operator/pull/142
[#158]: https://github.com/stackabletech/listener-operator/pull/158

## [23.11.0] - 2023-11-24

Expand Down
10 changes: 10 additions & 0 deletions rust/operator-binary/src/csi_server/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ impl csi::v1::node_server::Node for ListenerOperatorNode {
.as_ref()
.and_then(|pv_spec| pv_spec.claim_ref.as_ref()?.name.as_deref())
.context(UnclaimedPvSnafu)?;
let pvc = self
.client
.get::<PersistentVolumeClaim>(pvc_name, &ns)
.await
.with_context(|_| GetObjectSnafu {
obj: { ObjectRef::<PersistentVolumeClaim>::new(pvc_name).erase() },
})?;

let pod = self
.client
Expand Down Expand Up @@ -221,6 +228,9 @@ impl csi::v1::node_server::Node for ListenerOperatorNode {
.initialize_from_resource(&pv)
.build()
.context(BuildListenerOwnerRefSnafu)?]),
// Propagate the labels from the PVC to the Listener object, so it can be found easier, e.g. to
// determine the endpoints of stacklets.
labels: pvc.metadata.labels,
..Default::default()
},
spec: ListenerSpec {
Expand Down

0 comments on commit 52f0e4a

Please sign in to comment.