Skip to content

Commit c5c7732

Browse files
committed
fix(job): address PR feedback on mount flag and options parsing
1 parent 29f9b5f commit c5c7732

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

cmd/job/submit.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ func init() {
137137
SubmitCmd.Flags().StringVarP(&dryRunManifest, "dry-run-out", "o", "", "Path to output the generated Kubernetes manifest instead of applying it.")
138138
SubmitCmd.Flags().StringVarP(&platform, "platform", "f", "linux/amd64", "Target platform for the image build (e.g., 'linux/amd64', 'linux/arm64'). Used with --base-image.")
139139

140-
SubmitCmd.Flags().StringSliceVar(&volumeStr, "mount", nil, "Volumes to mount (format: <src>;<dest>[;<mode>][;options=<options>], mode can be 'ro' or 'rw', default 'ro').")
141-
140+
SubmitCmd.Flags().StringArrayVar(&volumeStr, "mount", nil, "Volumes to mount (format: <src>;<dest>[;<mode>][;options=<options>], mode can be 'ro' or 'rw', default 'ro').")
142141
SubmitCmd.Flags().StringArrayVar(&envVars, "env", []string{}, "Custom environment variables to pass to the workload container in KEY=VALUE format. Can be specified multiple times.")
143142

144143
SubmitCmd.Flags().StringVarP(&workloadName, "name", "n", "", "Name of the workload to create. Required.")
@@ -259,9 +258,8 @@ func runSubmitCmd(cmd *cobra.Command, args []string) error {
259258
IsPathwaysJob: isPathwaysJob,
260259
Pathways: pathways,
261260
RawMounts: volumeStr,
262-
263-
Env: parseEnvFlags(envVars),
264-
Verbose: verbose,
261+
Env: parseEnvFlags(envVars),
262+
Verbose: verbose,
265263
}
266264

267265
return orc.SubmitJob(jobDef)

pkg/orchestrator/gke/storage.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ func (sm *StorageManager) ProcessMounts(mounts []string, job orchestrator.JobDef
7171
MountPath: dest,
7272
Type: volType,
7373
ReadOnly: readOnly,
74-
}
75-
if volType == "gcsfuse" {
76-
mountInfo.Options = options
74+
Options: options,
7775
}
7876
mountInfos = append(mountInfos, mountInfo)
7977
}

pkg/orchestrator/gke/storage_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ func TestParseSingleVolume(t *testing.T) {
188188
wantErr: true,
189189
wantErrSub: "options= is currently only supported for GCS",
190190
},
191+
{
192+
name: "valid gcsfuse with multiple comma-separated options",
193+
input: "gs://my-bucket;/data;options=logging:severity:info,enable-atomic-rename-object:true",
194+
wantSrc: "gs://my-bucket",
195+
wantDest: "/data",
196+
wantRO: true,
197+
wantOpts: "logging:severity:info,enable-atomic-rename-object:true",
198+
},
191199
}
192200

193201
for _, tc := range tests {

0 commit comments

Comments
 (0)