Skip to content

Commit 1f2c8d5

Browse files
authored
Fix protocol scheme workload name validation issue (#1457)
1 parent 86edb93 commit 1f2c8d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/thv/app/run.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,16 @@ func runForeground(ctx context.Context, workloadManager workloads.Manager, runne
210210
func validateGroup(ctx context.Context, workloadsManager workloads.Manager, serverOrImage string) error {
211211
workloadName := runFlags.Name
212212
if workloadName == "" {
213+
// For protocol schemes without an explicit name, skip group validation.
214+
// Protocol schemes (like npx://@scope/package) contain characters that are invalid
215+
// for filesystem operations. The actual workload name will be generated during
216+
// the build process (in BuildRunnerConfig) where it gets properly sanitized.
217+
// Since the workload doesn't exist yet with the protocol URL as its name,
218+
// and we can't check for conflicts without the final sanitized name,
219+
// we defer group validation to when the workload is actually created.
220+
if runner.IsImageProtocolScheme(serverOrImage) {
221+
return nil
222+
}
213223
workloadName = serverOrImage
214224
}
215225

0 commit comments

Comments
 (0)