Commit 187eecc
Add secret rotation tracking with composite hash drift detection
Track which nodes in a nodeset have been deployed with the latest secret
versions, enabling safe credential rotation by blocking deletion of old
credentials until all nodes are updated.
Design:
- Compute a composite SHA-256 hash from all tracked secrets, sorted by name
for determinism, using lib-common's secret.Hash() for content-based hashing
- Store the deployed node list in a ConfigMap (<nodeset>-secret-tracking)
to avoid bloating CR status for large nodesets. The ConfigMap contains
{deployedSecretHash, deployedNodes[]}
- Detect drift on every reconcile by fetching tracked secrets from the cluster
and comparing the composite hash against DeployedSecretHash in status. On
mismatch, set AllNodesUpdated=false and UpdatedNodes=0 immediately
- Accumulate nodes across partial deployments using AnsibleLimit: when the
deployment hash matches the stored hash, nodes are appended; when the hash
differs (secrets changed), the node list resets
- Skip stale deployments whose secret hashes no longer match the cluster state
- Prune removed nodes by intersecting DeployedNodes with current Spec.Nodes
SecretDeploymentStatus fields in NodeSet status:
- AllNodesUpdated: all nodes deployed with current secrets (consumed by
infra-operator's RabbitMQUser controller to block credential deletion)
- TotalNodes / UpdatedNodes: node counts for observability
- DeployedSecretHash: composite hash at last successful deployment
- LastUpdateTime: timestamp of last status update
API exports:
- GetSecretTrackingConfigMapName(nodesetName) returns the deterministic
ConfigMap name for a given nodeset, allowing consumers to reference it
Watch configuration:
- Secret watch uses ResourceVersionChangedPredicate to avoid reconciling
on metadata-only updates
- Field index on status.secretHashes.keys enables O(1) lookup of nodesets
tracking a given secret, replacing O(secrets * nodesets) list scans
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 64e838e commit 187eecc
9 files changed
Lines changed: 1339 additions & 15 deletions
File tree
- api
- bases
- dataplane/v1beta1
- bindata/crds
- config/crd/bases
- internal/controller/dataplane
- test/functional/dataplane
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1987 | 1987 | | |
1988 | 1988 | | |
1989 | 1989 | | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
1990 | 2017 | | |
1991 | 2018 | | |
1992 | 2019 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
166 | 203 | | |
167 | 204 | | |
168 | 205 | | |
| |||
183 | 220 | | |
184 | 221 | | |
185 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
186 | 231 | | |
187 | 232 | | |
188 | 233 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21193 | 21193 | | |
21194 | 21194 | | |
21195 | 21195 | | |
| 21196 | + | |
| 21197 | + | |
| 21198 | + | |
| 21199 | + | |
| 21200 | + | |
| 21201 | + | |
| 21202 | + | |
| 21203 | + | |
| 21204 | + | |
| 21205 | + | |
| 21206 | + | |
| 21207 | + | |
| 21208 | + | |
| 21209 | + | |
| 21210 | + | |
| 21211 | + | |
| 21212 | + | |
| 21213 | + | |
| 21214 | + | |
| 21215 | + | |
| 21216 | + | |
| 21217 | + | |
| 21218 | + | |
| 21219 | + | |
| 21220 | + | |
21196 | 21221 | | |
21197 | 21222 | | |
21198 | 21223 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1987 | 1987 | | |
1988 | 1988 | | |
1989 | 1989 | | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
1990 | 2017 | | |
1991 | 2018 | | |
1992 | 2019 | | |
| |||
0 commit comments