MCPcopy Index your code
hub / github.com/docker/cli / validateStackName

Function validateStackName

cli/command/stack/common.go:17–23  ·  view source on GitHub ↗

validateStackName checks if the provided string is a valid stack name (namespace). It currently only does a rudimentary check if the string is empty, or consists of only whitespace and quoting characters.

(namespace string)

Source from the content-addressed store, hash-verified

15// It currently only does a rudimentary check if the string is empty, or consists
16// of only whitespace and quoting characters.
17func validateStackName(namespace string) error {
18 v := strings.TrimFunc(namespace, quotesOrWhitespace)
19 if v == "" {
20 return fmt.Errorf("invalid stack name: %q", namespace)
21 }
22 return nil
23}
24
25func validateStackNames(namespaces []string) error {
26 for _, ns := range namespaces {

Callers 4

validateStackNamesFunction · 0.85
newPsCommandFunction · 0.85
newServicesCommandFunction · 0.85
newDeployCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…