{"record":{"id":"20a6e85515103004","repo":"argoproj/argo-workflows","slug":"cm-name-is-required-when-type-is-configmap","errorCode":null,"errorMessage":"--cm-name is required when type is configmap","messagePattern":"--cm-name is required when type is configmap","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/sync/util.go","lineNumber":16,"sourceCode":"package sync\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\tsyncpkg \"github.com/argoproj/argo-workflows/v4/pkg/apiclient/sync\"\n)\n\nfunc validateFlags(syncType, cmName string) error {\n\tif _, ok := syncpkg.SyncConfigType_value[syncType]; !ok {\n\t\treturn fmt.Errorf(\"--type must be either 'database' or 'configmap'\")\n\t}\n\n\tif syncType == syncpkg.SyncConfigType_CONFIGMAP.String() && cmName == \"\" {\n\t\treturn fmt.Errorf(\"--cm-name is required when type is configmap\")\n\t}\n\n\treturn nil\n}\n\nfunc printSyncLimit(key, cmName, namespace string, limit int32, syncType syncpkg.SyncConfigType) {\n\tfmt.Printf(\"Key: %s\\n\", key)\n\tfmt.Printf(\"Type: %s\\n\", strings.ToLower(syncType.String()))\n\tif syncType == syncpkg.SyncConfigType_CONFIGMAP {\n\t\tfmt.Printf(\"ConfigMap Name: %s\\n\", cmName)\n\t}\n\tfmt.Printf(\"Namespace: %s\\n\", namespace)\n\tfmt.Printf(\"Limit: %d\\n\", limit)\n}\n","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/sync/util.go#L1-L31","documentation":"validateFlags requires --cm-name when --type is 'configmap', because a configmap-backed sync limit must name the configmap that will hold it. This validation guard fires when a user selects type configmap on sync limit commands but omits the configmap name.","triggerScenarios":"Thrown at cmd/argo/commands/sync/util.go:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add --cm-name <configmap> when using --type configmap","Or switch to --type database, which needs no configmap"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}