Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmd/pod/createPod.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ var CreatePodCmd = &cobra.Command{
Short: "start a pod",
Long: "start a pod from runpod.io",
Run: func(cmd *cobra.Command, args []string) {
if templateId == "" && imageName == "" {
cobra.CheckErr(fmt.Errorf("--imageName is required when --templateId is not specified"))
}
input := &api.CreatePodInput{
ContainerDiskInGb: containerDiskInGb,
DeployCost: deployCost,
Expand Down Expand Up @@ -103,6 +106,5 @@ func init() {
CreatePodCmd.Flags().StringVar(&dataCenterId, "dataCenterId", "", "datacenter id to create in")
CreatePodCmd.Flags().BoolVar(&startSSH, "startSSH", false, "enable SSH login")

CreatePodCmd.MarkFlagRequired("gpuType") //nolint
CreatePodCmd.MarkFlagRequired("imageName") //nolint
CreatePodCmd.MarkFlagRequired("gpuType") //nolint
}
8 changes: 5 additions & 3 deletions cmd/pods/createPods.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ var CreatePodsCmd = &cobra.Command{
Short: "create a group of pods",
Long: "create a group of pods on runpod.io",
Run: func(cmd *cobra.Command, args []string) {
if templateId == "" && imageName == "" {
cobra.CheckErr(fmt.Errorf("--imageName is required when --templateId is not specified"))
}
gpus := strings.Split(gpuTypeId, ",")
gpusIndex := 0
input := &api.CreatePodInput{
Expand Down Expand Up @@ -106,7 +109,6 @@ func init() {
CreatePodsCmd.Flags().StringVar(&templateId, "templateId", "", "templateId to use with the pods")
CreatePodsCmd.Flags().StringVar(&volumeMountPath, "volumePath", "/runpod", "container volume path")

CreatePodsCmd.MarkFlagRequired("gpuType") //nolint
CreatePodsCmd.MarkFlagRequired("imageName") //nolint
CreatePodsCmd.MarkFlagRequired("name") //nolint
CreatePodsCmd.MarkFlagRequired("gpuType") //nolint
CreatePodsCmd.MarkFlagRequired("name") //nolint
}