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
OCPBUGS-3541: Don't create route metrics for ingress controllers that are not admitted #869
OCPBUGS-3541: Don't create route metrics for ingress controllers that are not admitted #869
Conversation
@gcs278: This pull request references Jira Issue OCPBUGS-3541, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In 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. |
/jira refresh |
@gcs278: This pull request references Jira Issue OCPBUGS-3541, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In 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. |
@@ -3,6 +3,7 @@ package routemetrics | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/openshift/cluster-ingress-operator/pkg/util/ingresscontroller" |
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.
This import can be grouped with the logf
import.
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.
Done
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.
Now the "golang.org/x/time/rate"
got moved. * grin *. Can you put "golang.org/x/time/rate"
back where it was?
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.
Sorry I moved it cause it didn't seem related to openshift packages, but moved it back. Not sure what the organization is supposed to be.
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.
Fair enough. I don't know where this is clearly documented, and we are inconsistent with the ordering of imports across the files in this repository (and other repositories). We usually group imports into the following groups and ordering:
- Standard packages (e.g. "context", "fmt", "time").
- General non-standard packages (e.g.
"github.com/davecgh/go-spew/spew"
,"github.com/google/go-cmp/cmp"
,"golang.org/x/time/whatever"
). - OpenShift packages (e.g.
"github.com/openshift/api/operator/v1"
,"github.com/openshift/library-go/pkg/crypto"
,"github.com/openshift/cluster-ingress-operator/whatever"
), except ofttimes we putgithub.com/openshift/cluster-ingress-operator/*
in its own group, usually before or after other OpenShift packages and in a couple cases as the last group of imports. - Kubernetes packages (e.g.
"k8s.io/api/core/v1"
,"k8s.io/apimachinery/pkg/api/errors"
), except sometimes we putk8s.io/api/*
andk8s.io/apimachinery/*
in separate groups, and we usually putsigs.k8s.io/controller-runtime/*
in another group after that.
So the basic pattern is typically this: standard packages, non-standard, github.com/openshift/*
, k8s.io/*
, sigs.k8s.io/*
. However, we have a lot of exceptions, and we have a lot of imports that just don't follow any rules (I often see people do weird things with their imports, some editors screw with import ordering, and I often let it go during reviews).
This closest thing I have found to an upstream guideline is this obscure GitHub comment: kubernetes/kubernetes#103981 (comment). One interesting thing about that comment is that it puts imports for the local repository last. We put github.com/openshift/cluster-ingress-operator/*
imports last in only a few files in this repository.
Anyway, if I'm being picky, "golang.org/x/time/rate"
should be moved to a new group. However, that import was already grouped with the github.com/openshift/*
imports, so I prefer the commit that fixes the bug just leave it where it was originally so as not to distract from the important changes in the commit.
0e89b1a
to
d2d7e7a
Compare
Why did you regenerate |
/assign |
d2d7e7a
to
01178ee
Compare
Sorry, I fixed it. I'm using go 1.18.6, but this is the update it keeps trying to make a spacing update, but I just ignore and don't check it in.
|
/hold |
e3db693
to
22be71c
Compare
/unhold |
22be71c
to
8c34806
Compare
@gcs278 This is pretty easy and very useful. Thanks for adding the unit tests 👍 |
all appear to be known issues |
/retest |
/retest |
/test e2e-gcp-ovn-serial |
b771b86
to
6fc40ab
Compare
/lgtm |
Mostly |
Known flakes except |
Cluster install fail |
/retest e2e-hypershift |
@gcs278: The
The following commands are available to trigger optional jobs:
Use In 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. |
/test e2e-hypershift |
/retest-required |
/retest |
… metrics for ingress controllers that are not admitted
6fc40ab
to
004ebf7
Compare
…e function. Add builder functions for building routes, namespaces, and ingress controllers.
004ebf7
to
7ee37ab
Compare
@alebedev87 minor changes in https://github.com/openshift/cluster-ingress-operator/compare/004ebf75059b4db3834e0e4502bbaaceedfd9ab9..7ee37ab92e459af483c3c2b1989fdb9de0864e4b import ordering, fixing |
@gcs278: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
https://issues.redhat.com/browse/OCPBUGS-13106 disruption weird error: |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alebedev87 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 |
@gcs278: Jira Issue OCPBUGS-3541: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-3541 has been moved to the MODIFIED state. In 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. |
Fix included in accepted release 4.15.0-0.nightly-2023-09-27-073353 |
To fix OCPBUGS-3541, don't create metrics for ingress controller that are not admitted. The Ingress Operator won't add the finalizer if the Ingress Controller was not admitted. Since there is no finalizer, we can't delete any metrics that we created for the Ingress Controller upon deletion. Only adding metrics for Ingress Controllers that are admitted will correct this bug.
Furthermore, if an ingress controller is not admitted, it can't have any routes, so there isn't a large point in creating the metrics for it yet.