{"record":{"id":"6f585c28d1efe626","repo":"argoproj/argo-workflows","slug":"configmap-s-needs-to-have-the-label-s-s-to-l","errorCode":null,"errorMessage":"ConfigMap '%s' needs to have the label %s: %s to load parameters","messagePattern":"ConfigMap '(.+?)' needs to have the label (.+?): (.+?) to load parameters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/common/configmap.go","lineNumber":27,"sourceCode":")\n\ntype ConfigMapStore interface {\n\tGetByKey(key string) (any, bool, error)\n}\n\n// GetConfigMapValue retrieves a configmap value\nfunc GetConfigMapValue(configMapStore ConfigMapStore, namespace, name, key string) (string, error) {\n\tobj, exists, err := configMapStore.GetByKey(namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif exists {\n\t\tcm, ok := obj.(*apiv1.ConfigMap)\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"unable to convert object %s to configmap when syncing ConfigMaps\", name)\n\t\t}\n\t\tif cmType := cm.Labels[LabelKeyConfigMapType]; cmType != LabelValueTypeConfigMapParameter {\n\t\t\treturn \"\", fmt.Errorf(\n\t\t\t\t\"ConfigMap '%s' needs to have the label %s: %s to load parameters\",\n\t\t\t\tname, LabelKeyConfigMapType, LabelValueTypeConfigMapParameter)\n\t\t}\n\t\tcmValue, ok := cm.Data[key]\n\t\tif !ok {\n\t\t\treturn \"\", errors.Errorf(errors.CodeNotFound, \"ConfigMap '%s' does not have the key '%s'\", name, key)\n\t\t}\n\t\treturn cmValue, nil\n\t}\n\treturn \"\", errors.Errorf(errors.CodeNotFound, \"ConfigMap '%s' does not exist. Please make sure it has the label %s: %s to be detectable by the controller\",\n\t\tname, LabelKeyConfigMapType, LabelValueTypeConfigMapParameter)\n}\n","sourceCodeStart":9,"sourceCodeEnd":40,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/common/configmap.go#L9-L40","documentation":"GetConfigMapValue loads a value from a ConfigMap used as an Argo parameter source. The controller requires such ConfigMaps to carry the label `workflows.argoproj.io/configmap-type: Parameter` so it only ever treats explicitly-marked ConfigMaps as parameter stores. If the ConfigMap exists but lacks (or mismatches) that label, this error is returned instead of reading its data.","triggerScenarios":"Calling GetConfigMapValue (directly or via substituteAndGetConfigMapValue / setGlobalParameters, e.g. workflow-level global parameters from `spec.arguments` referencing a configMapKeyRef, or cron workflow `globalParameters`) against a ConfigMap whose `metadata.labels` omit `workflows.argoproj.io/configmap-type: Parameter`.","commonSituations":"Ops teams create the ConfigMap with kubectl but forget the required label; a Helm chart generates the ConfigMap without extraLabels; the label is typo'd (wrong key or value like `Parameters` vs `Parameter`); upgrading Argo where the label requirement was added to an existing ConfigMap.","solutions":["Add the label to the ConfigMap: `kubectl label configmap <name> workflows.argoproj.io/configmap-type=Parameter -n <namespace>`","If the ConfigMap is managed by Helm/Kustomize, add the label to the manifest under metadata.labels so it persists across upgrades","Verify the label key/value match exactly: `workflows.argoproj.io/configmap-type: Parameter` (capital P, no plural)","Confirm the controller is reading the ConfigMap from the workflow's namespace"],"exampleFix":"# before\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: my-params\ndata:\n  key: value\n# after\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: my-params\n  labels:\n    workflows.argoproj.io/configmap-type: Parameter\ndata:\n  key: value","handlingStrategy":"validation","validationCode":"cm, err := clientset.CoreV1().ConfigMaps(ns).Get(ctx, name, metav1.GetOptions{})\nif err != nil { return err }\nif cm.Labels[\"workflows.argoproj.io/configmap-type\"] != \"Parameter\" {\n    return fmt.Errorf(\"configmap %s must be labeled workflows.argoproj.io/configmap-type=Parameter\", name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always label parameter ConfigMaps with workflows.argoproj.io/configmap-type: Parameter in manifests/Helm charts","Run `argo lint` and a pre-submit script that verifies ConfigMap labels","Encode the label in a Kustomize commonLabels or Helm template helper"],"tags":["kubernetes","configmap","validation","argo-workflows"],"backgroundTag":"missing-required-label","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"}