Skip to content

Commit 8d89120

Browse files
igalshilmanclaude
andcommitted
Review: explain why operator-managed annotations are dropped before propagation
The block reads as arbitrary removals without knowing the annotations are about to be copied onto the ReplicaSet/Service; say so up front. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 048112f commit 8d89120

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/controllers/restatedeployment/controller.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,14 @@ impl RestateDeployment {
260260
}
261261
};
262262

263+
// The rsd's annotations are copied onto the ReplicaSet/Service below; drop
264+
// the ones the operator manages itself so a user-set value on the rsd can't
265+
// shadow them on the way through.
263266
let mut annotations = self.annotations().clone();
264-
// if this is set on the rsd, don't propagate it
267+
// kubectl bookkeeping; meaningful only on the object it was applied to
265268
annotations.remove("kubectl.kubernetes.io/last-applied-configuration");
266-
// reserved for the operator: set on the ReplicaSet at creation in in-process
267-
// tunnel mode; a value on the rsd must not propagate over it
269+
// recorded by the operator on the ReplicaSet at creation (in-process tunnel
270+
// mode) and read back when building the registration URL
268271
annotations.remove(RESTATE_TUNNEL_NAME_ANNOTATION);
269272

270273
// Create/update the ReplicaSet for this version

0 commit comments

Comments
 (0)