Skip to content

Commit 9a2bbb3

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

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

cmd/job/submit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +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').")
140+
SubmitCmd.Flags().StringArrayVar(&volumeStr, "mount", nil, "Volumes to mount (format: <src>;<dest>[;<mode>][;options=<options>], mode can be 'ro' or 'rw', default 'ro').")
141141

142142
SubmitCmd.Flags().StringArrayVar(&envVars, "env", []string{}, "Custom environment variables to pass to the workload container in KEY=VALUE format. Can be specified multiple times.")
143143

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)