Commit Graph

31 Commits

Author SHA1 Message Date
Alexander Demicev 9c212ea32a
Merge all main logic in one file (#270) 2022-12-01 14:59:11 +01:00
David Cassany Viladomat c18f66d8b8
Drop requeuer, not needed anymore (#255)
* Drop requeuer, not needed anymore
* Improve logging

Signed-off-by: David Cassany <dcassany@suse.com>
2022-11-21 12:37:14 +01:00
David Cassany Viladomat ed268ce451
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-11-16 18:38:23 +01:00
Alexander Demicev db7d0dd68e
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-11-10 11:26:34 +01:00
Alexander Demicev d553a0883d Kubebuilder: Add machine inventory selector controller (#224)
* Add machine inventory selector controller

* Remove old machine inventory selector code
2022-10-27 12:30:03 +02:00
Alexander Demicev 0fde15069d 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-10-27 12:28:55 +02:00
Alexander Demicev 286e163838 Kubebuilder: Run new code and generate RBAC (#203)
* Add new command for running kubebuilder based code

* Add make task for generating RBAC from code

* Add new directory to makefile
2022-10-27 12:27:35 +02:00
Itxaka 4fab515a30
Rework client to accept a ClientInterface (#166) 2022-09-07 10:39:26 +02:00
Itxaka 01fd853832
Remove default value for flag and expand description (#126)
Make sure we have a decent description for the --operator-image flag as
that is used down the line by the syncer to run the display command and
gather the results from the version syncer.

Also remove the default value for the flag. It makes no sense to have a
default value if we mark a flag as required, as that value will always
be overwritten by the flag.

Signed-off-by: Itxaka <igarcia@suse.com>
2022-08-10 14:31:54 +02:00
Itxaka ea7884e8df
Produce 2 binaries instead of one (#99)
* Produce 2 binaries instead of one

This generates a different binary for the register command as to not
bundle it with the full operator.

On the makefile separated builds have been done for operator and
registry.

On the docker image a different container is created for the register
and pushed to a different repo as well.

For releases gorelease generates 2 different binaries.

Signed-off-by: Itxaka <igarcia@suse.com>
2022-08-01 15:08:23 +00:00
Francesco Giudici 53d463dbaf elemental-operator register: add some more logging
mainly more logs about reading config

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-07-22 18:07:18 +02:00
Itxaka f2ab68c3ca
[register] Check for path error before doing anything (#80) 2022-07-22 13:25:41 +00:00
David Cassany Viladomat cf20bc60bb
Make /oem/registration the default configuration dir (#81)
This commit uses /oem/registration as the default directory
to load configuration from in elemental-opertator register command

Signed-off-by: David Cassany <dcassany@suse.com>
2022-07-22 15:11:47 +02:00
David Cassany Viladomat 52c3cbbec2
Store registration yaml in installed system (#71)
Signed-off-by: David Cassany <dcassany@suse.com>
2022-07-21 11:42:13 +02:00
David Cassany Viladomat 79d957e1df
Adds support for cloud-config data in machine registration (#61)
Signed-off-by: David Cassany <dcassany@suse.com>
2022-07-20 10:42:08 +02:00
David Cassany Viladomat 6e2f20f3be
Pass debug flag to elemental client if requested (#58)
Signed-off-by: David Cassany <dcassany@suse.com>
2022-07-18 16:42:43 +02:00
David Cassany Viladomat 2381ebc55a
Do not attempt to install in already installed systems (#55)
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>

Co-authored-by: David Cassany <d.cassany@suse.com>
2022-07-15 14:57:51 +00:00
Itxaka 618d3c4da3
Log the version, commit and commit date on start (#43) 2022-07-15 09:50:18 +00:00
David Cassany Viladomat bd811be876
Remove obsolete logic from former ros-installer (#45)
* Remove obsolete logic from former ros-installer

Signed-off-by: David Cassany <dcassany@suse.com>
2022-07-15 10:48:41 +02:00
Francesco Giudici a05a2dbae6 elemental-operator register: enable local plans
Enable local plans execution in the rancher-system-agent

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-07-14 17:28:56 +02:00
Francesco Giudici 602178c01d
elemental-operator register: allow cacert passed as file or data (#44)
We now process the cacert as a file path: the yaml file from kubernetes
anyway passes it as the acutal cert data. Manage both cases.

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-07-14 14:28:47 +02:00
Itxaka adfff7c91a
Some register fixes (#40)
* Some register fixes

 - Add debug flag for debug loggin
 - Add docs to command
 - Add docs to flags
 - Pass the cacert via a file, NOT via string
 - Rename var config so it doesnt clash with imported package name

Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-13 17:05:19 +00:00
Francesco Giudici 62bac1d84e
elemental-operator register: add elemental cli call (#38)
The elemental-operator register command, after retrieving the config
registration will directly call the elemental cli to start the actual
installation process.

Co-authored-by: David Cassany <dcassany@suse.com>
Co-authored-by: Francesco Giudici <francesco.giudici@suse.com>

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

Co-authored-by: Itxaka <igarcia@suse.com>
2022-07-13 17:30:12 +02:00
Itxaka e87eb80c9c
Use cacert from rancher and use serverl-url from rancher (#36)
* 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>
2022-07-13 16:11:21 +02:00
David Cassany Viladomat 14d4d957cf
Share installation configuration structures (#24)
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>
2022-07-12 12:36:53 +02:00
Itxaka 7f6baefb2a Restore sync-namespaces
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>
2022-07-11 15:13:22 +02:00
Itxaka e6ceda4928 Fix operator display output
For some reson copying the file to stdout produces an empty line which
breaks reading from it, restore it to how it was

Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka 99679d1815 Set logrus to debug if debug is enabled
Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka 5c5f1150cb Fix all the test, remove leftovers from transition
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>
2022-07-11 15:12:19 +02:00
David Cassany Viladomat 1d97f14de7
Merge elemental installer (#20)
* Move main into a cmd/operator package
* Add elemental-installer
* Adding installer unit tests
* Update Makefile
* Update .github/workflows/unit-tests.yaml
* Adapat Dockerfile and golreleaser to keep releasing and building elemental-operator as they used to

Signed-off-by: David Cassany <dcassany@suse.com>
Co-authored-by: Itxaka <igarcia@suse.com>
2022-07-07 14:47:32 +02:00
Jacob Payne c5a5dbd77f renamed to elemental-operator and switched to system agent 2022-06-30 16:01:13 +00:00