Commit Graph

898 Commits

Author SHA1 Message Date
dependabot[bot] 0900bb6913
Bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 04:09:41 +00:00
dependabot[bot] 10196238be Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 13:00:42 +02:00
dependabot[bot] 6e0e5720b6 Bump actions/setup-go from 5 to 6
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 12:57:11 +02:00
dependabot[bot] de3296a447 Bump actions/labeler from 5 to 6
Bumps [actions/labeler](https://github.com/actions/labeler) from 5 to 6.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 12:53:35 +02:00
Julien ADAMEK 492d60ea4e
Merge pull request #927 from rancher/update_elemental_arigap_script
Add maintenance case to elemental-airgap.sh
2025-09-05 15:27:09 +02:00
Julien ADAMEK 338f566811 Add maintenance case to elemental-airgap.sh 2025-09-05 15:25:50 +02:00
David Cassany 5899edceae Stop using toolbox image in favor of bci-base image
Signed-off-by: David Cassany <dcassany@suse.com>
2025-08-27 14:22:48 +02:00
Francesco Giudici fda434de56
[ports from 1.7.x] Update default channel data (#919)
* Include -channel suffix to channel names

This prevent collisions with the SL Micro 6.1 channel
name provided in previous versions.

Signed-off-by: David Cassany <dcassany@suse.com>
(cherry picked from commit 9426f08849)

* Do not delete ManagedOSVersions by default

Signed-off-by: David Cassany <dcassany@suse.com>
(cherry picked from commit 7d42ed2096)

* Set default channel variable names consistent with OS version

Signed-off-by: David Cassany <dcassany@suse.com>
(cherry picked from commit a836fecfcc)

---------

Signed-off-by: David Cassany <dcassany@suse.com>
Co-authored-by: David Cassany <dcassany@suse.com>
2025-07-08 18:15:24 +02:00
Francesco Giudici 97608c0c2a OS channel: enable baremetal channel by default
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2025-07-03 12:21:25 +02:00
Francesco Giudici 43f3b00193
Bump libraries to incorporate CVE fixes (#913)
* Bump libraries to incorporate CVE fixes

Bump golang.org/x/net to cover CVE-2025-22870 and fix bsc#1238700.
Bump golang.org/x/crypto to cover CVE-2025-22869 and fix bsc#1239335.

In addition and as a requirement of the new x/crypto library go is bumped to 1.23

Signed-off-by: David Cassany <dcassany@suse.com>

* Dockerfile: bump golang container to 1.24 (#912)

Required since vendored x/crypto lib requires go ver >= 1.23

Related to #dd41431b0b2792f0fca005adf3abc3cf471877c4

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

* CVE-2025-22872

Bump golang.org/x/net
https://github.com/advisories/GHSA-vvgc-356p-c3xw

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

* go mod vendor

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

---------

Signed-off-by: David Cassany <dcassany@suse.com>
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
Co-authored-by: David Cassany <dcassany@suse.com>
2025-06-16 11:01:16 +02:00
Francesco Giudici 317de1e25a
Label Templates: improve Random family processing (#914)
* Label Templates: fix Random check

This commit fixes the panic occurring  with a malformed Random
template label (${Random}).

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

* Label Templates: don't fail registration for a wrong label

A wrong Random label syntax causes an error that fails and stops
the registration process: don't stop the registration, just log the
error, skip the label and proceed.

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

---------

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2025-06-13 14:21:28 +02:00
Francesco Giudici aa6474c618
operator: update RBAC for upgrade plans (#908)
Add "get" verb for Pod resources.

Fixes https://github.com/rancher/elemental/issues/1702

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2025-05-08 14:11:01 +02:00
Francesco Giudici 8fc8efd48e
[Airgap] extend yq support in the airgap script (#898)
The airgap script used to work with the Mike Farah's yq.
Anyway, it was incompatible with the Andrey Kislyuk's yq version (which
is the main python3 version you would get via pip).

Drop the eval arg from yq in the airgap script to make it compatible
with both.
Also check the yaml keys are there before trying recursion (which would
led to error out with some yq parsers)

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2025-01-31 15:51:08 +01:00
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
David Cassany Viladomat f4d7b6f51d
Fix generation of already present resources (#892)
* Fix generation of already present resources

Signed-off-by: David Cassany <dcassany@suse.com>

* Fix legacy name

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-12-09 15:53:49 +01:00
Francesco Giudici a72970523a
SeedImage: fix description (#889)
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-12-04 08:59:17 +01:00
Francesco Giudici 884beb5990
golanci-lint: change output format (#887)
[...]
level=warning msg="[config_reader] The output format `github-actions` is
deprecated, please use `colored-line-number`"
[...]

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-11-28 17:48:08 +01:00
Andrea Mazzotti ad150a8760
Add created date to the ManagedOSVersion common metadata fields (#886)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-11-28 15:06:26 +01:00
Francesco Giudici 5e14e968ee
Label Templates: add IP addresses to the Network variables (#885)
* util: add network util functions

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

* Label Templates: add IPAddress to the Network vars

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

* util/net: rework to allow mocking system ip address retrieval

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

* util/net: return all the available network addresses

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

* Label Templates: add IPAddresses.{num} to the Network vars

track all available network addresses

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

* make generate-mocks

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

* tests: add util/net coverage

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

* error strings should not be capitalized

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

---------

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-11-26 09:17:00 +01:00
David Cassany Viladomat b3c9ef8887
Update default channels to 6.1 images (#883)
* Update default channels to 6.1 images

Signed-off-by: David Cassany <dcassany@suse.com>

* Update questions

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-11-12 09:49:08 +01:00
David Cassany f300a43fd9 No need to make any GH release
Signed-off-by: David Cassany <dcassany@suse.com>
2024-10-25 13:13:41 +02:00
Andrea Mazzotti 6372ec6706
Only reset network if a network configurator is used (#874)
* Only reset network if a network configurator is used

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-10-22 14:56:33 +02:00
Andrea Mazzotti cf1a2d6400
Do not include Config to MachineRegistration as pointer (#870)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-10-17 08:09:41 +02:00
David Cassany fad205a5b6 Split elemental-operator and elemental-register at OBS level
Signed-off-by: David Cassany <dcassany@suse.com>
2024-10-08 09:54:33 +02:00
Andrea Mazzotti ab193eca6f
Add support for agent-tls-mode Rancher setting (#863)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-10-07 13:11:26 +02:00
Francesco Giudici de3c37dfc6
RBAC: restrict SeedImage controller auth to fleet-default (#864)
* RBAC: restrict SeedImage controller auth to fleet-default

do not allow the seedimage-controller to operate on pods, services and
configmaps outside of the fleet-default namespace.

Fixes #457

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

* RBAC: move all rbac resources to rbac.yaml

Also have all of them collected and generated via kustomize

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

---------

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-10-07 09:23:50 +02:00
Andrea Mazzotti 69d4bc1329
Use privateCA for Rancher on dev environment (#857)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-10-02 10:23:10 +02:00
Andrea Mazzotti 08f6cda748
Build e2e chart locally (#852)
* Build e2e chart locally

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Add mockgen to build tools

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Add missing GINKGO tool

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Reduce e2e tests concurrency

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Make test more verbose

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Bump system-upgrade-controller version

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Raise timeout

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Print error

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Add plan crd

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Adjust timeout

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Do not deploy operator twice

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Restore vendored helper

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Do not attempt to delete pods multiple times

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Remove debug println

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Disable e2e workflow

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Update ele-testhelpers library

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

---------

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-10-01 12:54:40 +00:00
Francesco Giudici 4e313f7d0f
charts: drop chart version from resource labels (#854)
Fixes #846

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-09-30 14:48:36 +02:00
Loic Devulder 5702286029 [Airgap] Fix script to support Dev and Staging
Newer versions of Dev and Staging now need to be explicitly allowed to
be pull with Helm.

Signed-off-by: Loic Devulder <ldevulder@suse.com>
2024-09-30 09:34:51 +02:00
Andrea Mazzotti 3df501da73
Allow configuration of max snapshots during install (#851)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-09-25 13:31:29 +02:00
David Cassany Viladomat 7ba0a1e7ed
Update helper scripts to 1.6.x channel setup (#850)
Signed-off-by: David Cassany <dcassany@suse.com>
2024-09-25 12:04:51 +02:00
Francesco Giudici 60808bfe11
Label Templates: render also machineInventoryAnnotations (#848)
* Label Templates: render also annotations

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

* tests: move label templates tests to separate file

from api_registration_test.go to labeltmpl_test.go

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

* tests: re-use hostinfo variable

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

* tests: drop leftover printf()

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

* tests: add updateInventoryAnnotations() coverage

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

---------

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-09-20 11:21:46 +02:00
Francesco Giudici c9223009e6
label templates: drop spaces from Storage variables (#847)
was a leftover from label templates rework

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-09-20 08:17:37 +02:00
David Cassany Viladomat e6bca47c23
Switch to git based repository in OBS (#845)
* Structure OBS package recipes in folders matching the OBS package name

Signed-off-by: David Cassany <dcassany@suse.com>

* Adapting specfile to new package format

Signed-off-by: David Cassany <dcassany@suse.com>

* Adding _service files to .obs sources

Signed-off-by: David Cassany <dcassany@suse.com>

* Fine tune specfile

Signed-off-by: David Cassany <dcassany@suse.com>

* Use %VERSION% as the version placeholder

Signed-off-by: David Cassany <dcassany@suse.com>

* Remove unneeded OBS workflow

Signed-off-by: David Cassany <dcassany@suse.com>

* Adapt Makefile to new charts paths

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-09-16 15:44:22 +02:00
David Cassany cdb34aa711 Update questions to use SL Micro 6.0 channels
Signed-off-by: David Cassany <dcassany@suse.com>
2024-09-13 16:02:42 +02:00
Francesco Giudici 723d7c3eb1
Label Templates: rework collection of 'hostinfo' data and collected variables (#843)
* Label Templates: rework collection of 'System Data' info
Allow automatic conversion of data to map[string]interface{} (Template
Labels format) using reflection where all data can be useful.
Still do manual collection of data in the map[string]interface{} when
dropping of part of the data is needed.

Use the original hostinfo field names, drop spaces in the keys.
Import also the SMBIOS data from hostinfo, since are there (so also
without dmidecode tool some SMBIOS info will be available).

Keep support of old HARDWARE variable (to be deprecated sooner or
later).

* register/dumpdata: rework initial version adding more options
notably the "label" output format, which is now the default

* register: send both legacy and new Label Templates variables
we don't want to break possible setups using the older Label Templates
variables: send both.

* tests: check new hostinfo Label Templates format

---------

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-09-13 08:45:45 +02:00
Francesco Giudici 9e42b1990a
register: add 'version' and 'dumpdata' subcommands (#835)
'dumpdata' allows to inspect host data from the running host as they are
collected during the registration phase: those are the data made
available in the Elemental Label Templates feature.
This subcommand was developed while working at #834 and since could be
handy for debugging and even for users (elemental sysadmins) adding it
to the elemental-register binary.

'version' is the very first step in moving the elemental-register flags
to command, as requested by #832.

Related to issues: #832, #834

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-09-06 10:37:04 +02:00
Francesco Giudici 198628f8fc
operator: add Registry to ManagedOSVersionChannels Spec (#831)
The new Registry field allows to prepend a common registry to the
image URLs of the embedded ManagedOSVersion resources.

Fixes #549

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-09-03 16:05:03 +02:00
Francesco Giudici 122109f7d9
Random template labels - avoid override (#830)
* operator: render 'Random' template lables once

Otherwise we would keep overwriting the template labels which have
Random variables, that are rendered each time differently.

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

* tests: check Random template labels overwrite rules

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

---------

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-08-28 09:13:46 +02:00
Andrea Mazzotti 0899ba2953
Add SeedImage.status.checksumURL (#827)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-08-22 12:23:20 +02:00
Loic Devulder 488ad0d890 [Airgap] fix channel extraction for 1.7 version
Signed-off-by: Loic Devulder <ldevulder@suse.com>
2024-08-22 10:04:37 +02:00
Andrea Mazzotti b7f70897f0
Fix flaky network test (#825)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-08-21 09:20:46 +00:00
Andrea Mazzotti 3de0fc7a47
Use after-install && after-reset stages to initialize system (#822)
* Use after-install && after-reset stages to initialize system

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Use dynamic CLOUD_INIT_PATHS

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

* Use IPAM driven network config on Recovery

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>

---------

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-08-20 13:39:45 +02:00
Andrea Mazzotti d857bda0cc
Implement Network Configurators (nmc, nmstate, nmconnections) (#819)
* Implement Network Configurators (nmc, nmstate, nmconnections)

Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-08-13 17:35:54 +02:00
Francesco Giudici d8bcf7408a
operator: add built-in 'Random' label templates (#821)
introduce built-in random templates:
* ${Random/UUID}
* ${Random/Hex/[0-32]}
* ${Random/Int/[MAXINT]}

examples:
${Random/UUID} --> e512d5ca-a765-42f2-82b7-264f37ffb329 ${Random/Hex/12} --> e512d5caa765
${Random/Int/1000} --> 199

Fixes #802

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-08-13 13:00:59 +02:00
Francesco Giudici e4c75194c2
networking: use the main registration websocket channel for network data (#820)
* operator/register: merge network config retrieval with registration
use the same websocket connection to exchange all the data

* tests: fix tests

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-08-12 10:10:01 +00:00
Francesco Giudici 2858dad900
error strings should not be capitalized (ST1005) (#814)
moreover, dump the inner error

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-08-09 15:43:52 +02:00
Andrea Mazzotti 3f185597b0
Bandaid local build (#818)
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
2024-08-09 12:59:29 +02:00
Andrea Mazzotti 342bba265c
IPAM to nmstate network config (#793)
* 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>
2024-08-09 10:32:19 +02:00