This gets tricky with a new deployment on Focal with ovn-central and ovn-chassis being empty will lead to have automatically and implicitely "cloud:focal-ovn-22.03". And then changing to an internal repository will lead in having both the old entry in /etc/apt/sources.list.d/cloud-archive-ovn.list and the new entry /etc/apt/sources.list to be present at the same time.
This doesn't concern only "ovn-source" but also "source" or "openstack-origin" configuration option.
It has been observed that when using an URL type entry ("deb http://myrepository/ubuntu XXX"), the previous entry is never cleared and the new repository is simply added in /etc/apt/sources.list .
So for instance, when upgrading a cloud with :
"deb http://myrepository/ubuntu focal-updates/victoria main"
then
"deb http://myrepository/ubuntu focal-updates/wallaby main"
and then
"deb http://myrepository/ubuntu focal-updates/xena main"
"/etc/apt/sources.list" will contain 3 times the previous value of repository without being cleared and will continue to reference old versions of pockets.
At first glance, this looks like a limitation of the charm, where ideally, if using add-apt-repository, we should run add-apt-repository --remove "the previous entry", before adding the new repository/entry, but it looks difficult to retrieve the previous value of a config entry from a charm.
An idea would be to avoid using "add-apt-repository" command, and create manually the file as /etc/apt/sources.list.d/ with the same name like "/etc/apt/sources.list.d/cloud-archive(-ovn).list". That way, whenever there is an update, the previous entry is properly cleared and when moving between a cloud pocket and an internal repository there is no leftover of configuration.
After experimenting a lot with ovn-chassis and ovn-central. It appears it has a relation with charm-helpers.
The configuration option for "source", "openstack-origin" or "ovn-source" are relying from the function add_source from charmhelpers. /github. com/juju/ charm-helpers/ blob/dc0dc74ac2 debd328bd7846db f1d2044563e255a /charmhelpers/ fetch/ubuntu. py#L634 ) sources. list.d/ with either a file called "cloud- archive. list" or "cloud- archive- ovn.list" .
( https:/
The main issue here is that adding a cloud repository, the charm will consequently create a file in /etc/apt/
But if adding a "deb http:// myrepository/ ubuntu focal-updates/ ovn-22. 03 main" repository" which will edit instead /etc/apt/ sources. list directly to create the entry. /github. com/juju/ charm-helpers/ blob/dc0dc74ac2 debd328bd7846db f1d2044563e255a /charmhelpers/ fetch/ubuntu. py#L757 )
charmhelpers will use the command "add-apt-
( https:/
This gets tricky with a new deployment on Focal with ovn-central and ovn-chassis being empty will lead to have automatically and implicitely "cloud: focal-ovn- 22.03". And then changing to an internal repository will lead in having both the old entry in /etc/apt/ sources. list.d/ cloud-archive- ovn.list and the new entry /etc/apt/ sources. list to be present at the same time.
This doesn't concern only "ovn-source" but also "source" or "openstack-origin" configuration option. myrepository/ ubuntu XXX"), the previous entry is never cleared and the new repository is simply added in /etc/apt/ sources. list . myrepository/ ubuntu focal-updates/ victoria main" myrepository/ ubuntu focal-updates/ wallaby main" myrepository/ ubuntu focal-updates/xena main"
It has been observed that when using an URL type entry ("deb http://
So for instance, when upgrading a cloud with :
"deb http://
then
"deb http://
and then
"deb http://
"/etc/apt/ sources. list" will contain 3 times the previous value of repository without being cleared and will continue to reference old versions of pockets.
At first glance, this looks like a limitation of the charm, where ideally, if using add-apt-repository, we should run add-apt-repository --remove "the previous entry", before adding the new repository/entry, but it looks difficult to retrieve the previous value of a config entry from a charm.
An idea would be to avoid using "add-apt- repository" command, and create manually the file as /etc/apt/ sources. list.d/ with the same name like "/etc/apt/ sources. list.d/ cloud-archive( -ovn).list" . That way, whenever there is an update, the previous entry is properly cleared and when moving between a cloud pocket and an internal repository there is no leftover of configuration.