Commit Graph

55 Commits

Author SHA1 Message Date
Alexander Demicev 9c212ea32a
Merge all main logic in one file (#270) 2022-12-01 14:59:11 +01:00
Alexander Demicev 8283d03496
Kubebuilder: Remove unused code (#267)
* Remove unused code

* Run make vendor
2022-11-29 12:29:55 +01:00
Alexander Demicev 87857f47cb
Fix make verify (#248) 2022-11-15 12:06:48 +01:00
Alexander Demicev aee446d309
Kubebuilder: Add "verify" workflow (#244)
* Add new verify tasks

* Fix go mod
2022-11-11 14:37:03 +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 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
Alexander Demicev 03988e1ef8 Kubebuilder: Add make tasks for different tools (#194)
* Add tools binaries to Makefile

* Run make generate

* Update github workflows

* Impove path to tools
2022-10-27 12:27:27 +02:00
Itxaka 2e2b5a2034
tests: use latest url for rancher charts (#218) 2022-10-19 15:57:51 +02:00
Alexander Demicev 61749bd8c6
Add config for e2e tests (#201)
* Add e2e test config

* Switch to using test config

* Update vendor

* Fix lint issues

* Change rancher namespace variable name

* Put do nothing test back
2022-10-11 13:03:01 +02:00
David Cassany Viladomat 1af1d0709e
Add vendor for obs integration (#198)
These changes are required to facilitate OBS code updates and builds by simply triggering OBS services. This allows updating code and rebuild in OBS based on github events such as on tag, on merge, on push...

Signed-off-by: David Cassany <dcassany@suse.com>
2022-10-07 14:23:11 +00:00
Loic Devulder 72ef079d09
register: build it with CGO (#169)
* register: build it with CGO
It's needed to be able to use TPM emulation.
* goreleaser: add entry for elemental-support

Signed-off-by: Loic Devulder <ldevulder@suse.com>
2022-09-08 15:26:40 +02:00
Itxaka 3d28c5d855
Configure custom smbios data (#157) 2022-09-02 14:15:22 +02:00
Klaus Kämpf f4ba471392
Add 'support' to 'make build' (#111)
Signed-off-by: Klaus Kämpf <kkaempf@suse.de>
2022-08-03 13:14:16 +02:00
Itxaka 10d362193a
Add a elemental-support binary (#109)
* Add a elemental-support binary

Allows to gather info about the running node, hostname, k8s resources,
systemd logs, etc..

Signed-off-by: Itxaka <igarcia@suse.com>

* lint

Signed-off-by: Itxaka <igarcia@suse.com>
2022-08-03 12:19:07 +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
Itxaka 09ab84500d
Add a target to setup a clean cluster (#79)
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>
2022-07-22 14:46:19 +00:00
Francesco Giudici e15e76e345 Fix "make unit-tests"
---
$make unit-tests
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest
go get github.com/onsi/gomega/...
ginkgo -r -v  --covermode=atomic --coverprofile=coverage.out -p -r ./pkg/...
Failed to compile config:

config_suite_test.go:22:2: missing go.sum entry for module providing package github.com/onsi/ginkgo/v2 (imported by github.com/rancher/elemental-operator/pkg/config); to add:
        go get -t github.com/rancher/elemental-operator/pkg/config
FAIL    github.com/rancher/elemental-operator/pkg/config [setup failed]
FAIL

no composite coverage computed: all suites included programatically focused specs

Ginkgo ran 3 suites in 661.375947ms

There were failures detected in the following suites:
  config ./pkg/config [Compilation failure]

Test Suite Failed
make: *** [Makefile:59: unit-tests] Error 1

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-07-21 09:37:39 +02: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 09f06ea0e0
Makefile: fix make build-docker (#41) 2022-07-14 09:37:45 +02:00
Itxaka 6804a051d7
Fix building the operator/installer with emulatedTPM (#39) 2022-07-13 16:57:23 +02:00
Itxaka 278b9b2c39
Return a Config.Config in MachineInventory (#35) 2022-07-13 16:28:48 +02:00
Itxaka caab84f5e2 Allow overriding namespace to watch and debug status for operator
Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka 004dd9991b set default repo for chart
Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka 26464f0e69 Rework tests workflow
Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka b7f4916cd9 Add -w to go build
Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka 74301fa37b Several fixes
Fix Dockerfile entrypoint
Fix some tests referring to old structs

Signed-off-by: Itxaka <igarcia@suse.com>
2022-07-11 15:12:19 +02:00
Itxaka 01c7190e70 Fix TAG used as part of the buildt
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
David Cassany 229245fb91
Add make target to test local changes in kind
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
Co-authored-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-04-04 16:56:06 +02:00
Itxaka d5288fcc17 Some kind improvements
- Allow setting different image versions for kubernetes
 - Set a matrix for kubernetes version on CI
 - Use kubectl wait to wait for control panel to be ready
 - Set default kubernetes version to latest rancher ready (v1.22.7)

Signed-off-by: Itxaka <igarcia@suse.com>
2022-03-30 12:33:39 +02:00
Ettore Di Giacinto 0832fc3823
Move helpers to standalone lib
- Also add nginx as ingress as is more compliant to kind
- Move out some common code pieces
- Address points from review

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-03-29 17:58:57 +02:00
Ettore Di Giacinto c6fb200f8c
Drop integration tests, add e2e tests with kind
Fixes: https://github.com/rancher-sandbox/rancheros-operator/issues/2
Fixes: https://github.com/rancher-sandbox/rancheros-operator/issues/6

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-03-28 18:29:06 +02:00
Itxaka 1445636695 Remove the v prefix from the chart versions
Its not semver 2

Signed-off-by: Itxaka <igarcia@suse.com>
2022-03-25 09:16:32 +01:00
Itxaka c60c1c6207 set the helm chart to a proper version
- also uses the--version and --appversion flags for helm
 - Sets the ROS_CHART properly

Signed-off-by: Itxaka <igarcia@suse.com>
2022-03-24 14:48:45 +01:00
Itxaka bcbe339e38 Use the same binary name across
There was a mix of ros-operator and rancheros-operator.

This patch fixes it so its always rancheros-operator, even
changing the repos to have the full name so everything matches

Signed-off-by: Itxaka <igarcia@suse.com>
2022-03-24 13:41:54 +01:00
Itxaka a5275b3629 Fix unit-tests so they run and get coverage
Signed-off-by: Itxaka <igarcia@suse.com>
2022-03-24 11:09:01 +01:00
Itxaka 26684d1888 Drop everything not needed for ros-operator
- Drops everything not needed for ros-operator
 - New simple Dockerfile
 - New jobs based on ros-operator only
 - Remove uneeded tests
 - Remove dependency on os2 images for integration tests
 - Use gorelease to release ros-operator binaries
 - Use docker to push ci images to ros-operator-ci registry on PR
 - Use docker to push master/tag images to ros-operator registry
 - Build chart indepently
 - Have a null test CI job for future integration tests

Signed-off-by: Itxaka <igarcia@suse.com>
2022-03-24 09:47:18 +01:00
Itxaka 649ad79a9d
Use ros-operator image for the ros-operator chart (#40) 2022-03-08 14:18:07 +01:00
Ettore Di Giacinto d99fca748a
Handle ENV var prefix rename, add tests for read config
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-01-31 16:53:16 +01:00
Ettore Di Giacinto 8240a456b3
ci: move test utils inside tests
Also add rancherd smoke test

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-01-28 13:37:58 +01:00
Ettore Di Giacinto 1067e8f345
ci: Add pipeline to build project on GHA
- Add test and static analysis workflows
- Add test/release workflow
- Add smoke integration tests
- Support specifying a docker registry.
- Scope release test runs to pkg
- Add DOCKER_REGISTRY to dapper env

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-01-28 13:37:52 +01:00
Darren Shepherd 3f899e0784 Build custom ipxe and use hostbin for ros-operator 2021-11-08 22:16:28 -07:00
Darren Shepherd 6a9bea4ebe Add initial docs framework 2021-10-20 16:01:11 -07:00
Darren Shepherd 4085b2977b Rename to rancher/os2 2021-10-20 12:19:44 -07:00
Darren Shepherd 0e46d19194 Add ipxe support 2021-10-13 16:01:08 -07:00
Darren Shepherd 53295b9228 Add arm64 2021-10-13 13:36:08 -07:00
Darren Shepherd 72291094c0 Push framework image and fix rancherd 2021-10-02 23:14:04 -07:00