GoogleContainerTools/skaffold · error

custom tag not provided

Error message

custom tag not provided

What it means

The `custom` tagger uses a fixed, user-supplied tag string for image tagging instead of deriving one from git/env. If CustomTag.Tag is empty — meaning no tag was configured — GenerateTag returns "custom tag not provided" because it cannot produce a meaningful tag.

Source

Thrown at pkg/skaffold/tag/custom.go:34

package tag

import (
	"context"
	"errors"

	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/schema/latest"
)

type CustomTag struct {
	Tag string
}

// GenerateTag generates a tag using the custom tag.
func (t *CustomTag) GenerateTag(ctx context.Context, _ latest.Artifact) (string, error) {
	tag := t.Tag
	if tag == "" {
		return "", errors.New("custom tag not provided")
	}
	return tag, nil
}

View on GitHub (pinned to a1189de023)

Solutions

  1. Set the `tag:` field under `tag.custom` in skaffold.yaml (e.g. tag: v1.0.0).
  2. If the tag is dynamic, use a different tagger (envTemplate, gitCommit, sha256, dateTime).
  3. Verify any config-building code actually assigns CustomTag.Tag before GenerateTag is called.
  4. Check profile merges didn't blank out the custom tag value.

Example fix

# before
tag:
  custom: {}
# after
tag:
  custom:
    tag: v1.2.3
Defensive patterns

Strategy: validation

Validate before calling

const t = cfg.tag?.custom;
if (t && (!t.tag || !t.tag.trim())) throw new Error('tag.custom.tag must be a non-empty string');

Type guard

function hasCustomTag(t) {
  return typeof t?.tag === 'string' && t.tag.length > 0;
}

Prevention

When it happens

Trigger: Configuring `tag.custom: {}` with no `tag:` value; constructing latest.CustomTag{Tag: ""} programmatically; a templated tag config that evaluates to empty string.

Common situations: Copy-pasted tagger config from docs with the tag value omitted; profiles overriding the tagger and dropping the tag field; env-template tags where the env var is unset resulting in empty expansion (though template errors usually surface separately).

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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