store: move adding the local target to weldr

The automatic local target is only needed when accessing the API via
weldr.

In the store, the target was only added when `stateDir` was not `nil`.
This is only used for testing which doesn't exercise the branch in
weldr. Thus, the same check is not needed there.
This commit is contained in:
Lars Karlitski 2020-03-23 18:07:46 +01:00
parent 7594cb262e
commit 3544590036
3 changed files with 30 additions and 16 deletions

View file

@ -476,7 +476,15 @@ func TestCompose(t *testing.T) {
{
QueueStatus: common.IBWaiting,
ImageType: common.Qcow2Generic,
Targets: []*target.Target{},
Targets: []*target.Target{
{
// skip Uuid and Created fields - they are ignored
Name: "org.osbuild.local",
Options: &target.LocalTargetOptions{
Filename: "test.img",
},
},
},
},
},
}
@ -507,6 +515,13 @@ func TestCompose(t *testing.T) {
Key: "imagekey",
},
},
{
// skip Uuid and Created fields - they are ignored
Name: "org.osbuild.local",
Options: &target.LocalTargetOptions{
Filename: "test.img",
},
},
},
},
},