ibcli: introduce/use manifestOptions struct
This commit adds a new manifestOptions struct that is passed to generateManifest. to cleanup the signature of generateManifest(). This can then also be used to carry a new e.g. `--rpmmd/--cachedir` option.
This commit is contained in:
parent
f8ffa8a258
commit
44f27108b9
2 changed files with 21 additions and 10 deletions
|
|
@ -110,18 +110,23 @@ func cmdManifestWrapper(cmd *cobra.Command, args []string, w io.Writer, archChec
|
|||
return nil, err
|
||||
}
|
||||
|
||||
res, err := getOneImage(dataDir, distroStr, imgTypeStr, archStr)
|
||||
img, err := getOneImage(dataDir, distroStr, imgTypeStr, archStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if archChecker != nil {
|
||||
if err := archChecker(res.Arch.Name()); err != nil {
|
||||
if err := archChecker(img.Arch.Name()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
err = generateManifest(dataDir, blueprintPath, res, w, ostreeImgOpts, rpmDownloader)
|
||||
return res, err
|
||||
opts := &manifestOptions{
|
||||
BlueprintPath: blueprintPath,
|
||||
Ostree: ostreeImgOpts,
|
||||
RpmDownloader: rpmDownloader,
|
||||
}
|
||||
err = generateManifest(dataDir, img, w, opts)
|
||||
return img, err
|
||||
}
|
||||
|
||||
func cmdManifest(cmd *cobra.Command, args []string) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue