add platform parameter for container import

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2024-09-05 11:34:36 +02:00
committed by Jonathon Anderson
parent fd821495ce
commit dbdd85fe2b
6 changed files with 325 additions and 303 deletions

View File

@@ -25,6 +25,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
OciNoHttps: OciNoHttps,
OciUsername: OciUsername,
OciPassword: OciPassword,
Platform: Platform,
}
_, err = apicontainer.ContainerImport(cip)

View File

@@ -37,6 +37,7 @@ Imported containers are used to create bootable VNFS images.`,
OciNoHttps bool
OciUsername string
OciPassword string
Platform string
)
func init() {
@@ -50,6 +51,9 @@ func init() {
baseCmd.PersistentFlags().StringVar(&OciPassword, "password", "", "Set password for the access to the registry, superseedes env WAREWULF_OCI_PASSWORD")
baseCmd.PersistentFlags().StringVar(&OciPassword, "passwd", "", "Set password for the access to the registry, superseedes env WAREWULF_OCI_PASSWORD")
_ = baseCmd.PersistentFlags().MarkHidden("passwd")
baseCmd.PersistentFlags().StringVar(&Platform, "platform", "", "Set other hardware platform e.g. amd64 or arm64, superseedes env WAREWULF_OCI_PLATFORM")
baseCmd.PersistentFlags().StringVar(&Platform, "arch", "", "Set other hardware platform, superseedes env WAREWULF_OCI_PLATFORM")
_ = baseCmd.PersistentFlags().MarkHidden("arch")
}
// GetRootCommand returns the root cobra.Command for the application.