Commit graph

5694 commits

Author SHA1 Message Date
Achilleas Koutsou
073f4f2025 cloudapi: remove redundant type from composite literal
Silence linter warning.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
3b1d48ec99 distro: remove packageSpecSets and containers from Manifest() args
The arguments aren't used in the function anymore.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
d5d7fb4b31 distro: pass containers to Serialize() in test
This has no effect since we don't use any containers in the test.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
bc584c7cbf weldr: resolve containers after Manifest()
Use the new workflow for generating the manifest before resolving
containers.

The resolver function is adjusted to handle a map of container slices,
but with all current use cases, the map should only ever have one key
for the payload (os) pipeline.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
b0d8fe2935 osbuild-pipeline: resolve containers after Manifest() 2023-05-31 16:40:07 +02:00
Achilleas Koutsou
620813123a gen-manifests: resolve containers after Manifest()
Demonstrate the new workflow for resolving containers.

1. First call Manifest().
2. Get container SourceSpecs from manifest struct.
3. Resolve them.
4. Serialize() with resolved container specs.

The changes in the test manifests are just the information about the
container sources (was a slice but is now a map) and the actual manifest
object isn't affected.

The TestDistro_Manifest test in distro_test_common is adapted
accordingly as well.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
267a27a1a8 manifest: container specs added during serialization
Add a second argument, map[string][]container.Spec, during
serialization, which serves the same purpose as the depsolved package
sets.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
b1f185959b manifest: use container SourceSpec instead of Spec
When creating a Manifest object, collect container SourceSpecs instead
of resolved Specs.

This is the same way we handle packages: The blueprint option is
converted to source specs and attached to the Manifest object during
creation.  Later, the SourceSpecs will be resolved to full container
Specs and used during serialization.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
955e343122 manifest: collect container and ostree source specs
Much like the GetPackageSetChains() manifest method, these two new
methods collect the container and ostree source specifications from the
pipelines that support them.  Currently, only one pipeline per manifest
contains references to containers or ostree commits, but we collect them
in a map, keyed by the pipeline name, both for consistency with the
package sets and for any potential future changes that may require
differentiating which pipeline a content source belongs to.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
fd7d1d45a8 distro/fedora: remove test for empty ostree ref
The ImageType.PackageSets() function is going away and instead we will
rely on the ImageType.Manifest() function to both prepare the manifest
and return the package sets.  The Manifest() function should never be
called without an ostree ref for ostree type images.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
b24a8cdcf5 distro: remove usage of ImageType.PackageSets() from tests
Use the new manifest generation procedure in the distro tests.

Use assert instead of require in TestImageTypePipelineNames to continue
running the rest of the subtests after a failure.

Some initialisations (image options and blueprint customizations) had to
be adjusted to work with the ImageType.Manifest() function.

Some helper functions in distro_test_common are no longer necessary and
have been removed.

The TestPipelineRepositories and TestImageTypePipelineNames tests must
be (partially) skipped for image types which specify a workload
(currently only azure-eap7-rhui), because they ignore payload
repositories.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
d0ba17cfe1 distro: move the checkOptions() call to the top of Manifest()
There's no need to do anything if the options fail to validate, so do
that first.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
65be6d65c2 manifest: fix repository collection in the os pipeline
In getPackageSetChain(), the workload repositories did not include the
ExtraBaseRepos.

In serialize(), when creating the rpm stage options (which collects
repository GPG keys), only the base repos were used, which is why we
previously had to merge repositories.  Instead of merging repositories
in the calling function in distro, we should keep them separated so that
we can easily distinguish which repositories are only meant for the
blueprint or workload when we need to.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
87233e12fb distro: attach payload repositories to workload package sets
The merging of payload repositories into the os pipeline had the
unwanted side effect of using the payload repos for the first depsolve
in the os chain when instead they should only be used for the second
(the depsolve for the blueprint or workload packages).  This wasn't an
issue before because we didn't do the merging in the PackageSets()
function, but now we rely on the Manifest() function for that
functionality instead.

Before the merging of the two functions, the PackageSets() function did
not merge repositories and the repository-to-package-set mapping was
maintained correctly, but the merging was needed in the Manifest()
function so that rpm stage options were generated for all repositories.
With this change, we are removing the merging so that the mapping is
maintained, and will fix the rpm stage option generation in the pipeline
generator.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
5ca4b4eb3f weldr: remove usage of ImageType.PackageSets()
Use the new manifest generation procedure in the Weldr API.

Updated test distro to include the same packages from the PackageSets()
method in the Manifest.Content.PackageSets.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
b495d9d476 cmd: remove usage of ImageType.PackageSets()
Use the new manifest generation procedure in the cmd line tools.  The
new procedure doesn't rely on ImageType.PackageSets() to compute the
packages for the depsolving.  Instead, it calls Manifest() and depsolves
the packages attached to the returned object
(manifest.Content.PackageSets).
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
d5c4a0c31f distro: copy PackageSets() functionality into Manifest()
Copy the functionality of the ImageType.PackageSets() methods into
ImageType.Manifest() for each distro.

The Manifest() method now collects all package sets and repositories
from the blueprint and image type and after generating the Manifest
instance, calls the GetPackageSetChains() method to attach the computed
package sets to the Manifest before returning it.

The package sets in the call are now renamed to staticPackageSets to
differentiate from the dynamic (computed) package sets that are affected
by the manifest generation.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
1a38939abf distro: pass entire Blueprint to Manifest()
Pass the entire Blueprint to Manifest() instead of just the
Customizations.  The goal is to combine the functionality of the
ImageType.PackageSets() and ImageType.Manifest() methods into one call.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
30c5093fb5 manifest: document Pipeline interface
Docstrings for the Manifest.pipelines field and the Pipeline type
itself.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
8b46ead31b manifest: attach unresolved Content to Manifest struct
Add Content to the Manifest struct to represent unresolved packages,
container, and ostree commit specs that the caller should resolve before
serialising the manifest.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
12e8ab3ac6 Make Manifest() return manifest.Manifest
Return manifest.Manifest from the Manifest() function without
serializing.  The caller then has to call the manifest.Serialize()
function using the depsolved packages.

This moves towards changing the order of actions required to generate a
manifest.  With this change, the manifest creation and depsolving can be
done independently, but this still requires instantiating the manifest
object twice (InstantiateManifest() is called in PackageSets() and
Manifest()), which we don't want to have to do.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
db431a565d ostree: move OSTreeImageOptions to the ostree package
Move the ostree image options to the ostree package and rename the type
to ImageOptions (ostree.ImageOptions).
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
ffa1e1df17 rhsm: move FactsImageOptions to the rhsm/facts package
Move the FactsImageOptions from distro to the new rhsm/facts package.
At the same time define the values we use as an enum, including the
"test-manifest" value.
Though the values don't really matter, the test value is defined first
so it takes the 0 value, which feels nicer conceptually.

The field in the distro.ImageOptions is changed to be a pointer to allow
for nil values.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
f1557fc4e4 pipeline: expand interface to return source specs
Add two new methods to the interface for returning container source
specifications and ostree commit source specifications respectively.
These are analogous to the package set chains; they are unresolved
source specifications that can be used with the appropriate resolver to
create a full specification for a manifest.

Only the Base pipeline implements the base empty functions for these for
now.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
0eeb7e47b0 ostree: rename ResolveParams to Resolve 2023-05-31 16:40:07 +02:00
Achilleas Koutsou
fc5461e9e3 ostree: rename RequestParams to SourceSpec
Same as with the container SourceSpec, the struct specifies the required
information to resolve an ostree commit from a source (URL, ref, and
optional parent).
Renaming for consistency.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
00d473c802 container: create a SourceSpec for the resolve parameters
Create a struct to conveniently hold the source parameters for a
container resolve request and use it in the Add() function of the
resolver.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
30dc8cb87a manifest: expand the manifest package doc
Expand the manifest package documentation and move it to the manifest.go
file.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
c7aecdf31c distro: delete distro.Manifest type
Delete the distro.Manifest type and its tests.
Change all occurrences of distro.Manifest to manifest.OSBuildManifest.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
5498764725 manifest: serialize to OSBuildManifest instead of distro.Manifest
Copy the Marshal and Unmarshal functions from distro.Manifest to
manifest.OSBuildManifest to keep the same behaviour.

The Version() function isn't used, so let's drop it.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
8f69088af1 distro: remove architecture names and use platform enum
Removing the dependence of the manifest package on the distro package to
import manifest into distro.
Wherever arch names are needed, we use the enums from the platform
package instead.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
0f925c445c subscription: new package for subscription options
Move the subscription options from distro to its own package.
Now we can import the manifest package into the distro package (instead
of the other way around) so we can work with the manifest.Manifest type
in distro.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
ea305d9c0f distro: simplify checkOptions() arguments
Make checkOptions() take the whole blueprint and options.  There is no
need to pass in the resolved containers separately since we only care
whether there are any containers defined for image types that don't
support them.
2023-05-31 16:40:07 +02:00
Achilleas Koutsou
e4e411a4c1 distro/rhel7: move imageType implementation to separate file 2023-05-31 16:40:07 +02:00
Achilleas Koutsou
31fd40f359 distro/fedora: move imageType implementation to separate file 2023-05-31 16:40:07 +02:00
Achilleas Koutsou
3d9dcff7f6 distro: inline initializeManifest
Inline the initializeManifest() function so we can start simplifying the
PackageSets() and Manifest() (the two callers) separately.
2023-05-31 16:40:07 +02:00
Gianluca Zuccarelli
744eb9d337 spec: depend on osbuild v85
osbuild v85 added the ability to save the `sslverify` field, this
commit sets the dependency to v85.

Added in https://github.com/osbuild/osbuild/pull/1298
2023-05-31 16:24:36 +02:00
Gianluca Zuccarelli
388e2572d7 internal/osbuild: add missing sslverify field
The blueprint customizations enabled the `sslverify`
field. However, this has not been implemented yet in
the yum repos stage.
2023-05-31 16:24:36 +02:00
Gianluca Zuccarelli
ce299dfa0e internal/rpmmd: change ignoressl to pointer
Change the `IgnoreSSL` field in `rpmmd.RepoConfig`
to a pointer. This will be later used to configure
the `SSLVerify` field in the yum repo stage.
2023-05-31 16:24:36 +02:00
schutzbot
173de3eba4 Post release version bump
[skip ci]
2023-05-31 08:22:34 +00:00
Jakub Rusz
686b01d0ba tests/vmware: fix cleanup trap and failure check
The cleanup trap was removed and therefore it never ran. Also changing
the check if the test is successful as before it was passing despite
failures being present.
2023-05-30 16:45:30 +02:00
Jakub Rusz
86d11d9b67 tests/vsphere: report only ipv4 address 2023-05-30 16:45:30 +02:00
Jakub Rusz
a5547a2fa0 vmware: fix typo in cleanup call 2023-05-30 16:45:30 +02:00
Jakub Rusz
4b6cb10c55 CI: update centos-stream-8 images and snapshots 2023-05-30 16:45:30 +02:00
dependabot[bot]
be6119ccfe build(deps): bump github.com/Azure/go-autorest/autorest/azure/auth
Bumps [github.com/Azure/go-autorest/autorest/azure/auth](https://github.com/Azure/go-autorest) from 0.5.11 to 0.5.12.
- [Release notes](https://github.com/Azure/go-autorest/releases)
- [Changelog](https://github.com/Azure/go-autorest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Azure/go-autorest/compare/autorest/azure/auth/v0.5.11...autorest/azure/auth/v0.5.12)

---
updated-dependencies:
- dependency-name: github.com/Azure/go-autorest/autorest/azure/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 17:36:58 +02:00
dependabot[bot]
92bd58bd76 build(deps): bump github.com/docker/distribution
Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](https://github.com/docker/distribution/compare/v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 11:04:27 +02:00
dependabot[bot]
d4a5b5c694 build(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 10:45:21 +02:00
Sanne Raymaekers
e27a866917 schutzbot/terraform: update
Adds a newer centos-stream-8 build.
2023-05-25 10:14:32 +02:00
Sanne Raymaekers
da2feadabf Schutzfile: bump osbuild to v85 2023-05-25 10:14:32 +02:00
Sanne Raymaekers
6335fb38cc test/cases/vmware.sh: add integration test for ova types 2023-05-25 10:14:32 +02:00