Skip to content

Commit fdca9d9

Browse files
authored
Merge pull request #83 from mkumatag/fix_import
Fix the import regression issues
2 parents 57c47c5 + c3e3e58 commit fdca9d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/image/import/import.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pvsadm image import -n upstream-core-lon04 -b <BUCKETNAME> --pvs-storagetype <ST
4545
# If user wants to specify the type of OS
4646
pvsadm image import -n upstream-core-lon04 -b <BUCKETNAME> --object rhel-83-10032020.ova.gz --pvs-image-name test-image --ostype <OSTYPE> -r <REGION>
4747
`,
48-
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
48+
PreRunE: func(cmd *cobra.Command, args []string) error {
4949
if pkg.ImageCMDOptions.InstanceID == "" && pkg.ImageCMDOptions.InstanceName == "" {
5050
return fmt.Errorf("--pvs-instance-name or --pvs-instance-id required")
5151
}
@@ -232,8 +232,10 @@ func init() {
232232
Cmd.Flags().StringVar(&pkg.ImageCMDOptions.SecretKey, "secretkey", "", "Cloud Object Storage HMAC secret key.")
233233
Cmd.Flags().StringVar(&pkg.ImageCMDOptions.ImageName, "pvs-image-name", "", "Name to PowerVS imported image.")
234234
Cmd.Flags().StringVar(&pkg.ImageCMDOptions.OsType, "ostype", "redhat", "Image OS Type, accepted values are[aix, ibmi, redhat, sles].")
235+
Cmd.Flags().BoolVarP(&pkg.ImageCMDOptions.Watch, "watch", "w", false, "After image import watch for image to be published and ready to use")
236+
Cmd.Flags().DurationVar(&pkg.ImageCMDOptions.WatchTimeout, "watch-timeout", 1*time.Hour, "watch timeout")
235237
Cmd.Flags().StringVar(&pkg.ImageCMDOptions.StorageType, "pvs-storagetype", "tier3", "PowerVS Storage type, accepted values are [tier1, tier3].")
236-
Cmd.Flags().StringVar(&pkg.ImageCMDOptions.ServiceCredName, "pvs-service-cred", "pvsadm-service-cred", "Service Credential name to be auto generated.")
238+
Cmd.Flags().StringVar(&pkg.ImageCMDOptions.ServiceCredName, "cos-service-cred", "", "IBM COS Service Credential name to be auto generated(default \""+serviceCredPrefix+"-<USERID>\")")
237239

238240
_ = Cmd.MarkFlagRequired("bucket")
239241
_ = Cmd.MarkFlagRequired("bucket-region")

0 commit comments

Comments
 (0)