argoproj/argo-workflows · error

--cm-name is required when type is configmap

Error message

--cm-name is required when type is configmap

What it means

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.

Source

Thrown at cmd/argo/commands/sync/util.go:16

package sync

import (
	"fmt"
	"strings"

	syncpkg "github.com/argoproj/argo-workflows/v4/pkg/apiclient/sync"
)

func validateFlags(syncType, cmName string) error {
	if _, ok := syncpkg.SyncConfigType_value[syncType]; !ok {
		return fmt.Errorf("--type must be either 'database' or 'configmap'")
	}

	if syncType == syncpkg.SyncConfigType_CONFIGMAP.String() && cmName == "" {
		return fmt.Errorf("--cm-name is required when type is configmap")
	}

	return nil
}

func printSyncLimit(key, cmName, namespace string, limit int32, syncType syncpkg.SyncConfigType) {
	fmt.Printf("Key: %s\n", key)
	fmt.Printf("Type: %s\n", strings.ToLower(syncType.String()))
	if syncType == syncpkg.SyncConfigType_CONFIGMAP {
		fmt.Printf("ConfigMap Name: %s\n", cmName)
	}
	fmt.Printf("Namespace: %s\n", namespace)
	fmt.Printf("Limit: %d\n", limit)
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Add --cm-name <configmap> when using --type configmap
  2. Or switch to --type database, which needs no configmap
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/argo/commands/sync/util.go:16 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/20a6e85515103004. Report an issue: GitHub.