Skip to content

[release-4.17] OCPBUGS-55756: update the Deployment pod on change in imageStream #15022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release-4.17
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export const getTriggersAndImageStreamValues = (
return {
...data,
triggers: {
image: imageTrigger?.paused === 'false',
image: imageTrigger?.paused === false,
},
fromImageStreamTag: !!imageTrigger,
imageStream: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export const getDeploymentData = (resource: K8sResourceKind) => {
return {
env,
triggers: {
image: imageTrigger?.paused === 'false',
image: imageTrigger?.paused === false,
},
replicas: resource.spec?.replicas ?? 1,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Import Submit Utils', () => {
namespace: 'gijohn',
},
fieldPath: 'spec.template.spec.containers[?(@.name=="nodejs-ex-git")].image',
paused: 'false',
paused: false,
},
]);
done();
Expand Down Expand Up @@ -431,7 +431,7 @@ describe('Import Submit Utils', () => {
'app.openshift.io/vcs-ref': 'master',
'app.openshift.io/vcs-uri': 'https://github.com/redhat-developer/devfile-sample',
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"devfile-sample:latest","namespace":"gijohn"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"devfile-sample\\")].image","paused":"false"}]',
'[{"from":{"kind":"ImageStreamTag","name":"devfile-sample:latest","namespace":"gijohn"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"devfile-sample\\")].image","paused":false}]',
isFromDevfile: 'true',
'openshift.io/generated-by': 'OpenShiftWebConsole',
'app.openshift.io/route-disabled': 'false',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Upload Jar Submit Utils', () => {
namespace: 'my-app',
},
fieldPath: 'spec.template.spec.containers[?(@.name=="java-ex-git")].image',
paused: 'false',
paused: false,
},
]);
done();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const originalDeployment = {
'app.openshift.io/vcs-ref': 'master',
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"false"}]',
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":false}]',
'openshift.io/generated-by': 'OpenShiftWebConsole',
'app.openshift.io/connects-to': 'database',
'deployment.kubernetes.io/revision': '4',
Expand Down Expand Up @@ -104,7 +104,7 @@ export const newDeployment = {
'app.openshift.io/vcs-ref': 'master',
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"true"}]',
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":true}]',
'openshift.io/generated-by': 'OpenShiftWebConsole',
},
name: 'nationalparks-py',
Expand Down Expand Up @@ -169,7 +169,7 @@ export const devfileDeployment = {
'app.openshift.io/vcs-ref': 'master',
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"true"}]',
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":true}]',
'openshift.io/generated-by': 'OpenShiftWebConsole',
isFromDevfile: 'true',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('resource-label-utils', () => {
'app.openshift.io/vcs-ref': 'master',
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"true"}]',
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":true}]',
'openshift.io/generated-by': 'OpenShiftWebConsole',
'app.openshift.io/connects-to': 'database',
'deployment.kubernetes.io/revision': '4',
Expand Down Expand Up @@ -125,12 +125,12 @@ describe('resource-label-utils', () => {
let annotation = getTriggerAnnotation('test', 'python', 'div', true);
expect(annotation).toEqual({
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"python:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":"false"}]',
'[{"from":{"kind":"ImageStreamTag","name":"python:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":false}]',
});
annotation = getTriggerAnnotation('test', 'test', 'div', false);
expect(annotation).toEqual({
'image.openshift.io/triggers':
'[{"from":{"kind":"ImageStreamTag","name":"test:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":"true"}]',
'[{"from":{"kind":"ImageStreamTag","name":"test:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":true}]',
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const getTriggerAnnotation = (
{
from: { kind: 'ImageStreamTag', name: `${imageName}:${imageTag}`, namespace: imageNamespace },
fieldPath: `spec.template.spec.containers[?(@.name=="${containerName}")].image`,
paused: `${!imageTrigger}`,
paused: !imageTrigger,
},
]),
});
Expand Down