Skip to content

Commit 4e41a1e

Browse files
committed
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.
1 parent bf9bdbe commit 4e41a1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/operator/operatorhub/artifact_versiong.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ func (o *Operator) InstallArtifactVersion(ctx context.Context, version string) (
3535

3636
csv, found, _ := unstructured.NestedString(av.Object, "status", "version")
3737
if !found || csv == "" {
38-
return nil, fmt.Errorf("failed to get CSV version from artifact version %s: status.version field is empty or not found", av.GetName())
38+
// return nil, fmt.Errorf("failed to get CSV version from artifact version %s: status.version field is empty or not found", av.GetName())
39+
log.Infow("failed to get CSV version from artifact version %s: status.version field is empty or not found", av.GetName())
40+
csv = fmt.Sprintf("%s.%s", o.name, version)
3941
}
4042

4143
log.Infow("waiting for package manifest", "csv", csv)

0 commit comments

Comments
 (0)