Skip to content

Commit 22efaf0

Browse files
authored
Avoid reconcile loop in netpol peer list (#73)
* Fix #72: Avoid reconcile loop in netpol peer list * Release 1.9.2
1 parent e94273d commit 22efaf0

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "restate-operator"
3-
version = "1.9.1"
3+
version = "1.9.2"
44
authors = ["restate.dev"]
55
edition = "2021"
66
rust-version = "1.86"

charts/restate-operator-helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v2
22
name: restate-operator-helm
33
description: An operator for Restate clusters
44
type: application
5-
version: "1.9.1"
5+
version: "1.9.2"

src/controllers/restatecluster/reconcilers/network_policies.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ fn allow_access(
172172
policy_types: Some(vec!["Ingress".into()]),
173173
ingress: peers.map(|peers| {
174174
vec![NetworkPolicyIngressRule {
175-
from: Some(peers),
175+
// 'If this field is empty or missing, this rule matches all sources (traffic not restricted by source)'
176+
// Empty array is normalised by apiserver -> missing array, so to avoid a reconcile loop we do that here
177+
from: if peers.is_empty() { None } else { Some(peers) },
176178
ports: Some(vec![NetworkPolicyPort {
177179
protocol: Some("TCP".into()),
178180
port: Some(IntOrString::Int(port)),

0 commit comments

Comments
 (0)