The filename of the image as produced by osbuild for a given export is currently set in each target options type in the `Filename` struct member. However, the value is not really specific to any target type, but to the specific export used for the target. For this reason move the value form target type options to the `Target` struct inside a new struct `OsbuildArtifact` under the name`ExportFilename`. The backward compatibility with older implementations of the composer and workers is kept on the JSON (Un)mashaling level, where the JSON object is always a super-set of the old and new way of providing the export filename in the Target.
22 lines
583 B
Go
22 lines
583 B
Go
package target
|
|
|
|
const TargetNameVMWare TargetName = "org.osbuild.vmware"
|
|
|
|
type VMWareTargetOptions struct {
|
|
Host string `json:"host"`
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
Datacenter string `json:"datacenter"`
|
|
Cluster string `json:"cluster"`
|
|
Datastore string `json:"datastore"`
|
|
}
|
|
|
|
func (VMWareTargetOptions) isTargetOptions() {}
|
|
|
|
func NewVMWareTarget(options *VMWareTargetOptions) *Target {
|
|
return newTarget(TargetNameVMWare, options)
|
|
}
|
|
|
|
func NewVMWareTargetResult() *TargetResult {
|
|
return newTargetResult(TargetNameVMWare, nil)
|
|
}
|