Skip to content

Commit 27bbb35

Browse files
committed
fix(tunnel): don't include OwnerReference in EndpointSlice
1 parent 73747f2 commit 27bbb35

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

TODO.md

+13
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,24 @@
5454

5555
## Ingress Tunnel
5656

57+
- Add an information banner for tunnels that have been requested and are active.
58+
5759
## Egress Tunnel
5860

61+
- Add an information banner for tunnels that have been requested and are active.
62+
- Keep the task running even if the first connect fails - need to be able to
63+
retry it without restarting the session.
5964
- Display error for when the `tcpip_forward` address is `localhost`.
6065
- Need some way to do cleanup and lifecycle management of endpoints and
6166
services.
67+
- Cleanup services/endpoints on:
68+
- Shutdown - especially termination of the channel.
69+
- Startup - because we can't do cross-namespace owner references, anything
70+
created that doesn't have an active pod should be removed (via `targetRef`
71+
on the `endpointSlice`).
72+
- Test what happens when a service is replaced. It looks like the endpointslice
73+
sticks around but it is unclear if the separate endpointslice's endpoints are
74+
used or not.
6275

6376
## Build
6477

src/resources/tunnel/egress.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ impl Egress {
112112
.expect("current pod has an IP address");
113113
let address_type = if addr.is_ipv4() { "IPv4" } else { "IPv6" };
114114

115+
// Owner references cannot be cross-namespace. Because the server will run in
116+
// namespace X and the services can be in namespace Y, this results in the
117+
// EndpointSlice being immediately deleted. It would be nice to have some kind
118+
// of garbage collection tied to the pod itself - but that might need to be a
119+
// startup process.
115120
let mut metadata = self.metadata.clone();
116121
metadata.labels.get_or_insert(BTreeMap::new()).extend([
117122
(
@@ -120,10 +125,6 @@ impl Egress {
120125
),
121126
("kubernetes.io/service-name".to_string(), self.name_any()),
122127
]);
123-
metadata
124-
.owner_references
125-
.get_or_insert(Vec::new())
126-
.push(self.current_pod.owner_ref(&()).expect("pods can be owners"));
127128

128129
#[allow(clippy::cast_lossless)]
129130
let endpoint = EndpointSlice {

0 commit comments

Comments
 (0)