Commit graph

6058 commits

Author SHA1 Message Date
Diaa Sami
13d642bb46 pkg/splunk_logger: handle potentially dangling goroutine 2023-11-10 17:35:25 +01:00
Diaa Sami
43f43c84f6 pkg: Add logger package from image-builder into pkg folder
rename and adapt it to be usable by composer
2023-11-10 17:35:25 +01:00
Gianluca Zuccarelli
fdf1364bb5 internal/blueprints: filesystem TOML tests
Move the filesystem customization tests into their own file.
Additionally add tests for unmarshalling filesystem customizations
from TOML, since we have added a new `minsize` tag to ensure
consistency with the json tag.

The new tests check the validation of the TOML input and ensures
that either one or both of the `minsize` and `size` inputs are
set. If both are set, the input is checked to ensure that both
match.
2023-11-09 15:47:07 +01:00
Gianluca Zuccarelli
4ddb2c300b internal/blueprints: fix mountpoint size keyword
Due to an oversight, the toml and json tags for the `MinSize`
field had different keywords. This commit fixes this by creating
a `minsize` toml tag and ensuring backwards compatability by
checking the old `size` tag.

If both `minsize` & `size` are set in the toml block, the
custom unmarshal function validates the input for inconsistencies.
2023-11-09 15:47:07 +01:00
Sanne Raymaekers
c749fb275e schutzbot/terraform: update rhel-9.2 aarch64 image 2023-11-09 12:05:11 +01:00
Sanne Raymaekers
cf10847d3e .github: update apt metadata before installing deps 2023-11-08 10:39:28 +01:00
Gianluca Zuccarelli
3fe36d0012 templates/packer: configure pulp creds on startup 2023-11-07 10:48:00 +01:00
Sanne Raymaekers
4ee00f7dab tools/provision: disable tracing before manipulating OCI secrets 2023-11-07 10:43:32 +01:00
Jakub Rusz
d68abf3bb5 Generate RHEL-94 and RHEL-810 manifests + update 2023-11-06 13:39:01 +04:00
Brian C. Lane
8e933f84f9 store: Fix test for CheckGPG
Forgot the #1 rule of map iteration. Don't depend on the order.
This uses a slice instead, which should be just as good for testing the
loop variable alias behavior.
2023-11-01 23:10:51 +01:00
Nicolás Muñoz
a693928b7a Added hyper_v_generation metadata to the instance used by CIV.
This will allow us to define which HyperV generation to use when
creating the image on the fly.
2023-11-01 11:40:55 +01:00
Brian C. Lane
b786178077 store: Fix SourceConfig.RepoConfig() function call
The SourceConfig pointer may be a loop variable that gets reused. This
results in unexpected behavior when the value pointed to is overwritten
by the loop calling this function.

Includes a test to make sure this is fixed.

So, DO NOT point to unsafe variables. Make a new pointer using
common.ToPtr where it is passed by value and returns a pointer to that
new value.

NOTE: This is NOT caught by golangci-lint. There may be other places
where this happens, but I have gone through the potential looking code
in osbuild-composer and images and not found any (other than a couple
places already noted with G601 tags as not a problem).
2023-11-01 11:38:41 +01:00
schutzbot
a65f17e73e Post release version bump
[skip ci]
2023-11-01 08:23:41 +00:00
Jakub Rusz
d71574976e rpmbuild: build rpms on RHEL-9.4 and RHEL-8.10 2023-10-31 16:44:22 +01:00
Tomáš Hozza
e1434746a2 Test: lint Packit configuration as part of CI
This will ensure that our Packit config stays valid.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-31 08:10:30 +01:00
Tomáš Hozza
b58a4b0009 Test: rename 'Lint' -> 'Golang Lint'
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-31 08:10:30 +01:00
Tomáš Hozza
5fcbce535c Packit: fix deprecated config option
`packit validate-config` reported:

```
common_package_config.py WARNING synced_files option is deprecated. Use files_to_sync option instead.
```

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-31 08:10:30 +01:00
Tomáš Hozza
fc7810e158 Packit: handle only tags without a 'dot'
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-31 08:10:30 +01:00
Achilleas Koutsou
61aea1a06f test/README: run go tests when updating images
Add a small paragraph with the instruction to run the go tests when
pulling in a new version of images as a guide for making sure that
osbuild-composer builds and runs successfully, before moving on to
integration tests.
2023-10-30 20:27:36 +01:00
Brian C. Lane
81240f58ba weldr: Add support for PartitioningMode 2023-10-23 14:52:30 +02:00
Brian C. Lane
2729f6ac54 blueprint: Add partitioning_mode customization 2023-10-23 14:52:30 +02:00
Brian C. Lane
d0877e68dc cloudapi: Add partitioning_mode support to the API
This adds a 'partitioning_mode' field that can be set to 'auto-lvm',
'lvm' or 'raw'. It defaults to 'auto-lvm'.
2023-10-23 14:52:30 +02:00
Tomáš Hozza
3df67e9adb Makefile: add unit-tests target
Add Makefile target to run all unit tests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
b41705adfb Delete unused internal/platform package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
e27cb2d397 Delete unused internal/environment package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
0d9a8df0f8 Delete unused internal/users package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
ec6cff5223 Delete unused internal/workload package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
4eb70326ee Delete unused internal/shell package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
3da602873d Delete unused internal/oscap package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
dfb55ebeb4 Delete unused internal/ignition package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
2b54f5bb14 Delete unused internal/fdo package
This is a leftover from the `osbuild/images` split`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
2cc55065b0 Delete unused function converting repository BP customization
These functions are leftover from the `osbuild/images` split and are not
used by any code in osbuild composer. Instead, the version in
`osbuild/images` is used by distro definitions.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
d4e3173234 Delete unused blueprint.ValidateDirFileCustomizations() function
This function is no longer used by any code. Instead, its copy in the
`osbuild/images` repository is used by distro definitions to validate
the customization.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Tomáš Hozza
d57f2e5bb5 Delete unused internal/pathpolicy package
This copy of the package in osbuild-composer is no longer used by any
code. Instead, the copy which is in the `osbuild/images` repository (and
module) is the implementation used by distro definitions.

Delete this code to reduce potential confusion and code duplication.

Also delete code in `internal/blueprint` package, which uses the
pathpolicy package. This code is no longer used, but instead the version
from `osbuild/images` is being used.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
yih
3d7b01b18d update pulp test case 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
5a337cd274 mockbuild: add a swapfile to el8 aarch64 builds
The pulp client is very large and defines a lot of symbols in on
package, which causes very large memory usage on el8 aarch64 (presumably
because of 64k page sizes).
Adding a 1 GiB swapfile fixes the issue in our CI runners.
2023-10-18 21:14:46 +02:00
yih
f4afef2890 update pulp test case 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
9a2f6fc33e cmd: update the final message in osbuild-upload-pulp-ostree
Since the UploadAndDistributeCommit() function now waits for all tasks
to finish, update the wording of the final message to indicate that the
commit is available.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
15dbb90eda upload/pulp: wait for tasks in UploadAndDistributeCommit
When uploading and distributing a commit, wait for any async tasks to
finish before returning.  There are two tasks that can block this
function:
- Creating a distribution: this only happens when a new repository is
  created.
- Import commit: this will always happen in this function.
2023-10-18 21:14:46 +02:00
yih
6a98136cc0 add pulp test case 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
cfddd448c3 osbuild-worker: add pulp configuration
Add support for pulp client configuration in the worker config.
Add test values to worker config test.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
fd0cae4366 cmd: add a osbuild-upload-pulp-ostree utility
Simple command line wrapper around the UploadAndDistributeCommit()
function.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
3b8e595351 weldr: define the pulp.ostree upload settings 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
4edeab80e3 osbuild-worker: add the pulp.ostree target to the worker 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
503fbfb312 target: add the pulp.ostree target to the marshal functions 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
ab659c013c upload/pulp: helper function to upload and distribute
Helper function that performs the whole upload and distribute procedure.
Two more helper functions are added for retrieving the href for a
repository based on its name, and for retrieving the base URL for a
repository's distribution.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
752040d10f target: add pulp ostree target and options 2023-10-18 21:14:46 +02:00
Achilleas Koutsou
22e4169649 upload/pulp: task state functions
Define the task state enum based on the available values defined in the
API.

Add a helper function that returns true if a task is running or waiting
and ignores errors.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
50367e6f14 upload/pulp: distribute ostree repo
Function for distributing an ostree repository, making it available for
consumption.
2023-10-18 21:14:46 +02:00
Achilleas Koutsou
57f1bb8bf4 upload/pulp: import commit into repository
Function for importing a commit artifact (that's already been uploaded)
into a given repository.  Note that the "repo" argument to the
NewOstreeImportAll() function refers to the name of the repository
directory inside the archive, which for the commits we produce in
osbuild is always "repo".
2023-10-18 21:14:46 +02:00