Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate labels from PVCs to Listener objects #158

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading