Skip to content

Commit

Permalink
use separate label for internal image streams
Browse files Browse the repository at this point in the history
  • Loading branch information
rottencandy committed Sep 7, 2020
1 parent 7425a8d commit 95b52fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Expand Up @@ -378,7 +378,7 @@ export const getInternalImageInitialValues = (editAppResource: K8sResourceKind)
'metadata.labels["app.openshift.io/runtime-namespace"]',
'',
);
const imageStreamName = _.get(editAppResource, 'metadata.labels["app.openshift.io/runtime"]', '');
const imageStreamName = _.get(editAppResource, 'metadata.labels["app.kubernetes.io/name"]', '');
const imageStreamTag = _.get(
editAppResource,
'metadata.labels["app.openshift.io/runtime-version"]',
Expand Down
Expand Up @@ -129,10 +129,9 @@ const getMetadata = (formData: DeployImageFormData) => {
name,
isi: { image },
labels: userLabels,
imageStream: { tag: selectedTag, namespace },
imageStream: { image: imageStreamName, tag: selectedTag, namespace },
runtimeIcon,
} = formData;
const imageStreamName = getRuntime(image.metadata?.labels);
const defaultLabels = getAppLabels({
name,
applicationName,
Expand Down
Expand Up @@ -64,7 +64,14 @@ const ImageStreamNsDropdown: React.FC = () => {
);

React.useEffect(() => {
if (
initialValues.imageStream.image &&
values.imageStream.image !== initialValues.imageStream.image
) {
initialValues.imageStream.image = values.imageStream.image;
}
values.imageStream.namespace && onDropdownChange(values.imageStream.namespace);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [onDropdownChange, values.imageStream.namespace]);

React.useEffect(() => {
Expand Down

0 comments on commit 95b52fb

Please sign in to comment.