Skip to content

Commit abda1ca

Browse files
committed
temporary: use v5.0 catalogs for OCP 5.1 until 5.1 catalogs are available
1 parent f563a1d commit abda1ca

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

internal/versionutils/version_utils.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ func ToAllowedSemver(data []byte) (*semver.Version, error) {
6464
// GetCatalogImageTag converts an OCP version to the catalog image tag format used by default catalogs.
6565
// For example, version 4.22.0 returns "v4.22", and version 5.0.0 returns "v5.0".
6666
func GetCatalogImageTag(version *semver.Version) string {
67+
// TODO: Remove after 4.23/5.0 branch cut; on the main branch replace "ocp-release" in
68+
// openshift/helm/catalogd.yaml (github.com/openshift/operator-framework-operator-controller) with "v5.0".
69+
// OCP 5.1 uses v5.0 catalog images until the 5.1 catalogs are available.
70+
if version.Major == 5 && version.Minor == 1 {
71+
return "v5.0"
72+
}
6773
return fmt.Sprintf("v%d.%d", version.Major, version.Minor)
6874
}
6975

internal/versionutils/version_utils_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ func TestGetCatalogImageTag(t *testing.T) {
116116
version: semver.Version{Major: 4, Minor: 22, Patch: 5},
117117
want: "v4.22",
118118
},
119+
{
120+
name: "5.1 uses v5.0 catalogs until 4.23/5.0 branch cut",
121+
version: semver.Version{Major: 5, Minor: 1, Patch: 0},
122+
want: "v5.0",
123+
},
119124
}
120125

121126
for _, tt := range tests {

0 commit comments

Comments
 (0)