Skip to content
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 1972977: cleanup condition metrics for deleted ingress controllers #640

Merged
merged 1 commit into from Aug 19, 2021

Conversation

alebedev87
Copy link
Contributor

@alebedev87 alebedev87 commented Aug 2, 2021

Enhance the finalize logic for the deleted ingress controller with the cleanup of the corresponding condition metrics.

$ oc exec ingress-operator-946847d8-2f7cl -c ingress-operator -- curl -s http://127.0.0.1:60000/metrics | grep ingress_controller_conditions 
# HELP ingress_controller_conditions Report the conditions for ingress controllers. 0 is False and 1 is True.
# TYPE ingress_controller_conditions gauge
ingress_controller_conditions{condition="Available",name="default"} 1
ingress_controller_conditions{condition="Degraded",name="default"} 0

$ oc apply -f ~/manifests/custom-ingresscontroller.yaml
ingresscontroller.operator.openshift.io/test-12345 created

$ oc -n openshift-ingress get pods -o wide
NAME                                READY   STATUS    RESTARTS   AGE   IP            NODE                                       NOMINATED NODE   READINESS GATES
router-default-596b45c968-jvlgq     1/1     Running   0          57m   10.129.2.14   ci-ln-gn82292-f76d1-zmr7s-worker-a-6fbst   <none>           <none>
router-default-596b45c968-k74l8     1/1     Running   0          57m   10.131.0.24   ci-ln-gn82292-f76d1-zmr7s-worker-b-ggndm   <none>           <none>
router-test-12345-847f5bd76-qgknk   0/1     Pending   0          14s   <none>        <none>

$ oc exec ingress-operator-946847d8-2f7cl -c ingress-operator -- curl -s http://127.0.0.1:60000/metrics | grep ingress_controller_conditions# HELP ingress_controller_conditions Report the conditions for ingress controllers. 0 is False and 1 is True.
# TYPE ingress_controller_conditions gauge
ingress_controller_conditions{condition="Available",name="default"} 1
ingress_controller_conditions{condition="Available",name="test-12345"} 0
ingress_controller_conditions{condition="Degraded",name="default"} 0
ingress_controller_conditions{condition="Degraded",name="test-12345"} 1

$ oc delete ingresscontroller test-12345
ingresscontroller.operator.openshift.io "test-12345" deleted

$ oc exec ingress-operator-946847d8-2f7cl -c ingress-operator -- curl -s http://127.0.0.1:60000/metrics | grep ingress_controller_conditions# HELP ingress_controller_conditions Report the conditions for ingress controllers. 0 is False and 1 is True.
# TYPE ingress_controller_conditions gauge
ingress_controller_conditions{condition="Available",name="default"} 1
ingress_controller_conditions{condition="Degraded",name="default"} 0

@openshift-ci openshift-ci bot requested review from candita and frobware August 2, 2021 15:31
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2021
@alebedev87
Copy link
Contributor Author

/retest

Cluster not available for 4.9.0-0.ci.test-2021-08-02-154420-ci-op-19yl2ypd-latest

@alebedev87
Copy link
Contributor Author

/retest

2 similar comments
@alebedev87
Copy link
Contributor Author

/retest

@alebedev87
Copy link
Contributor Author

/retest

Copy link
Contributor

@Miciah Miciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test case to TestDeleteIngressControllerConditionsMetric that has an IngressController where the metrics should be reported but aren't, and the IngressController is deleted? Notwithstanding this suggestion, this test coverage is terrific and puts me to shame!

pkg/operator/controller/ingress/metrics.go Outdated Show resolved Hide resolved
pkg/operator/controller/ingress/metrics_test.go Outdated Show resolved Hide resolved
pkg/operator/controller/ingress/metrics_test.go Outdated Show resolved Hide resolved
pkg/operator/controller/ingress/metrics_test.go Outdated Show resolved Hide resolved
@alebedev87
Copy link
Contributor Author

Added a test case named Conditions updated but not metrics. @Miciah let me know if I understood well your comment about the test.

@alebedev87
Copy link
Contributor Author

/retest

@Miciah
Copy link
Contributor

Miciah commented Aug 18, 2021

Thanks!
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87, Miciah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@alebedev87 alebedev87 changed the title BZ1972977: cleanup condition metrics for deleted ingress controllers Bug 1972977: cleanup condition metrics for deleted ingress controllers Aug 19, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 19, 2021

@alebedev87: This pull request references Bugzilla bug 1972977, which is invalid:

  • expected the bug to target the "4.9.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1972977: cleanup condition metrics for deleted ingress controllers

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.

@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Aug 19, 2021
@alebedev87
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 19, 2021

@alebedev87: This pull request references Bugzilla bug 1972977, 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.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @lihongan

In response to this:

/bugzilla refresh

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.

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Aug 19, 2021
@openshift-ci openshift-ci bot requested a review from lihongan August 19, 2021 06:55
@openshift-merge-robot openshift-merge-robot merged commit 56c484b into openshift:master Aug 19, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 19, 2021

@alebedev87: All pull requests linked via external trackers have merged:

Bugzilla bug 1972977 has been moved to the MODIFIED state.

In response to this:

Bug 1972977: cleanup condition metrics for deleted ingress controllers

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.

@alebedev87
Copy link
Contributor Author

/cherry-pick release-4.8

@openshift-cherrypick-robot

@alebedev87: new pull request created: #649

In response to this:

/cherry-pick release-4.8

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants