Skip to content

Commit deef4f5

Browse files
review changes
1 parent f088c29 commit deef4f5

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

internal/operator-controller/controllers/clusterextension_reconcile_steps.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ func handleResolutionError(ctx context.Context, c client.Client, state *reconcil
174174
catalogsExist, catalogCheckErr := CheckCatalogsExist(ctx, c, ext)
175175
if catalogCheckErr != nil {
176176
msg := fmt.Sprintf("failed to resolve bundle: %v", err)
177-
catalogName := getCatalogNameFromSelector(ext.Spec.Source.Catalog.Selector)
177+
var catalogName string
178+
if ext.Spec.Source.Catalog != nil {
179+
catalogName = getCatalogNameFromSelector(ext.Spec.Source.Catalog.Selector)
180+
}
178181
l.Error(catalogCheckErr, "error checking if ClusterCatalogs exist, will retry resolution",
179182
"resolutionError", err,
180183
"packageName", getPackageName(ext),
@@ -189,7 +192,10 @@ func handleResolutionError(ctx context.Context, c client.Client, state *reconcil
189192
// ClusterCatalogs exist but resolution failed - likely a transient issue (ClusterCatalog updating, cache stale, etc.)
190193
// Retry resolution instead of falling back
191194
msg := fmt.Sprintf("failed to resolve bundle, retrying: %v", err)
192-
catalogName := getCatalogNameFromSelector(ext.Spec.Source.Catalog.Selector)
195+
var catalogName string
196+
if ext.Spec.Source.Catalog != nil {
197+
catalogName = getCatalogNameFromSelector(ext.Spec.Source.Catalog.Selector)
198+
}
193199
l.Error(err, "resolution failed but matching ClusterCatalogs exist - retrying instead of falling back",
194200
"packageName", getPackageName(ext),
195201
"catalogName", catalogName)
@@ -203,7 +209,10 @@ func handleResolutionError(ctx context.Context, c client.Client, state *reconcil
203209
// The controller watches ClusterCatalog resources, so when ClusterCatalogs become available again,
204210
// a reconcile will be triggered automatically, allowing the extension to upgrade.
205211
msg := fmt.Sprintf("continuing to maintain current installation at version %s due to catalog unavailability", state.revisionStates.Installed.Version)
206-
catalogName := getCatalogNameFromSelector(ext.Spec.Source.Catalog.Selector)
212+
var catalogName string
213+
if ext.Spec.Source.Catalog != nil {
214+
catalogName = getCatalogNameFromSelector(ext.Spec.Source.Catalog.Selector)
215+
}
207216
l.Error(err, "matching ClusterCatalogs unavailable or deleted - falling back to installed bundle to maintain workload",
208217
"packageName", getPackageName(ext),
209218
"catalogName", catalogName,

0 commit comments

Comments
 (0)