MCPcopy Index your code
hub / github.com/coder/coder / safeFriendlyName

Function safeFriendlyName

agent/agentcontainers/api.go:1112–1117  ·  view source on GitHub ↗

safeFriendlyName returns a API safe version of the container's friendly name. See provisioner/regexes.go for the regex used to validate the friendly name on the API side.

(name string)

Source from the content-addressed store, hash-verified

1110// See provisioner/regexes.go for the regex used to validate
1111// the friendly name on the API side.
1112func safeFriendlyName(name string) string {
1113 name = strings.ToLower(name)
1114 name = strings.ReplaceAll(name, "_", "-")
1115
1116 return name
1117}
1118
1119// expandedAgentName creates an agent name by including parent directories
1120// from the workspace folder path to avoid name collisions. Like `safeAgentName`,

Callers 3

safeAgentNameFunction · 0.85
expandedAgentNameFunction · 0.85
makeAgentNameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected