Skip to content

Commit

Permalink
Merge pull request #4550 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…4293-to-release-4.4

[release-4.4] Bug 1808257: Error when Image-stream tag is selected from internal registry
  • Loading branch information
openshift-merge-robot committed Feb 28, 2020
2 parents 4556f2e + d420d36 commit a90192c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -74,14 +74,14 @@ const ImageSearch: React.FC = () => {
} else {
setFieldValue('isSearchingForImage', false);
setFieldValue('isi', {});
setFieldValue('isi.status', status.message);
setFieldValue('isi.status', status);
setFieldValue('route.targetPort', null);
setValidated(ValidatedOptions.error);
}
})
.catch((error) => {
setFieldValue('isi', {});
setFieldValue('isi.status', error.message);
setFieldValue('isi.status', { metadata: {}, status: '', message: error.message });
setFieldValue('isSearchingForImage', false);
setValidated(ValidatedOptions.error);
});
Expand All @@ -103,7 +103,7 @@ const ImageSearch: React.FC = () => {
};

const helpTextInvalid = validated === ValidatedOptions.error && (
<span>{values.searchTerm === '' ? 'Required' : values.isi.status}</span>
<span>{values.searchTerm === '' ? 'Required' : values.isi.status?.message}</span>
);

React.useEffect(() => {
Expand Down
Expand Up @@ -77,10 +77,10 @@ const ImageStream: React.FC = () => {
registry === RegistryType.Internal &&
imageStream.namespace !== BuilderImagesNamespace.Openshift &&
project.name !== imageStream.namespace;
const helperTextInvalid = validated === ValidatedOptions.error && (
const helperTextInvalid = validated === ValidatedOptions.error && isi.status?.message && (
<>
<ExclamationCircleIcon />
&nbsp;{isi.status}
&nbsp;{isi.status?.message}
</>
);

Expand Down
Expand Up @@ -54,7 +54,7 @@ const ImageStreamTagDropdown: React.FC = () => {
})
.catch((error) => {
setFieldValue('isi', {});
setFieldValue('isi.status', error.message);
setFieldValue('isi.status', { metadata: {}, status: '', message: error.message });
setFieldValue('isSearchingForImage', false);
setValidated(ValidatedOptions.error);
});
Expand Down

0 comments on commit a90192c

Please sign in to comment.