Skip to content

Commit 52f0e4a

Browse files
authored
Propagate labels from PVCs to Listener objects (#158)
* Propagate labels from PVCs to Listener objects * changelog
1 parent 046ccc1 commit 52f0e4a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ All notable changes to this project will be documented in this file.
77
### Added
88

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

1112
### Fixed
1213

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

1516
[#131]: https://github.com/stackabletech/listener-operator/pull/131
1617
[#142]: https://github.com/stackabletech/listener-operator/pull/142
18+
[#158]: https://github.com/stackabletech/listener-operator/pull/158
1719

1820
## [23.11.0] - 2023-11-24
1921

rust/operator-binary/src/csi_server/node.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ impl csi::v1::node_server::Node for ListenerOperatorNode {
191191
.as_ref()
192192
.and_then(|pv_spec| pv_spec.claim_ref.as_ref()?.name.as_deref())
193193
.context(UnclaimedPvSnafu)?;
194+
let pvc = self
195+
.client
196+
.get::<PersistentVolumeClaim>(pvc_name, &ns)
197+
.await
198+
.with_context(|_| GetObjectSnafu {
199+
obj: { ObjectRef::<PersistentVolumeClaim>::new(pvc_name).erase() },
200+
})?;
194201

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

0 commit comments

Comments
 (0)