{"id":"10f11c57f94102cc","repo":"docker/cli","slug":"default-is-a-reserved-context-name","errorCode":null,"errorMessage":"\"default\" is a reserved context name","messagePattern":"\"default\" is a reserved context name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/context/store/store.go","lineNumber":221,"sourceCode":"\treturn s.tls.getData(contextName, endpointName, fileName)\n}\n\n// GetStorageInfo returns the paths where the Metadata and TLS data are stored\n// for the context.\nfunc (s *ContextStore) GetStorageInfo(contextName string) StorageInfo {\n\treturn StorageInfo{\n\t\tMetadataPath: s.meta.contextDir(contextdirOf(contextName)),\n\t\tTLSPath:      s.tls.contextDir(contextName),\n\t}\n}\n\n// ValidateContextName checks a context name is valid.\nfunc ValidateContextName(name string) error {\n\tif name == \"\" {\n\t\treturn errors.New(\"context name cannot be empty\")\n\t}\n\tif name == \"default\" {\n\t\treturn errors.New(`\"default\" is a reserved context name`)\n\t}\n\tif !isValidName(name) {\n\t\treturn fmt.Errorf(\"context name %q is invalid, names are validated against regexp %q\", name, validNameFormat)\n\t}\n\treturn nil\n}\n\n// validNameFormat is used as part of errors for invalid context-names.\n// We should consider making this less technical (\"must start with \"a-z\",\n// and only consist of alphanumeric characters and separators\").\nconst validNameFormat = `^[a-zA-Z0-9][a-zA-Z0-9_.+-]+$`\n\n// isValidName checks if the context-name is valid (\"^[a-zA-Z0-9][a-zA-Z0-9_.+-]+$\").\n//\n// Names must start with an alphanumeric character (a-zA-Z0-9), followed by\n// alphanumeric or separators (\"_\", \".\", \"+\", \"-\").\nfunc isValidName(s string) bool {\n\tif len(s) < 2 || !isAlphaNum(s[0]) {","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/context/store/store.go#L203-L239","documentation":"Error \"\"default\" is a reserved context name\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/context/store/store.go:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}