canonical/dex-auth-operator

Uncaught test issue

Closed this issue · 0 comments

When running the integration tests on microk8s with rbac enabled I see this:

INFO     test_charm:test_charm.py:83 Prometheus available at http://10.1.18.114:9090
INFO     test_charm:test_charm.py:86 Testing prometheus deployment (attempt 1)
INFO     test_charm:test_charm.py:97 Response status is success
PASSED
------------------------------------------------------------------------------------------- live log teardown -------------------------------------------------------------------------------------------
INFO     pytest_operator.plugin:plugin.py:768 Model status:

Model            Controller  Cloud/Region        Version  SLA          Timestamp
test-charm-kfom  controller  microk8s/localhost  2.9.29   unsupported  15:01:28Z

App                           Version                Status  Scale  Charm                         Channel     Rev  Address         Exposed  Message
dex-auth                                             active      1  dex-auth                                    0  10.152.183.138  no
grafana-k8s                                          active      1  grafana-k8s                   beta         18  10.152.183.221  no
istio-pilot                   res:oci-image@87fc646  active      1  istio-pilot                   1.5/stable   61  10.152.183.49   no
oidc-gatekeeper               res:oci-image@4e7f8dd  active      1  oidc-gatekeeper               stable       57  10.152.183.232  no
prometheus-k8s                                       active      1  prometheus-k8s                beta         20  10.152.183.35   no
prometheus-scrape-config-k8s                         active      1  prometheus-scrape-config-k8s  beta         18  10.152.183.99   no

Unit                             Workload  Agent  Address      Ports                                   Message
dex-auth/0*                      active    idle   10.1.18.108
grafana-k8s/0*                   active    idle   10.1.18.115
istio-pilot/0*                   active    idle   10.1.18.113  8080/TCP,15010/TCP,15012/TCP,15017/TCP
oidc-gatekeeper/0*               active    idle   10.1.18.112  8080/TCP
prometheus-k8s/0*                active    idle   10.1.18.114
prometheus-scrape-config-k8s/0*  active    idle   10.1.18.116


INFO     pytest_operator.plugin:plugin.py:774 Juju error logs:

controller-0: 15:00:22 ERROR juju.worker.caasapplicationprovisioner.runner exited "prometheus-k8s": Operation cannot be fulfilled on pods "prometheus-k8s-0": the object has been modified; please apply
your changes to the latest version and try again
unit-grafana-k8s-0: 15:00:52 ERROR unit.grafana-k8s/0.juju-log Unable to patch the Kubernetes service: Failed to patch k8s service: (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 'X-Kubernetes-Pf-Flowschema-Uid': '1d3e6a52-e09f-47
ef-9261-ebd6d4994646', 'X-Kubernetes-Pf-Prioritylevel-Uid': 'e19f6a1d-9ec5-4ee9-9de1-bb38c278b8cf', 'Date': 'Tue, 31 May 2022 15:00:52 GMT', 'Content-Length': '353'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"services \"grafana-k8s\" is forbidden: User \"system:serviceaccount:test-charm-kfom:grafana-k8s\" cann
ot delete resource \"services\" in API group \"\" in the namespace \"test-charm-kfom\"","reason":"Forbidden","details":{"name":"grafana-k8s","kind":"services"},"code":403}

Seems like this should cause a test failure, and it seems like this should be fixed to work with rbac enabled.

$ snap list
Name        Version        Rev    Tracking       Publisher   Notes
charmcraft  1.6.0          904    latest/stable  canonical✓  classic
core18      20220428       2409   latest/stable  canonical✓  base
core20      20220512       1494   latest/stable  canonical✓  base
juju        2.9.31         19414  latest/stable  canonical✓  classic
kubectl     1.24.0         2433   latest/stable  canonical✓  classic
lxd         4.0.9-8e2046b  22753  4.0/stable/…   canonical✓  -
microk8s    v1.21.12       3202   1.21/stable    canonical✓  classic
multipass   1.9.2          7174   latest/stable  canonical✓  -
snapd       2.55.5         15904  latest/stable  canonical✓  snapd

Branch is main, commit 5ab49ca