osbuild2: make inputs generic for copy stage ctor
Add a level of indirection for the copy stage constructor function in order to be able to use it with existing input types, like the files input. Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net> Co-Developed-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
parent
2a98885953
commit
d27596b24a
1 changed files with 12 additions and 2 deletions
|
|
@ -25,13 +25,23 @@ func (CopyStageInputs) isStageInputs() {}
|
|||
|
||||
type CopyStageReferences []string
|
||||
|
||||
type CopyStageInputsNew interface {
|
||||
isCopyStageInputs()
|
||||
}
|
||||
|
||||
func (CopyStageInputs) isCopyStageInputs() {}
|
||||
|
||||
func (CopyStageReferences) isReferences() {}
|
||||
|
||||
func NewCopyStage(options *CopyStageOptions, inputs *CopyStageInputs, devices *Devices, mounts *Mounts) *Stage {
|
||||
func NewCopyStage(options *CopyStageOptions, inputs CopyStageInputsNew, devices *Devices, mounts *Mounts) *Stage {
|
||||
var stageInputs Inputs
|
||||
if inputs != nil {
|
||||
stageInputs = inputs.(Inputs)
|
||||
}
|
||||
return &Stage{
|
||||
Type: "org.osbuild.copy",
|
||||
Options: options,
|
||||
Inputs: inputs,
|
||||
Inputs: stageInputs,
|
||||
Devices: *devices,
|
||||
Mounts: *mounts,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue