distro: delete distro.Manifest type

Delete the distro.Manifest type and its tests.
Change all occurrences of distro.Manifest to manifest.OSBuildManifest.
This commit is contained in:
Achilleas Koutsou 2023-04-27 16:33:01 +02:00 committed by Simon de Vlieger
parent 5498764725
commit c7aecdf31c
17 changed files with 58 additions and 162 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/target"
)
@ -23,7 +24,7 @@ func (ste *StateTransitionError) Error() string {
type ImageBuild struct {
ID int
ImageType distro.ImageType
Manifest distro.Manifest
Manifest manifest.OSBuildManifest
Targets []*target.Target
JobCreated time.Time
JobStarted time.Time

View file

@ -12,6 +12,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distroregistry"
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/target"
)
@ -41,15 +42,15 @@ type composesV0 map[uuid.UUID]composeV0
// ImageBuild represents a single image build inside a compose
type imageBuildV0 struct {
ID int `json:"id"`
ImageType string `json:"image_type"`
Manifest distro.Manifest `json:"manifest"`
Targets []*target.Target `json:"targets"`
JobCreated time.Time `json:"job_created"`
JobStarted time.Time `json:"job_started"`
JobFinished time.Time `json:"job_finished"`
Size uint64 `json:"size"`
JobID uuid.UUID `json:"jobid,omitempty"`
ID int `json:"id"`
ImageType string `json:"image_type"`
Manifest manifest.OSBuildManifest `json:"manifest"`
Targets []*target.Target `json:"targets"`
JobCreated time.Time `json:"job_created"`
JobStarted time.Time `json:"job_started"`
JobFinished time.Time `json:"job_finished"`
Size uint64 `json:"size"`
JobID uuid.UUID `json:"jobid,omitempty"`
// Kept for backwards compatibility. Image builds which were done
// before the move to the job queue use this to store whether they

View file

@ -19,6 +19,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/jsondb"
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/common"
@ -365,7 +366,7 @@ func (s *Store) GetAllComposes() map[uuid.UUID]Compose {
}
func (s *Store) PushCompose(composeID uuid.UUID,
manifest distro.Manifest,
manifest manifest.OSBuildManifest,
imageType distro.ImageType,
bp *blueprint.Blueprint,
size uint64,
@ -404,7 +405,7 @@ func (s *Store) PushCompose(composeID uuid.UUID,
// Set testSuccess to create a fake successful compose, otherwise it will create a failed compose
// It does not actually run a compose job
func (s *Store) PushTestCompose(composeID uuid.UUID,
manifest distro.Manifest,
manifest manifest.OSBuildManifest,
imageType distro.ImageType,
bp *blueprint.Blueprint,
size uint64,

View file

@ -11,6 +11,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distro/test_distro"
"github.com/osbuild/osbuild-composer/internal/manifest"
"github.com/osbuild/osbuild-composer/internal/osbuild"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/target"
@ -34,7 +35,7 @@ type storeTest struct {
myDistro *test_distro.TestDistro
myArch distro.Arch
myImageType distro.ImageType
myManifest distro.Manifest
myManifest manifest.OSBuildManifest
myRepoConfig []rpmmd.RepoConfig
myPackageSpec []rpmmd.PackageSpec
myImageOptions distro.ImageOptions