-
Notifications
You must be signed in to change notification settings - Fork 149
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
Remove old HCO metrics services and endpoints when upgrading #1711
Conversation
Pull Request Test Coverage Report for Build 1837254515
💛 - Coveralls |
hco-e2e-image-index-sno-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-sno-azure 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. |
/retest |
hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp 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. |
hco-e2e-kv-smoke-azure lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp 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. |
/retest |
/rebase |
42e5f1a
to
9dead91
Compare
okd-hco-e2e-image-index-gcp lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp, ci/prow/hco-e2e-image-index-sno-aws, ci/prow/okd-hco-e2e-image-index-aws 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. |
hco-e2e-kv-smoke-azure lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp 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. |
/rebase |
9dead91
to
0fcd030
Compare
hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp 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. |
hco-e2e-kv-smoke-azure lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp 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. |
/retest |
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.
I want to suggest something. Maybe, instead of going to the api-server each time to search for the services and the endpoint, converging the resources to object and so on, we can have a static list of these three objects, where we only need to loop over and delete its items? We can maybe also remove the deleted objects from the list so we could skip them next time, then this code will happen again only if the pod was restarted during upgrade.
@machadovilaca, what do you think?
"hyperconverged-cluster-operator-metrics", | ||
"hyperconverged-cluster-webhook-metrics", |
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.
please use constants
} | ||
|
||
anyEndpointRemoved, err := r.removeObjs(req, corev1.Endpoints{}, []string{ | ||
"hyperconverged-cluster-operator-metrics", |
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.
should use the same constant as above
obj, err := r.getObj(req, objType, objName) | ||
if err != nil { | ||
return false, err | ||
} else if obj == nil { | ||
return false, nil | ||
} | ||
|
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.
I think hcoutil.EnsureDeleted
already does this logic. Please check if we can remove these lines and the getObj
function.
"hyperconverged-cluster-operator-metrics", | ||
"hyperconverged-cluster-webhook-metrics", |
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.
use constant from above comment
for _, service := range services { | ||
serviceEvents = append(serviceEvents, commonTestUtils.MockEvent{ | ||
EventType: corev1.EventTypeNormal, | ||
Reason: "Killing", | ||
Msg: fmt.Sprintf("Removed %s Service", service), | ||
}) | ||
|
||
} |
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.
It will work. I wonder if it won't be simpler just to add these two services as a golang structs.
3df48c4
to
a662f21
Compare
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
a662f21
to
e7368e5
Compare
Signed-off-by: João Vilaça <jvilaca@redhat.com>
e7368e5
to
36187aa
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@machadovilaca: 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. |
hco-e2e-image-index-sno-azure lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-sno-aws 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. |
/override coverage/coveralls |
@nunnatsa: Overrode contexts on behalf of nunnatsa: coverage/coveralls 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. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nunnatsa 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 |
/cherry-pick release-1.6 |
@tiraboschi: new pull request created: #1798 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. |
There is a bug when updating from v1.2.x to versions later than v1.4.x where services
hyperconverged-cluster-operator-metrics
andhyperconverged-cluster-webhook-metrics
, and endpointhyperconverged-cluster-operator-metrics
are not being deleted. This PR ensures those objects are removed.Signed-off-by: João Vilaça jvilaca@redhat.com
Reviewer Checklist
Release note: