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

COO-117: test: add test to detect OwnerRefInvalidNamespace event #465

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

simonpasquier
Copy link
Contributor

Follow-up of #460 to prevent any regression.

@simonpasquier simonpasquier requested a review from a team as a code owner April 18, 2024 12:12
@simonpasquier simonpasquier requested review from slashpai and JoaoBraveCoding and removed request for a team April 18, 2024 12:12
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Apr 18, 2024

@simonpasquier: This pull request references COO-117 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set.

In response to this:

Follow-up of #460 to prevent any regression.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from thibaultmg April 18, 2024 12:12
@simonpasquier
Copy link
Contributor Author

Fails as expected :)

From the CI logs:

2024-04-18T13:18:01.4352112Z === RUN   NoOwnerRefInvalidNamespaceReasonEvent
2024-04-18T13:18:01.4353264Z     main_test.go:71: expected 0 event with reason="OwnerRefInvalidNamespace", got 13
2024-04-18T13:18:01.4363824Z     main_test.go:71: event[0]: &Event{ObjectMeta:{alerting-alertmanager.17c76215fdfff1c7  default  a50d7b22-f70c-45d8-b17e-cc8409ca9b11 4176 0 2024-04-18 13:13:49 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:13:49 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  alerting-alertmanager bdb9629a-2354-4d51-8e82-3bda3bf3516f rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: alerting, uid: ee8b03ca-ed7e-4bf4-850c-0a8175425297] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:13:49 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:13:49 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4380917Z     main_test.go:71: event[1]: &Event{ObjectMeta:{alerting-alertmanager.17c7621bd5161e92  default  b6bc27f0-a24a-48f4-9150-058d709cb0f9 4613 0 2024-04-18 13:14:14 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:14:14 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  alerting-alertmanager bdb9629a-2354-4d51-8e82-3bda3bf3516f rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: alerting, uid: da7a2f11-c3b2-4e18-aa69-3e09274ce97b] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:14:14 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:14:14 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4431715Z     main_test.go:71: event[2]: &Event{ObjectMeta:{alertmanager-deployed-and-removed-alertmanager.17c76228aa18fbde  default  75c464bc-7333-4fa1-a664-30b5fae58843 5471 0 2024-04-18 13:15:10 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:15:10 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  alertmanager-deployed-and-removed-alertmanager 385180fc-983a-4831-8246-ea5bef661075 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: alertmanager-deployed-and-removed, uid: 61381969-7156-460c-a2b1-6f7f8a8f09ba] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:15:10 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:15:10 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4453726Z     main_test.go:71: event[3]: &Event{ObjectMeta:{empty-stack-alertmanager.17c761fb459dba8e  default  f00a1ffd-a707-4bfc-b2e9-e2b8193a93f1 1829 0 2024-04-18 13:11:55 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:11:55 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  empty-stack-alertmanager af3373fc-d827-4163-8cb9-78410faada79 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: empty-stack, uid: c7cd3beb-ce72-440c-8557-839a6371c7db] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:11:55 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:11:55 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4472943Z     main_test.go:71: event[4]: &Event{ObjectMeta:{multi-ns-alertmanager.17c7622e957fff1f  default  5b4cf928-4ce1-42d9-87d6-953037baf9a5 6001 0 2024-04-18 13:15:35 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:15:35 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  multi-ns-alertmanager d65df9d2-0479-4a76-ad1d-3ca6bf1c19de rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: multi-ns, uid: 21ecbb29-59d5-4175-859e-2cbfb274a185] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:15:35 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:15:35 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4491833Z     main_test.go:71: event[5]: &Event{ObjectMeta:{nil-selector-alertmanager.17c761fc61270826  default  ee905a68-74d2-4c91-a0ae-b6145aaa997c 2050 0 2024-04-18 13:11:59 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:11:59 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  nil-selector-alertmanager 18b69b6b-045e-46ea-9089-90826d594965 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: nil-selector, uid: 234106cd-8c4b-48ab-a5a5-6552ccf1b14c] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:11:59 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:11:59 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4512668Z     main_test.go:71: event[6]: &Event{ObjectMeta:{prometheus-managed-fields-test-alertmanager.17c7623a56ee0346  default  08bae033-3f5b-4af4-a6bc-44c8c07ce377 6922 0 2024-04-18 13:16:25 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:16:25 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  prometheus-managed-fields-test-alertmanager d85d09c6-9e89-4d37-b657-0882d9cc335e rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: prometheus-managed-fields-test, uid: ebca8912-ec69-413f-82aa-efcf6c411dbf] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:16:25 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:16:25 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4533447Z     main_test.go:71: event[7]: &Event{ObjectMeta:{prometheus-scale-down-test-alertmanager.17c762380179438b  default  f4be96d0-1b38-4632-b16d-c3da5ec1ff30 6547 0 2024-04-18 13:16:15 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:16:15 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  prometheus-scale-down-test-alertmanager 85e488f3-102b-49c8-aa7b-bc7fd5a2dba4 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: prometheus-scale-down-test, uid: d5b96cf5-b635-441d-ba42-87166a42c683] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:16:15 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:16:15 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4558002Z     main_test.go:71: event[8]: &Event{ObjectMeta:{reconcile-test-alertmanager.17c761fea5a56ecb  default  94aab380-23fc-4ca1-9f9f-5aa037a4923b 2406 0 2024-04-18 13:12:09 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:12:09 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  reconcile-test-alertmanager d59fd062-712d-4a6f-84e1-3b99baf6ede3 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: reconcile-test, uid: 59d0bf7d-d18e-4a5d-aa1c-c00974078ae9] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:12:09 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:12:09 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4580261Z     main_test.go:71: event[9]: &Event{ObjectMeta:{revert-test-alertmanager.17c76206e0e8ec70  default  e03cbe96-cbc0-4b89-978e-a2c4a892680a 2936 0 2024-04-18 13:12:44 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:12:44 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  revert-test-alertmanager ffc0c740-cd9a-456b-905c-ffc540ef0f7d rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: revert-test, uid: 2fe1281a-680b-4915-9a7b-69c45c334fe3] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:12:44 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:12:44 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4602417Z     main_test.go:71: event[10]: &Event{ObjectMeta:{self-scrape-alertmanager.17c7620a6607d419  default  ebb3d59e-099e-4e1d-884f-78b5bf165e81 3621 0 2024-04-18 13:13:00 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:13:00 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  self-scrape-alertmanager 8bfb1be5-8d6c-4e3b-af1f-328e83096934 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: self-scrape, uid: 9cf21a12-8434-4374-b1cb-abcfaa2d225b] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:13:00 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:13:00 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4622925Z     main_test.go:71: event[11]: &Event{ObjectMeta:{single-replica-alertmanager.17c762092a2c96c4  default  9135c9a3-4778-4875-97cf-cfa588b6034c 3338 0 2024-04-18 13:12:54 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:12:54 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  single-replica-alertmanager 6c2334d5-dd8d-47bd-b715-eccafcc62462 rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: single-replica, uid: 11fadf12-4ad1-4ef1-b201-edf750426c01] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:12:54 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:12:54 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4641750Z     main_test.go:71: event[12]: &Event{ObjectMeta:{tq-ms-combo-alertmanager.17c762473e588016  default  a582f641-0617-4b98-935e-454076ffbe6b 7446 0 2024-04-18 13:17:21 +0000 UTC <nil> <nil> map[] map[] [] [] [{kube-controller-manager Update v1 2024-04-18 13:17:21 +0000 UTC FieldsV1 {"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{}},"f:type":{}} }]},EventTime:0001-01-01 00:00:00 +0000 UTC,Series:nil,ReportingController:,ReportingInstance:,Action:,Reason:OwnerRefInvalidNamespace,Regarding:{ClusterRole  tq-ms-combo-alertmanager edfd85e2-4aca-40d4-bd8c-3c3cc086ac0b rbac.authorization.k8s.io/v1  },Related:nil,Note:ownerRef [monitoring.rhobs/v1alpha1/MonitoringStack, namespace: , name: tq-ms-combo, uid: 3b2d856a-4980-412d-b9ec-4746a949ac82] does not exist in namespace "",Type:Warning,DeprecatedSource:{garbage-collector-controller },DeprecatedFirstTimestamp:2024-04-18 13:17:21 +0000 UTC,DeprecatedLastTimestamp:2024-04-18 13:17:21 +0000 UTC,DeprecatedCount:1,}
2024-04-18T13:18:01.4649611Z --- FAIL: NoOwnerRefInvalidNamespaceReasonEvent (0.04s)

Copy link

openshift-ci bot commented Apr 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: simonpasquier

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

@simonpasquier
Copy link
Contributor Author

@danielmellado it would be good to merge this one and see if it disturbs #434 :)

@danielmellado
Copy link
Contributor

/lgtm

@danielmellado
Copy link
Contributor

+1 , though I already gave you +1, ErrTooManyMeetings xD

@openshift-merge-bot openshift-merge-bot bot merged commit 0cbc563 into rhobs:main Apr 18, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants