* Add new Micro 6.0 channels
Signed-off-by: David Cassany <dcassany@suse.com>
* Use the proper dynamic URI for channel images
Signed-off-by: David Cassany <dcassany@suse.com>
---------
Signed-off-by: David Cassany <dcassany@suse.com>
Remove the static check to re-register only after 24 hours.
The re-registration will then happen every time the elemental-register
client is called.
This static timer was introduced to limit as much as possible the
communication form the host to Rancher and save communication bandwidth
for remote clients.
Anyway, this makes not much sense as long as the elemental-system-agent
is running, which will in any case keep connecting to Rancher.
The call to the elemental-register binary is performed on official
Elemental SLE Micro images every 30 minutes and at each boot.
Fixes https://github.com/rancher/elemental-operator/issues/811
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
Reworked the code to provide templating to MachineInventory labels and name.
The template source data is the "System Information" (BIOS) and "System Data" (which we usually called 'HW Labels') data sent by the machines via the register client.
This rework fixes some bugs and duplicated code and slightly changes the behavior in few cases.
The behavioral changes address the following corner cases:
* `.` is added to the allowed characters in label values (previously was substituted with `-`).
* when the first character of a label value is an accepted one but not alphanumeric (i.e., `-` , `_` or `.`) we drop it (previously we prepended `m` to the label).
* if the last character of a label value is not alphanumeric (i.e., `-` , `_` or `.`) we drop it (previously was not checked).
note that for the MachineInventory name (which will also be the machine hostname after k8s provisioning) the allowed set of characters has not changed: it's the same of the label case but without the `_` (i.e., `-` or `.`).
Regarding the MachineRegistration.spec.machineName:
* if it is empty, a default `m-${UUID}` value is assigned to the MachineInventory.name (as previously)
* if it contains a template value which doesn't exists (wrong template value or `nosmbios` option) the MachineInventory.name is assigned a default `m-${UUID}` name (new behavior).
* if it is not empty, but after resolving the template values and sanitizing the string it gets empty, the name assignment process will error out failing the registration process.
Commits:
* operator: move label templating functions to separate file
no code changes, just label templating functions moved to labeltmpl.go.
* operator: add pkg/templater
* operator: add few comments
* operator: rework label templating
Fixes#807
* tests: update api_registration_test.go
* operator: move regexp to label templating file
* operator: change template behavior in corner cases
1. '.' is added to the allowed characted in label values (previously was
sobsituted with '-').
2. when the first character of a label value is not alphanumeric ("-" or
"_" or ".") we drop it (previously we prepended 'm').
3. if the last characted of a label value is not alphanumeric ("-" or
"_" or ".") we drop it (previously was not checked).
* tests: improve coverage of label templating
* make linter happy
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
* 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>
In GHA we sporadically see equaity check to fail because the underlaying
slice arrays of a []byte pair are having a different capacity despite
having the same lenght and content.
Signed-off-by: David Cassany <dcassany@suse.com>
This commit adds a development channel reference to builds
done in OBS (under or branched from isv:Rancher:Elemental)
Signed-off-by: David Cassany <dcassany@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>
* Use dynamic system agent applied dir
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
* Use dynamic RKE2 data-dir
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
---------
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
* operator: fix ManagedOSVersionChannel sync
After the very fist initial sync, all subsequently channel syncs fail.
Fixed.
fixes: https://github.com/rancher/elemental-operator/issues/766
* operator: don't assume ManagedOSVersion resources have annotations
Older resources may not have annotations yet: initialize the field.
Fixes: https://github.com/rancher/elemental-operator/issues/767
---------
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
The newer versions of jaypipes/ghw include a new type of Disk and
Controller in the Blocks section.
We use the library json serialization functionality: the deserialization
function of the older version of the library (0.9.0) would error out
when trying to decode serialized data of newer versions if they include
the new "virtual" drive or the new "loop" controller.
For now, just remove those devices.
Proper fix will be to better deal with this kind of errors avoiding
tearing down the registration process.
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
* Allow cross build of seed-image ISOs
This commit makes use of the targetPlatform field on the seedImage spec
to allow building ISOs for different architectures.
It does this by spawning the initContainer using the seedImageBuilder
image and using the `elemental pull-image --platform=` command to
download the correct ISO and copies it to the attached volume.
One drawback of this approach is we don't get the caching of images in
the container runtime that we get when building natively.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* seedimage: clean-up service on image download deadline
We used to just clean-up the Pod carrying the built image when hitting
the cleanupAfterMinutes deadline.
There is no need to leave the Service around, clean that up too.
Fixes#704
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
* Update controllers/seedimage_controller.go
Co-authored-by: Fredrik Lönnegren <fredrik.lonnegren@gmail.com>
Signed-off-by: Francesco Giudici <francesco.giudici@gmail.com>
---------
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
Signed-off-by: Francesco Giudici <francesco.giudici@gmail.com>
Co-authored-by: Fredrik Lönnegren <fredrik.lonnegren@gmail.com>
When building an ISO, we create a Pod and a Service to expose the built
ISO when ready.
The link to the ISO is then exposed through the Elemental Operator
Deployment, that acts as an Ingress.
The Service we create to expose the Pod port is of type NodePort: this
is not needed,is just a leftover from the initial implementations, where
we usede to expose a "direct" link to the Pod.
No need to keep a NodePort service now, let's have a ClusterIP Service
type instead.
Fixes: https://github.com/rancher/elemental-operator/issues/705
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>