Commit Graph

10 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 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
Francesco Giudici 63c99d7057
unit-tests: ensure resources cleanup (#390)
this allows to fix sporadic issues with unit tests:

createRBACObjects
  should successfully create RBAC objects
  /home/fgiudici/go/src/github.com/rancher/elemental-operator/controllers/machineregistration_controller_test.go:202
1.6788283160593388e+09  INFO    Reconciling RBAC resources
1.6788283160594149e+09  INFO    Creating role
1.6788283160648215e+09  INFO    Creating service account
1.6788283160696208e+09  INFO    Creating token secret for the service
  account
1.6788283160727391e+09  INFO    Creating role binding
1.678828316076215e+09   INFO    Setting service account ref
------------------------------
• [FAILED] [0.090 seconds]
createRBACObjects
/home/fgiudici/go/src/github.com/rancher/elemental-operator/controllers/machineregistration_controller_test.go:158
  [It] should successfully create RBAC objects
  /home/fgiudici/go/src/github.com/rancher/elemental-operator/controllers/machineregistration_controller_test.go:202

  Begin Captured GinkgoWriter Output >>
    1.6788283160593388e+09      INFO    Reconciling RBAC resources
    1.6788283160594149e+09      INFO    Creating role
    1.6788283160648215e+09      INFO    Creating service account
    1.6788283160696208e+09      INFO    Creating token secret for the
      service account
    1.6788283160727391e+09      INFO    Creating role binding
    1.678828316076215e+09       INFO    Setting service account ref
  << End Captured GinkgoWriter Output

  Expected
      <types.UID>: dabb952e-aced-466f-9a98-555675dbd66f
  to equal
      <types.UID>: testuid
  In [It] at:
/home/fgiudici/go/src/github.com/rancher/elemental-operator/controllers/machineregistration_controller_test.go:212

  Full Stack Trace
    github.com/rancher/elemental-operator/controllers.glob..func6.3()
        /home/fgiudici/go/src/github.com/rancher/elemental-operator/controllers/machineregistration_controller_test.go:212
+0x8b3

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2023-03-15 10:25:58 +01:00
David Cassany e413e23f75 Adapt tests to drop finalizers
Signed-off-by: David Cassany <dcassany@suse.com>
2023-03-14 15:48:49 +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
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 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