Commit Graph

13 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
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 8393423c8a Run all syncers in a pod
This commit moves the synchronization logic to allways happen in a Pod,
regardless being a Custom or JSON syncer. This allows having a simpler Pod
lifecycle management as part of the channel controller logic.

In addition, syncer pod logs are read on succeeded state instate of
running state to simplify Pod lifecycle management.

As a result channel updates trigger a new channel synchronization
without having to wait for the next scheduled sync.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-03 14:47:12 +02:00
Fredrik Lönnegren 04747a6b6a
Add cloud-config support to seedImage (#399)
* Add cloud-init support to seedImage

This commit adds a field to the SeedImage Spec for a cloud-config that
will be included in the built ISO.

If the cloud-config field is not set an empty file will be added to the
ISOs iso-config dir.

The reconciliation will take place in case the cloud-config is changed
and the base64 encoded value is used in an annotation in order to see if
the value has changed.

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

* Linting

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

* Add seedImage unit-tests

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

---------

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-03-23 09:36:36 +01: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 b4649dd363 Kubebuilder: Remove unused code (#267)
* Remove unused code

* Run make vendor
2022-12-12 12:15:22 +01:00
David Cassany Viladomat d3cefe36eb Add a rate limiter to managedosversionchannel reconciler (#260)
This commit adds a rate limiter to the ManagedOSVersionChannel controller to prevent
stacking reconcile loops over the same resource in fast rates (doesn't make sense for a
ManagedOSVersionChannel). By default the controller runtime already includes an
equivalent rate limiter, but starts in the range of milliseconds, starting the exponential
rate limiter in the range of seconds is more than enough in this context.

In addition it drops the failures counter in the resource. This counter was supposed to
be used to limit the number attempts to sync in case of failure. This was a bad design,
status should not keep a counter like this as any change in status triggers a new
immediate reconcile loop, hence the counter was reaching the maximum as fast as the
controller runtime was executing reconcile loops without any rate limiter (rate limiter
applies only when there are no changes including status).

For now I think we can just live without the setting any maxium for failures. If we ever
need it I believe it should be coded and tracked within the controller itself, not in each
resource as this prevents the reconcile loop of being idempotent. Alternatively we could
prevent triggering the reconcile loop on status changes, however this prevents
reconciling if any third party (or user from the kubectl client) changes a resource status.

Fixes #257
Part of #240

Signed-off-by: David Cassany <dcassany@suse.com>
2022-12-12 12:15:22 +01:00
David Cassany Viladomat f3aba7f2ae Improve syncer (#252)
This commit adds few changes on the syncer logic:

* Makes use of ManagedOSVersionChannel status reason to track if there
  is an on going synchronization rather than polling for the existence of a synchronization pod or not.

* Adds a logic to stop trying to synchronize after 4 consecutive attempts.
  If it exceeds the maximum it just programs the next re-sync after the given sync
  interval instead of immediately retrying.

* Adds some logging and comments here and there.

Signed-off-by: David Cassany <dcassany@suse.com>
2022-12-12 12:15:22 +01:00
David Cassany Viladomat eeb07166c6 New syncer logic (#245)
* Implement syncer logic as part of the ManagedOSVersionChannel controller

  This commit adds the logic to synchronize managedosversionchannels
  within the already existing controller.

* make generate
* make build-manifests
* Update chart
* update e2e tests

Signed-off-by: David Cassany <dcassany@suse.com>
2022-12-12 12:15:22 +01:00
Francesco Giudici f022acb6a3 unit-tests: add support to Secrets in registraion's OnChange()
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-09-23 15:29:07 +02:00
Itxaka 832ee7fad4
tests(registration): More unit tests (#167) 2022-09-07 17:53:24 +02:00
Itxaka 4fab515a30
Rework client to accept a ClientInterface (#166) 2022-09-07 10:39:26 +02:00
Itxaka 3257003185
tests(inventory): Add unit tests for inventory methods (#164) 2022-09-06 11:21:14 +02:00