Skip to content

Commit f9c412e

Browse files
Merge pull request #15022 from openshift-cherrypick-robot/cherry-pick-14757-to-release-4.17
[release-4.17] OCPBUGS-55756: update the Deployment pod on change in imageStream
2 parents b93b13b + 5cd24d0 commit f9c412e

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

frontend/packages/dev-console/src/components/deployments/utils/deployment-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export const getTriggersAndImageStreamValues = (
358358
return {
359359
...data,
360360
triggers: {
361-
image: imageTrigger?.paused === 'false',
361+
image: imageTrigger?.paused === false,
362362
},
363363
fromImageStreamTag: !!imageTrigger,
364364
imageStream: {

frontend/packages/dev-console/src/components/edit-application/edit-application-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export const getDeploymentData = (resource: K8sResourceKind) => {
410410
return {
411411
env,
412412
triggers: {
413-
image: imageTrigger?.paused === 'false',
413+
image: imageTrigger?.paused === false,
414414
},
415415
replicas: resource.spec?.replicas ?? 1,
416416
};

frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('Import Submit Utils', () => {
5858
namespace: 'gijohn',
5959
},
6060
fieldPath: 'spec.template.spec.containers[?(@.name=="nodejs-ex-git")].image',
61-
paused: 'false',
61+
paused: false,
6262
},
6363
]);
6464
done();
@@ -431,7 +431,7 @@ describe('Import Submit Utils', () => {
431431
'app.openshift.io/vcs-ref': 'master',
432432
'app.openshift.io/vcs-uri': 'https://github.com/redhat-developer/devfile-sample',
433433
'image.openshift.io/triggers':
434-
'[{"from":{"kind":"ImageStreamTag","name":"devfile-sample:latest","namespace":"gijohn"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"devfile-sample\\")].image","paused":"false"}]',
434+
'[{"from":{"kind":"ImageStreamTag","name":"devfile-sample:latest","namespace":"gijohn"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"devfile-sample\\")].image","paused":false}]',
435435
isFromDevfile: 'true',
436436
'openshift.io/generated-by': 'OpenShiftWebConsole',
437437
'app.openshift.io/route-disabled': 'false',

frontend/packages/dev-console/src/components/import/__tests__/upload-jar-submit-utils.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Upload Jar Submit Utils', () => {
4444
namespace: 'my-app',
4545
},
4646
fieldPath: 'spec.template.spec.containers[?(@.name=="java-ex-git")].image',
47-
paused: 'false',
47+
paused: false,
4848
},
4949
]);
5050
done();

frontend/packages/dev-console/src/utils/__tests__/resource-label-utils-data.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const originalDeployment = {
77
'app.openshift.io/vcs-ref': 'master',
88
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
99
'image.openshift.io/triggers':
10-
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"false"}]',
10+
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":false}]',
1111
'openshift.io/generated-by': 'OpenShiftWebConsole',
1212
'app.openshift.io/connects-to': 'database',
1313
'deployment.kubernetes.io/revision': '4',
@@ -104,7 +104,7 @@ export const newDeployment = {
104104
'app.openshift.io/vcs-ref': 'master',
105105
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
106106
'image.openshift.io/triggers':
107-
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"true"}]',
107+
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":true}]',
108108
'openshift.io/generated-by': 'OpenShiftWebConsole',
109109
},
110110
name: 'nationalparks-py',
@@ -169,7 +169,7 @@ export const devfileDeployment = {
169169
'app.openshift.io/vcs-ref': 'master',
170170
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
171171
'image.openshift.io/triggers':
172-
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"true"}]',
172+
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":true}]',
173173
'openshift.io/generated-by': 'OpenShiftWebConsole',
174174
isFromDevfile: 'true',
175175
},

frontend/packages/dev-console/src/utils/__tests__/resource-label-utils.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('resource-label-utils', () => {
3636
'app.openshift.io/vcs-ref': 'master',
3737
'app.openshift.io/vcs-uri': 'https://github.com/divyanshiGupta/nationalparks-py',
3838
'image.openshift.io/triggers':
39-
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":"true"}]',
39+
'[{"from":{"kind":"ImageStreamTag","name":"nationalparks-py:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"nationalparks-py\\")].image","paused":true}]',
4040
'openshift.io/generated-by': 'OpenShiftWebConsole',
4141
'app.openshift.io/connects-to': 'database',
4242
'deployment.kubernetes.io/revision': '4',
@@ -125,12 +125,12 @@ describe('resource-label-utils', () => {
125125
let annotation = getTriggerAnnotation('test', 'python', 'div', true);
126126
expect(annotation).toEqual({
127127
'image.openshift.io/triggers':
128-
'[{"from":{"kind":"ImageStreamTag","name":"python:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":"false"}]',
128+
'[{"from":{"kind":"ImageStreamTag","name":"python:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":false}]',
129129
});
130130
annotation = getTriggerAnnotation('test', 'test', 'div', false);
131131
expect(annotation).toEqual({
132132
'image.openshift.io/triggers':
133-
'[{"from":{"kind":"ImageStreamTag","name":"test:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":"true"}]',
133+
'[{"from":{"kind":"ImageStreamTag","name":"test:latest","namespace":"div"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"test\\")].image","paused":true}]',
134134
});
135135
});
136136
});

frontend/packages/dev-console/src/utils/resource-label-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const getTriggerAnnotation = (
7575
{
7676
from: { kind: 'ImageStreamTag', name: `${imageName}:${imageTag}`, namespace: imageNamespace },
7777
fieldPath: `spec.template.spec.containers[?(@.name=="${containerName}")].image`,
78-
paused: `${!imageTrigger}`,
78+
paused: !imageTrigger,
7979
},
8080
]),
8181
});

0 commit comments

Comments
 (0)