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

traefik_k8s.v1.ingress relation relies on deprecated controller storage #140

Closed
gnuoy opened this issue Feb 14, 2023 · 1 comment
Closed

Comments

@gnuoy
Copy link

gnuoy commented Feb 14, 2023

Bug Description

The interface relies on deprecated controller storage (canonical/operator#882). If a charm respects this deprecation notice and sets use_juju_for_storage=False then the state stored in self._stored.current_url (for example) can be lost.

To Reproduce

Deploy a charm which uses the ingress relation and amend the charm to echo the value of url property of the ingress requires interface. This should return a url. Build a new copy of the charm with use_juju_for_storage=False and upgrade the existing charm. The url property will now be None.

A more longwinded way:

$ git clone  https://opendev.org/openstack/charm-placement-k8s 
$ cd charm-placement-k8s/
$ juju download --series jammy --channel yoga/edge placement-k8s
$ mv placement*.charm  placement-k8s.charm
$ tox -e func-smoke
...
$ juju status placement
Model              Controller  Cloud/Region        Version  SLA          Timestamp
zaza-df54e5a6cf87  micro       microk8s/localhost  2.9.34   unsupported  11:42:18Z

App        Version  Status  Scale  Charm          Channel  Rev  Address        Exposed  Message
placement           active      1  placement-k8s             0  10.152.183.48  no       

Unit          Workload  Agent  Address      Ports  Message
placement/0*  active    idle   10.1.124.51         

$ mkdir /tmp/charm-tmp
$ unzip -d /tmp/charm-tmp  placement-k8s.charm

$ sed -i -e 's/use_juju_for_storage=True/use_juju_for_storage=False/' /tmp/charm-tmp/src/charm.py 
$ cd /tmp/charm-tmp
$ zip -r /tmp/placement.charm *
$ juju upgrade-charm --switch /tmp/placement.charm placement
$ juju status placement
Model              Controller  Cloud/Region        Version  SLA          Timestamp
zaza-df54e5a6cf87  micro       microk8s/localhost  2.9.34   unsupported  11:48:15Z

App        Version  Status   Scale  Charm          Channel  Rev  Address        Exposed  Message
placement           waiting      1  placement-k8s             1  10.152.183.48  no       waiting for units to settle down

Unit          Workload  Agent  Address      Ports  Message
placement/0*  waiting   idle   10.1.124.32         (ingress-internal) integration incomplete

This is because the placement charm checks the url property of the relation to check it is ready.

Environment

Running in microk8s. The library version is:

LIBAPI = 1
LIBPATCH = 5

Relevant log output

N/A

Additional context

N/A

openstack-mirroring pushed a commit to openstack/charm-ops-sunbeam that referenced this issue Feb 17, 2023
Switching the charms from using juju controller storage breaks
the traefik relation due to a bug *1. This workaround bypasses
the broken cached url value.

*1 canonical/traefik-k8s-operator#140

Change-Id: I5137eb4eb94c3897c73e54e19ef73033857c135e
gboutry pushed a commit to canonical/sunbeam-charms that referenced this issue Nov 6, 2023
Switching the charms from using juju controller storage breaks
the traefik relation due to a bug *1. This workaround bypasses
the broken cached url value.

*1 canonical/traefik-k8s-operator#140

Change-Id: I5137eb4eb94c3897c73e54e19ef73033857c135e
@dstathis
Copy link
Contributor

Ingress v1 has been deprecated for some time now. I would recommend updating to ingress v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants