Skip to content

Commit 5dd457e

Browse files
Merge pull request #613 from jiridanek/jd_broken_imagestream
NO-JIRA: chore(dev): log error when imagestream is found but could not be fetched
2 parents 3408b8c + 498b47b commit 5dd457e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/odh-notebook-controller/controllers/notebook_webhook.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ func SetContainerImageFromRegistry(ctx context.Context, cli client.Client, noteb
726726
// if not found, search in the notebook namespace
727727
// Note: This is in this order, so users should not overwrite the ImageStream
728728
err := cli.Get(ctx, types.NamespacedName{Name: imagestreamName, Namespace: controllerNamespace}, imgSelection)
729-
if err != nil && apierrs.IsNotFound(err) {
729+
if apierrs.IsNotFound(err) {
730730
log.Info("Unable to find the ImageStream in controller namespace, try finding in notebook namespace", "imagestream", imagestreamName, "controllerNamespace", controllerNamespace)
731731
// Check if the ImageStream is present in the notebook namespace
732732
err = cli.Get(ctx, types.NamespacedName{Name: imagestreamName, Namespace: notebook.Namespace}, imgSelection)
@@ -738,6 +738,8 @@ func SetContainerImageFromRegistry(ctx context.Context, cli client.Client, noteb
738738
imagestreamFound = true
739739
log.Info("ImageStream found in notebook namespace", "imagestream", imagestreamName, "namespace", notebook.Namespace)
740740
}
741+
} else if err != nil {
742+
log.Error(err, "Error getting ImageStream", "imagestream", imagestreamName, "controllerNamespace", controllerNamespace)
741743
} else {
742744
// ImageStream found in the controller namespace
743745
imagestreamFound = true

0 commit comments

Comments
 (0)