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 d280e61748
Implement Enabled field on ManagedOSVersionChannels (#800)
* Implement channel Enabled flag

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-07-30 09:31:02 +02:00
David Cassany Viladomat d7a712d3ca
Update channels (#781)
* Update channels
* Adding a downgrade/upgrade charts e2e test
* Only fetch logs for running containers
* Do not fail fast in e2e matrix

Signed-off-by: David Cassany <dcassany@suse.com>
2024-07-02 17:53:15 +02:00
Andrea Mazzotti d07b4f5fde
Add toggle to automatically delete no longer in sync versions (#780)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-06-25 12:25:55 +02:00
David Cassany 61e76e2964 Ensure re-sync is triggered
Signed-off-by: David Cassany <dcassany@suse.com>
2024-06-21 16:32:32 +02:00
Andrea Mazzotti abbc0eae31
Flag no longer in sync ManagedOSVersions (#750)
* Flag no longer in sync ManagedOSVersions

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-06-12 15:40:03 +02:00
David Cassany Viladomat a1c173f03c
Make channel sync more robust (#638)
* Add a sync failure counter

This commit adds a channel sync failure counter to count the
number of consecutive sync failures. This logic is meant to
prevent creating and deleting a pod in case of errors (e.g.
unreachable download URL) in an infinite loop. After several
attempts to synchronize it will give up until the next
scheduled synchronization.


* Add syncedGeneration in status

This commit adds in managedOSVersionChannel status
the generation of the last synchronization attempt. This
is useful to prevent spurious reconciles to trigger an
unexpected sync and also to force immediate resync in case
of a channel update.


Signed-off-by: David Cassany <dcassany@suse.com>
2024-02-21 17:44:04 +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 b359b1e23f Improve error management
Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-06 16:33:39 +02:00
David Cassany 64b15a6127 Patch already existing versions on channel sync
Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-06 16:33:39 +02:00
David Cassany 502d832a6c Add some improvements
Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-03 14:47:12 +02: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
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
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
David Cassany Viladomat 0b723e059e
Set default syncTime when not provided (#289)
Signed-off-by: David Cassany <dcassany@suse.com>
2022-12-12 15:05:31 +00: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
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