GoogleContainerTools/skaffold · error

invalid setter pattern for array node: %q

Error message

invalid setter pattern for array node: %q

What it means

Fires while applying array setters: a sequence node carries a setter pattern comment, but the pattern is not a simple single-setter reference (e.g. it's an interpolation like ${a}-${b}). Array nodes only support simple setter patterns such as ${environments}.

Source

Thrown at pkg/skaffold/render/applysetters/apply_setters.go:182

			// the setter comment will be on value node
			lineComment = node.Value.YNode().LineComment
		}

		setterPattern := extractSetterPattern(lineComment)
		if setterPattern == "" {
			// the node is not tagged with setter pattern
			return nil
		}

		if !shouldSet(setterPattern, as.Setters) {
			// this means there is no intent from user to modify this setter tagged resources
			return nil
		}

		// since this setter pattern is found on sequence node, make sure that it is
		// not interpolation of setters, it should be simple setter e.g. ${environments}
		if !validArraySetterPattern(setterPattern) {
			return errors.Errorf("invalid setter pattern for array node: %q", setterPattern)
		}

		// get the setter value for the setter name in the comment
		sv := setterValue(as.Setters, setterPattern)

		// add the key to the field path
		fieldPath := strings.TrimPrefix(fmt.Sprintf("%s.%s", path, node.Key.YNode().Value), ".")

		if sv == "" {
			node.Value.YNode().Content = []*yaml.Node{}
			// empty sequence must be FlowStyle e.g. env: [] # from-param: ${env}
			node.Value.YNode().Style = yaml.FlowStyle
			// setter pattern comment must be on value node
			node.Value.YNode().LineComment = lineComment
			node.Key.YNode().LineComment = ""
			as.Results = append(as.Results, &Result{
				FilePath:  as.filePath,
				FieldPath: fieldPath,

View on GitHub (pinned to a1189de023)

Solutions

  1. Use a simple single-setter pattern (e.g. ${environments}) on array/list nodes
  2. Move interpolations to scalar nodes, which support them
  3. Supply the array value as a comma-separated or JSON array via the setter input
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/skaffold/render/applysetters/apply_setters.go:182 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/cea701fea6b68b82. Report an issue: GitHub.