* operator: introduce support to IPAM assigned IP address
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
* Add nmstate support
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
---------
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
Co-authored-by: Francesco Giudici <francesco.giudici@suse.com>
* Implement ManagedOSVersion controller and finalizer
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
* Remove unused ManagedOSVersion Status
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
---------
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
Co-authored-by: Francesco Giudici <francesco.giudici@gmail.com>
* 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>
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>
Also, change the default image to the one build with Docker.seedimage.
The expected image should have the following binaries available:
- xorriso
- curl
- base64
The image should also have as the default entrypoint an http server
starting on port 80 serving files from the working dir.
Related to:
https://github.com/rancher/elemental-operator/issues/374
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
* 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>
* operator: add SeedImage CRD and controller
* SeedImage: add Ready condition to track resource status
* SeedImage: add Pod and Service creation in the reconcile loop
* SeedImage: manage Pod lifecycle and set the download URL
* SeedImage: allow the pod to fail if something goes wrong
* SeedImage: add SeedImageReady condition
* SeedImage: improve status condition updates
* SeedImage: add controller tests
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
* operator: build-image API POD lifecycle management
Only one POD at a time allowed (for now).
* elemental-operator: improve build-image logging
* operator: add build-image Service
* operator: build-image API: delete Pod and Service on failure
* operator: add functions to manage registration cache
* operator: finalize build-image API Pod lifecycle
* operator: fix build-image API tests
* operator: ensure clean-up of build-image pods
* operator: add Services creation/deletion to Elemental ClusterRole
* operator: build-image: set download URL when job is completed
* operator: build-image: retry build job Pod creation if needed
* operator: build-image: in case of job Failure leave the Pod there
* operator: build-image: increase the time for job completion
* operator: make Code scanning happy
* operator: build-image: use NodePort Service
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
With kubebuilder we moved to sigs.k8s.io/controller-runtime logs.
Still, the registration part of the operator uses logrus for logging.
The operator debug config just enables verbose logging on the newer
controller-runtime logs: allow to enable verbose logging on registration
too.
Signed-off-by: Francesco Giudici <francesco.giudici@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 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
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>
* 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>
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>
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>
* 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>
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>
* 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>
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>
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>
* 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>