operator-metallb:release_1.25

Last commit made on 2022-09-08
Get this branch:
git clone -b release_1.25 https://git.launchpad.net/operator-metallb

Branch merges

Branch information

Name:
release_1.25
Repository:
lp:operator-metallb

Recent commits

3b222fd... by Stone Preston <email address hidden>

PSP Removal (#24)

* Add PSP removal for 1.25+
* swap to an API test rather than a k8s node version test for PodSecurityPolicy
* break integration tests apart so that microbot tests can be re-run

Co-authored-by: Stone Preston <email address hidden>
Co-authored-by: Adam Dyess <email address hidden>

b91b33d... by Adam Dyess

non-leader units should be in idle rather than waiting on leadership (#23)

82b227e... by Adam Dyess

enable jammy support for this charm (#21)

* enable jammy support for this charm

* support reusable workflows for inclusive naming, linting, and unit testing

* upgrade Pipfile.lock to support py3.10 testing

* drop python 3.7 unit testing

bf6ead1... by Adam Dyess

Update metadata.yaml (#20)

* Update metadata.yaml

* Update metadata.yaml

2091ea9... by George Kraft

Add charmcraft.yaml (#19)

* Add charmcraft.yaml

* Remove microk8s.kubectl alias

* Fix kubectl command called with non-string object

* Remove trailing --- from rbac-permissions-operators.yaml

607568e... by Cory Johns

Convert tests to actions-operator and pytest-operator (#18)

* Convert tests to actions-operator and pytest-operator

Clean up the integration test workflow by leveraging actions-operator
for the environment setup and pytest-operator for model helpers and
doing the testing in Python.

* Refactor RBAC management in tests to Workflow

Managing the RBAC feature within the test ran into issues due to the API
server restarting which interrupted the model connection to the
controller. Additionally, it made the tests coupled to microk8s rather
than being able to run against any K8s cluster.

* Fix workflow syntax error

* Fix perm error on snap alias

* Fix env syntax and sg command for disabling RBAC in workflow

* Fix sg syntax in workflow and custom arg passing through tox

* Fix parallel charmcraft builds

Charmcraft checks for and, if not present, adds a LXC remote for it's
build environment image. If multiple builds are started in parallel,
there's a race condition where they both see that the remote isn't
present and then both try to add it, leading to one of them failing.

* More charmcraft pre-init in workflow

* Do builds sequentially to try to get past build issues

* Remove git dependency in requirements

The oci-image library was released to PyPI some time ago, so use that
instead of the git repo.

* Refactor RBAC check to not use wait_for_idle

The behavior of `wait_for_idle` returning immediately as soon as *any*
unit is in error, even with `raise_on_error=False` was causing some
strangeness with the test attempting to resolve a unit before it was in
error (somehow).

* Add some debug logging

* Increase workflow timeout

* Restore default wait_period to try to figure out why it was failing

* Some debugging for inconsistent test behavior

ffd28a7... by Camille Rodriguez <email address hidden>

Fix issues: rbac permissions and ARP on the network (#17)

* Update rbac-permissions-operators.yaml

When deploying the metallb operator, 4 service accounts are created: metallb-controller-operator, metallb-speaker-operator, metallb-controller, metallb-speaker. For the metallb-controller to function correctly, it also needs access to list configmaps. This error was seen in the logs when I tried with the previous configuration:

E0317 15:22:00.604453 1 reflector.go:125] <email address hidden>/tools/cache/reflector.go:98: Failed to list *v1.ConfigMap: confi
gmaps "config" is forbidden: User "system:serviceaccount:metallb-system:metallb-controller" cannot list resource "configmaps" in API group "" in the namespace "metallb-syst
em"

And the loadbalancer services would not be getting an external IP. This change in the permissions fixed it.

* Update charm.py

hostNetwork:True is necessary to allow ARP on the network

ed8c79a... by Camille Rodriguez <email address hidden>

Add MetalLB logo as icon (#16)

* first commit

* bundle draft

* functional bundle for local charms

* add charms in single bundle

* make config-changed update the ip range

* add remove hook for controller api events

* fix error, each charm deployed once

* add Makefile build action for bundle

* not keeping built versions in git

* commit changes before removing file

* not keeping built versions in git

* not tracking builds

* Add remove event for speaker

* add example app

* update README for charms and bundle

* Info for developers

* lint

* ignore .tox file

* remove .tox from git tracking

* Add unit tests for metallb controller

* keep tox only, get rid of Makefile

* switch to command line options instead of file

* fix order of patch objects

* add unit tests for metallb-speaker

* remove unused files

* stop using duplicated .build directory instead of build

* replace makefile by tox actions

* unecessary lines

* tox replaced makefile

* change bundle for operator

* add info for devs

* Add github action for linting with flake8

* add basic github action directory and check formating with tox

* testing basic workflow

* testing basic workflow

* add github action for linting

* list of paths to test

* try flake8 option

* remove pylint

* fix extra flake8 options

* Add functional test with gitlab actions

* add func test

* syntax

* syntax

* syntax

* add sufficient permissions

* add runner to microk8s group to avoid sudo usage

* run lint only on PR. tox -e lint should be runned locally for development

* syntax

* test with sudo

* add charm build and deploy

* syntax

* syntax

* add flag for charmcraft channel

* trying to find the charms directory

* checkout code needed for charm building

* specify local charms ./

* syntax

* fix order of steps

* add iprange, juju wait

* add dependency for juju wait

* add juju status to artifacts

* trying to figure out why juju wait isn't found in subsequent step

* try the snap instead

* setup artifacts

* fix artifacts conditional

* fix artifacts conditional

* test curl and failure

* add gate check for juju status on error or blocked

* add gate check for juju status on error or blocked

* temporary check to find external ip range

* fix ip range. runner is on 10.1.0.4/16, so range must be somewhere in there. And we only need one ip to test.

* missing echo

* temp test curl failure

* temp test curl failure

* add connection timeout in case of failure

* avoid long lines

* combine all jobs in a workflow, make func test run only if lint successfull

* turn all but flake8 to false

* set to run only on PR

* change name

* Enable multiple ip pools

* enable multiple ip pools

* shorten name

* update bug link

* Changes for code-review

* changes from code review https://github.com/charmed-kubernetes/metallb-operator/pull/1

* get all tests into one workflow

* remove unused sections of tox

* fix modified function name for bind_role

* add unit test in github actions

* test with github action tox-gh-actions

* full exec path for tox

* setup python to be able to use tox, following https://docs.github.com/en/actions/guides/building-and-testing-python#running-tests-with-tox

* syntax

* add unit tests for metallb-speaker and test failure

* re-add path

* restore original pythonpath setting

* remove extra stuff from tox.ini

* Use an oci-image resource for container images

* changes from code review https://github.com/charmed-kubernetes/metallb-operator/pull/1

* get all tests into one workflow

* remove unused sections of tox

* fix modified function name for bind_role

* add unit test in github actions

* test with github action tox-gh-actions

* full exec path for tox

* setup python to be able to use tox, following https://docs.github.com/en/actions/guides/building-and-testing-python#running-tests-with-tox

* syntax

* add unit tests for metallb-speaker and test failure

* re-add path

* restore original pythonpath setting

* remove extra stuff from tox.ini

* use oci_image

* set requirement as zip, otherwise it fails to download in the github actions

* add resources to github action deploy

* at cli, resource is singular

* test if pull_request_target will run on forked repo

* Replace storage step by new storage option in microk8s action

* Add compatibility for RBAC

* latest microk8s action includes the storage addon option

* ensure that the charm is blocked if api fails

* add rbac permissions file for if RBAC enable

* move error handling in original function in utils

* apply rbac changes

* optimize rbac yaml

* pep8

* add func test with rbac

* edit workflow name, conflict

* missing 'run'

* update workflow latest microk8s action

* using _target prevents us from being able to edit the workflow

* missing sudo

* mock oci_image and config_change only executes after started

* mock oci_image

* pep8

* update README with RBAC info

* units resolve automatically

* sometimes, juju bootstrap runs too quickly for workflow to succeed

* update namespace to fit workflow namespace

* fix error, role was not applied to serviceaccount

* forgot to re-add _ to stored attribute after test

* units may resolve automatically, but we should check if it needs a resolve action

* condense jobs in one workflow

* fix indent, add sleep

* add sleep

* tests are short, no need to add dependency for now

* still catching occasional failures at 10s

* add upstream-source as reference for users

* rename file because it is actually changing the operators permissions, not the controller permissions

* add log failure in the workflow

* add log failure in the workflow

* update namespace

* the units should resolve on their own, but if the check is done too quickly, then juju see units idle before they start resolving. adding a sleep here should help before the juju-wait check

* duplicate

* use yq to fetch upstream image info from metadata.yaml

* add MetalLB icon

* add MetalLB icon

* synching with master

* use same icon for each charm and for the bundle

cc28bfb... by Cory Johns

Remove Makefile and build scripts (#15)

* Remove Makefile and build scripts

The CI system has been refactored to handle operator framework charms
natively without needing to have a copy of the build scripts in every
charm repo. This removes those and cleans up the README with the
simplified build instructions.

* Fix GitHub workflow test

11f675b... by Cory Johns

Remove forcing /snap/bin to front of PATH (#14)

CI needs to use the pip package of charmcraft due to the use of a
non-standard HOME dir, and if a dev is using the snap then they should
already have it on the PATH.