From 4e41a1eb3dcacd9731ea4a78b48b065ab3c67253 Mon Sep 17 00:00:00 2001 From: kychen Date: Fri, 12 Sep 2025 13:47:49 +0800 Subject: [PATCH] fix: improve error handling in InstallArtifactVersion by logging missing CSV version Updated the InstallArtifactVersion function to log an informative message when the CSV version is not found, instead of returning an error. This change ensures better visibility into the artifact version processing and sets a default CSV version format when necessary. --- pkg/operator/operatorhub/artifact_versiong.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/operator/operatorhub/artifact_versiong.go b/pkg/operator/operatorhub/artifact_versiong.go index 9adac7e..8142a04 100644 --- a/pkg/operator/operatorhub/artifact_versiong.go +++ b/pkg/operator/operatorhub/artifact_versiong.go @@ -35,7 +35,9 @@ func (o *Operator) InstallArtifactVersion(ctx context.Context, version string) ( csv, found, _ := unstructured.NestedString(av.Object, "status", "version") if !found || csv == "" { - return nil, fmt.Errorf("failed to get CSV version from artifact version %s: status.version field is empty or not found", av.GetName()) + // return nil, fmt.Errorf("failed to get CSV version from artifact version %s: status.version field is empty or not found", av.GetName()) + log.Infow("failed to get CSV version from artifact version %s: status.version field is empty or not found", av.GetName()) + csv = fmt.Sprintf("%s.%s", o.name, version) } log.Infow("waiting for package manifest", "csv", csv)