Commit Graph

19 Commits

Author SHA1 Message Date
Francesco Giudici 97db17d73b
make linter happy - update copyright dates (#899)
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2025-01-31 15:33:47 +01:00
Andrea Mazzotti 0839780db8
Sanitize elemental-operator dependencies (#690)
* Update system-upgrade-controller API

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Update Fleet API

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Sanitize dependencies

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

---------

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-03-20 15:46:51 +01:00
Fredrik Lönnegren da0776b710 Update copyright year (2024)
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-01-05 13:14:27 +01:00
David Cassany 662d618a01 Improve update events filtering to actually ignore status updates
Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-03 19:02:18 +02:00
David Cassany 24a5fdd972 Recreate service account token secret if missing
This commit checks on each reconcile loop if the service
account token secret is missing despite being on ready
state.

In addition it also adds optimistic locking for patch calls. The
motivations is to prevent concurrent controllers to modify
outdated data.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-07-24 09:46:26 +02:00
David Cassany 989851fa61 Do not make use of ServiceAccount.Secrets list
This commit stops using the ServiceAccount.Secrets list, as noted my
k8s this should not be used to find SA's associated secrets and this
is no longer being automatically managed by k8s since v1.24.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-07-11 17:06:37 +02:00
David Cassany 42314f4382 Fix elemental managed label value to match backup operator expectations
Signed-off-by: David Cassany <dcassany@suse.com>
2023-07-11 17:06:37 +02:00
David Cassany 81e4228400 Fix event filters
Signed-off-by: David Cassany <dcassany@suse.com>
2023-03-29 15:24:17 +02:00
Francesco Giudici 52637a0c9d
operator: ensure elemental finalizers are removed if present (#393)
We have removed finalizers from MachineInventories and MachineRegistrations.
Still if we upgrade from older operator versions, we may inherit old resources with the finalizers set there. In this case, when the "old" resources get deleted, no one will remove the finalizers preventing their actual deletion.
Ensure the finalizers are cleaned up if there when the resource is deleted.

Fixes https://github.com/rancher/elemental-operator/issues/391

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2023-03-17 15:17:04 +01:00
David Cassany 337354078b Stop using finalizers if not extrictly needed
Signed-off-by: David Cassany <dcassany@suse.com>
2023-03-14 15:48:49 +01:00
David Cassany a226ad19ae Set object not found as a debug message
Signed-off-by: David Cassany <dcassany@suse.com>
2023-03-09 11:29:01 +01:00
David Cassany 4729e3be9e Update logs to not use info with custom depth
Signed-off-by: David Cassany <dcassany@suse.com>
2023-03-09 11:29:01 +01:00
Fredrik Lönnegren 46b4e2f9a8
Turn MachineInventoryRef into LocalObjectReference (#359)
* Turn MachineInventoryRef into LocalObjectReference

Make the MachineInventorySelector reference to an owned
MachineInventory a LocalObjectReference, since a resource cannot
own another resource in a different namespace.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Fix typo

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

---------

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-02-15 20:42:15 +00:00
Fredrik Lönnegren b9d1c82976
Copyright date-range 2022 - 2023 (#327)
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-01-13 10:30:48 +01:00
Alexander Demicev ebca28f734
Remove invalid conditions from objects (#284) 2022-12-12 14:14:50 +00:00
Francesco Giudici e60da05e35 [controller_runtime] operator/registration: switch to Kubebuilder client (#256)
* operator/registration: switch to Kubebuilder client

Fixes #239

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* operator/registration: adapt tests to Kubebuilder client

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* unit-tests: vendor controller-runtime fake client

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* operator: add yaml annotations for correct marshalling

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* operator/RBAC: add "get" verb to ServiceAccount resources

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* operator: generate rbac

make generate-manifests
make build-rbac

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* Add elementalcli package

Create a separate package to deal with elemental-cli installation.
This brings the elemental-cli functions declared in the config package
to a new package that just parses a map[string]interface argument.

This is a step to enable usage of the elemental-cli functions with the
new elementalv1.Config.Elemental.Install type.

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* register: switch to Kubebuilder api

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* register: add mapstructure annotations for correct marshalling

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* register: reduce complexity of the run function

Make linter happy:
"cyclomatic complexity 16 of func `run` is high (> 15) (gocyclo)"

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

* register: drop io/ioutil in favor of os package

io/ioutil is deprecated

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-12-12 12:15:22 +01:00
Francesco Giudici ea5da84a46 controller: add Secret name reference to the ServiceAccount (#247)
Otherwise we will have no Secrets in the ServiceAccount for kubernetes
clusters >= 1.24

Fixes: #246

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-12-12 12:15:22 +01:00
Alexander Demicev 0edac91853 Add remaining controllers (#232)
* Update vendor

* Run generation tasks

* Minor fixes in Makefile

* Remove old code

* Add remaning controllers

* Minor e2e tests improvements

* Switch osversionchannel syncer to controll runtime

* Minor fixes in controllers

* Fix unit tests
2022-12-12 12:15:22 +01:00
Alexander Demicev e1dc2202b6 Kubebuilder: Add machine registration controller (#206)
* Add new package to Dockerfile

* Update dependencies

* Add unit test helpers

* Add new machine registration controller

* Remove old machine registration controller

* Add rbac tag for secrets

* Fix container argument in chart

* Add labels to all created resources
2022-12-12 12:15:22 +01:00