Skip to content

Commit 2fa9f67

Browse files
fix: Include packageName in resolution digest calculation
Critical bug fix: packageName was missing from the digest calculation. Changing packageName from "prometheus" to "grafana" would incorrectly reuse the rolling-out revision if other fields (version, channels, etc.) remained the same. Changes: - Add PackageName field to resolutionInputs struct - Include catalog.PackageName when building the digest - Update label comment to document packageName is hashed Verification: - Changing packageName now produces different digests - All tests pass Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Thanks-To: GitHub Copilot for catching this bug
1 parent d2dba24 commit 2fa9f67

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

internal/operator-controller/controllers/clusterextension_reconcile_steps.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
// resolutionInputs captures the catalog filter fields that affect bundle resolution.
4343
// Changes to any of these fields require re-resolution.
4444
type resolutionInputs struct {
45+
PackageName string `json:"packageName"`
4546
Version string `json:"version"`
4647
Channels []string `json:"channels,omitempty"`
4748
Selector string `json:"selector,omitempty"`
@@ -57,6 +58,7 @@ func calculateResolutionDigest(catalog *ocv1.CatalogFilter) (string, error) {
5758
}
5859

5960
inputs := resolutionInputs{
61+
PackageName: catalog.PackageName,
6062
Version: catalog.Version,
6163
Channels: catalog.Channels,
6264
UpgradeConstraintPolicy: string(catalog.UpgradeConstraintPolicy),

internal/operator-controller/labels/labels.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const (
5959
MigratedFromHelmKey = "olm.operatorframework.io/migrated-from-helm"
6060

6161
// ResolutionDigestKey stores a SHA256 hash of the catalog filter inputs
62-
// (version, channels, selector, upgradeConstraintPolicy) used during bundle resolution.
62+
// (packageName, version, channels, selector, upgradeConstraintPolicy) used during bundle resolution.
6363
// The controller compares this digest to detect spec changes that require re-resolution.
6464
ResolutionDigestKey = "olm.operatorframework.io/resolution-digest"
6565
)

0 commit comments

Comments
 (0)