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>
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>
* 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>
* 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
* Add e2e test config
* Switch to using test config
* Update vendor
* Fix lint issues
* Change rancher namespace variable name
* Put do nothing test back
Enables deploying multiple operators replicas.
Changes tests to account and test this
Chart changes:
- Make any fixed names default to the release name. As release name has
to be unique per namespace, this is a good practice instead of
hardcoding whatever name we want. This shouldnt affect anything as
the full chart uses that by default now.
Signed-off-by: Itxaka <igarcia@suse.com>
Signed-off-by: Itxaka <igarcia@suse.com>
This target (ab)uses the ginkgo BeforeSuite to have a ready-to-test
cluster with all prerequisites installed for easy testing.
It will build the docker image for the operator, build the chart
pointing to that image, setup a kind cluster, load the docker image
locally built into the cluster and run an empty test which is done so
the BeforeSuite is run, which installs all the needed charts and the
operator into the system.
Signed-off-by: Itxaka <igarcia@suse.com>
* Generate v3.Setting code
Signed-off-by: Itxaka <igarcia@suse.com>
* Use the rancher cacerts for the registration
Also drops the cacert passing via chart, adds proper permissions to the
settings resource, adds the cache index and checks that indeed we are
returning a cacert on the registration url
Signed-off-by: Itxaka <igarcia@suse.com>
* fix lint
Signed-off-by: Itxaka <igarcia@suse.com>
* Drop manual rancherl-url and get the rancher url automatically
Drop any manual setup of rancher-url and use the settings to get the set
rancher-url
Signed-off-by: Itxaka <igarcia@suse.com>
* Small fix for getRancherCACert
Signed-off-by: Itxaka <igarcia@suse.com>
* Fix test setting the wrong url
Signed-off-by: Itxaka <igarcia@suse.com>
This commit makes sure elemental-operator and elemental-installer are
using the same structures to describe and define the elemental-cli
installation.
Signed-off-by: David Cassany <dcassany@suse.com>
There seems to have some confusion between the namespace of the operator
to run on and the namespaces we want the operator to watch
This restores the sync_namespaces so the operator can watch all
namespaces and sets teh namespace option to be where the operator is
runnig, needed for things like the registration url to be properly
served
Signed-off-by: Itxaka <igarcia@suse.com>
- Use the default namespace instead fo fleet-local. The chart now
defaults to use the same namespace to watch as the one being
installed onto, so we need to run our resources in the same one for
testing
- Skip some non-working tests. Those require a new discovery plugin
image published with a fixed entrypoint
Signed-off-by: Itxaka <igarcia@suse.com>
Remove all the mentions to rancheros-operator in tests, imports and
dependencies.
Restore e2e scripts and test targets on makefile
Fix all lint issues
Signed-off-by: Itxaka <igarcia@suse.com>
The test is trying to run an upgrade on the cluster, checking the logs
of the pod created by system-upgrade-controller which should contain
traces of elemental-cli being called.
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>