-
Notifications
You must be signed in to change notification settings - Fork 670
Bug 1760828: update Active RC logic to not show Failed deployments #3627
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
Bug 1760828: update Active RC logic to not show Failed deployments #3627
Conversation
fix recent Rc to not be failed/canceled add warnings for latest RC remove console rmeove comments
|
@sahil143: This pull request references Bugzilla bug 1760828, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@spadgett Could you please have a look at this as you're much more familiar with the scenario. |
|
@sahil143: This pull request references Bugzilla bug 1760828, which is valid. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
1 similar comment
|
@sahil143: This pull request references Bugzilla bug 1760828, which is valid. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| }; | ||
|
|
||
| const isReplicationControllerVisible = (resource: K8sResourceKind): boolean => { | ||
| return _.get(resource, ['status', 'replicas'], false) || deploymentIsInProgress(resource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could simply do
| return _.get(resource, ['status', 'replicas'], false) || deploymentIsInProgress(resource); | |
| return _.get(resource, ['status', 'replicas'], deploymentIsInProgress(resource)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type is lying here since it might return a number instead of a boolean.
| return _.get(resource, ['status', 'replicas'], false) || deploymentIsInProgress(resource); | |
| return !!_.get(resource, ['status', 'replicas']) || deploymentIsInProgress(resource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this return true for all previous "complete" deployments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in e0d1c43
| }; | ||
|
|
||
| const getDeploymentConfigName = (obj: K8sResourceKind): string => { | ||
| return getAnnotation(obj, DEPLOYMENT_CONFIG_NAME_ANNOTATION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use metadata.ownerReferences instead of the annotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in e0d1c43
| DEPLOYMENT_PHASE.new, | ||
| DEPLOYMENT_PHASE.pending, | ||
| DEPLOYMENT_PHASE.running, | ||
| DEPLOYMENT_PHASE.complete, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is complete considered in progress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are looking for all phases except for failed or canceled and choose the first two from that filtered array i.e. current and previous. Seems like method name is misleading changed it to isDeploymentInProgressOrCompleted.
| return notFailedOrCancelled && previous && previous.pods.length > 0; | ||
| }; | ||
|
|
||
| const deploymentIsInProgress = (resource: K8sResourceKind): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const deploymentIsInProgress = (resource: K8sResourceKind): boolean => { | |
| const isDeploymentInProgress = (resource: K8sResourceKind): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in e0d1c43
| }; | ||
|
|
||
| const isReplicationControllerVisible = (resource: K8sResourceKind): boolean => { | ||
| return _.get(resource, ['status', 'replicas'], false) || deploymentIsInProgress(resource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type is lying here since it might return a number instead of a boolean.
| return _.get(resource, ['status', 'replicas'], false) || deploymentIsInProgress(resource); | |
| return !!_.get(resource, ['status', 'replicas']) || deploymentIsInProgress(resource); |
| }; | ||
|
|
||
| const isReplicationControllerVisible = (resource: K8sResourceKind): boolean => { | ||
| return _.get(resource, ['status', 'replicas'], false) || deploymentIsInProgress(resource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this return true for all previous "complete" deployments?
…ionControllerVisible
|
Verified locally, It works fine |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, karthikjeeyar, sahil143 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
15 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/hold |
|
/kind bug |
|
/hold cancel |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@sahil143: All pull requests linked via external trackers have merged. Bugzilla bug 1760828 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |

ODC Bug: https://jira.coreos.com/browse/ODC-1412
This PR updates the logic to get the active replication controller.
Steps:
status.replicasor if an RC is inNew,Pending,RunningorCompletephase to determine active RCs.using the logic from 3.11 code: https://github.com/openshift/origin-web-console/blob/enterprise-3.11/app/scripts/controllers/overview.js#L785-L831