merge fix/ilm-tag-ordering (3f7175c24d) #36

Merged
pipeline-bot merged 1 commit from fix/ilm-tag-ordering into trunk 2026-07-28 14:51:12 +00:00
Contributor
No description provided.
fix(ilm): sort filter tag keys so the lifecycle document stops churning
All checks were successful
pipeline/ci CI green v3f7175c24dca
3f7175c24d
buildILMFilter's <And> branch built an ORDERED []lifecycle.Tag by ranging
spec.filter.tags, which is an UNORDERED map[string]string. Go randomizes
map iteration order, so the <And><Tag> children came out in a different
order on nearly every call.

That is not cosmetic on this path. Unlike MinioServiceAccount, which
short-circuits via Status.AppliedPolicyHash, the ILM handler has no
drift-skip gate: Converge calls SetBucketLifecycle unconditionally on
every reconcile, including the 5-minute resync. So for any filter with
more than one tag the operator PUT a DIFFERENT lifecycle XML document to
MinIO on every single pass, and then emitted a "Updated" event announcing
a change that had not occurred -- endless server-side bucket-config churn
and a permanently noisy event stream for a spec nobody ever edited.

Sort the keys before building the slice, matching the discipline already
used by buildOpenIDKV (which sorts its keys before serializing).

The single-tag branch is untouched: it ranges a len==1 map, which is
already deterministic.

Regression tests (F97, pure unit -- no envtest/MinIO) pin the property at
both levels: the built []lifecycle.Tag and the marshaled wire bytes must
be identical across 100 builds of an unchanged spec. Verified red against
the previous implementation -- it failed within 3 iterations and produced
two distinct XML payloads for one identical input -- and green after.
pipeline-bot deleted branch fix/ilm-tag-ordering 2026-07-28 14:51:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/minio-resource-operator!36
No description provided.