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

metrics: Add permissions to remove monitor objects #769

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ rules:
verbs:
- get
- create
- update
- delete
- apiGroups:
- apps
resourceNames:
Expand Down
2 changes: 2 additions & 0 deletions deployment/sriov-network-operator-chart/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ rules:
verbs:
- get
- create
- update
- delete
- apiGroups:
- apps
resourceNames:
Expand Down
8 changes: 8 additions & 0 deletions test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ var _ = Describe("[sriov] operator", func() {
g.Expect(err).ToNot(HaveOccurred())
}).Should(Succeed())
})

It("should remove ServiceMonitor when the feature is turned off", func() {
setFeatureFlag("metricsExporter", false)
Eventually(func(g Gomega) {
_, err := clients.ServiceMonitors(operatorNamespace).Get(context.Background(), "sriov-network-metrics-exporter", metav1.GetOptions{})
g.Expect(k8serrors.IsNotFound(err)).To(BeTrue())
}).Should(Succeed())
})
})
})

Expand Down
Loading