Skip to content

Commit

Permalink
Merge pull request #87 from metalsoft-io/MS-4583
Browse files Browse the repository at this point in the history
MS-4583 + MS-4924: fixes
  • Loading branch information
Galabov93 authored Apr 23, 2024
2 parents 454925d + fc01cb6 commit f2e61c6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/ostemplate/cmd_os_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var OsTemplatesCmds = []command.Command{
"image_build_required": c.FlagSet.Bool("image-build-required", false, colors.Green("(Flag)")+" If set will determine the image building process building an ISO. Needed for the OOB only install process."),
"provision_via_oob": c.FlagSet.Bool("provision-via-oob", false, colors.Green("(Flag)")+" If set will perform the installation process via the OOB. Always set this together with the image-build-required flag."),
"repo_url": c.FlagSet.String("repo-url", command.NilDefaultStr, "Template's location the repository"),
"os_ready_method": c.FlagSet.String("os-ready-method", command.NilDefaultStr, "Possible values: 'wait_for_ssh', 'wait_for_signal_from_os'. Default value: 'wait_for_ssh'."),
"os_ready_method": c.FlagSet.String("os-ready-method", command.NilDefaultStr, "Possible values: 'wait_for_ssh', 'wait_for_signal_from_os', 'wait_for_signal_from_os_and_wait_for_power_off', 'wait_for_power_off'. Default value: 'wait_for_ssh'."),
"os_asset_id_bootloader_local_install_id_or_name": c.FlagSet.String("install-bootloader-asset", command.NilDefaultStr, "Template's bootloader asset id during install"),
"os_asset_id_bootloader_os_boot_id_or_name": c.FlagSet.String("os-boot-bootloader-asset", command.NilDefaultStr, "Template's bootloader asset id during regular server boot"),
"version": c.FlagSet.String("version", command.NilDefaultStr, "Template version. Default value is 0.0.0"),
Expand Down Expand Up @@ -248,7 +248,7 @@ var OsTemplatesCmds = []command.Command{
"initial_password": c.FlagSet.String("initial-password", command.NilDefaultStr, colors.Red("(Required)")+" Template's initial password, used to verify install."),
"use_autogenerated_initial_password": c.FlagSet.Bool("use-autogenerated-initial-password", false, colors.Green("(Flag)")+" If set will automatically generate a password for the template and provide it during install via the initial_password and initial_user variables. Cannot be used with --initial-password, requires --initial-user params."),
"initial_ssh_port": c.FlagSet.Int("initial-ssh-port", command.NilDefaultInt, colors.Red("(Required)")+" Template's initial ssh port, used to verify install."),
"os_ready_method": c.FlagSet.String("os-ready-method", command.NilDefaultStr, "Possible values: 'wait_for_ssh', 'wait_for_signal_from_os', 'wait_for_signal_from_os_and_wait_for_power_off', 'wait_for_power_off'. Default value: 'wait_for_ssh'."),
"os_ready_method": c.FlagSet.String("os-ready-method", command.NilDefaultStr, "Possible values: 'wait_for_ssh', 'wait_for_signal_from_os'. Default value: 'wait_for_ssh'."),
"change_password_after_deploy": c.FlagSet.Bool("change-password-after-deploy", false, "Option to change the initial_user password on the installed OS after deploy."),
"image_build_required": c.FlagSet.Bool("image-build-required", false, colors.Green("(Flag)")+" If set will determine the image building process building an ISO. Needed for the OOB only install process."),
"provision_via_oob": c.FlagSet.Bool("provision-via-oob", false, colors.Green("(Flag)")+" If set will perform the installation process via the OOB. Always set this together with the image-build-required flag."),
Expand Down Expand Up @@ -1841,13 +1841,19 @@ func createIsoImageAsset(c *command.Command, repoTemplate RepoTemplate, assets *

assetURL := "https://" + imageRepositoryHostname + isoPath

templateType := assetTemplateTypeSimple
// Only change templateType if imagePath(source-iso) starts with http
if networking.CheckValidUrl(imagePath) {
templateType = assetTemplateTypeNone
}

createIsoCommand := createAssetCommand
createIsoCommand.FlagSet = flag.NewFlagSet("create ISO asset", flag.ExitOnError)
createIsoCommand.Arguments = map[string]interface{}{
"filename": createIsoCommand.FlagSet.String("filename", imageFilename, "Asset's filename"),
"usage": createIsoCommand.FlagSet.String("usage", "build_source_image", "Asset's usage."),
"mime": createIsoCommand.FlagSet.String("mime", assetMimeTypeBinary, "Asset's mime type. Possible values: \""+assetMimeTypeDynamic+"\", \""+assetMimeTypeBinary+"\""),
"template_type": createIsoCommand.FlagSet.String("template-type", assetTemplateTypeSimple, "Asset's template type. Possible values: \""+assetTemplateTypeNone+"\",\""+assetTemplateTypeSimple+"\", \""+assetTemplateTypeAdvanced+"\""),
"template_type": createIsoCommand.FlagSet.String("template-type", templateType, "Asset's template type. Possible values: \""+assetTemplateTypeNone+"\",\""+assetTemplateTypeSimple+"\", \""+assetTemplateTypeAdvanced+"\""),
"url": createIsoCommand.FlagSet.String("url", assetURL, "Asset's source url. If present it will not read content anymore"),
"read_content_from_pipe": createIsoCommand.FlagSet.Bool("pipe", false, "Read assets's content read from pipe instead of terminal input"),
"template_id_or_name": createIsoCommand.FlagSet.String("template-id", templateLabel, "Template's id or name to associate."),
Expand Down

0 comments on commit f2e61c6

Please sign in to comment.