GoogleContainerTools/skaffold · error

`apply` requires at least one manifest argument

Error message

`apply` requires at least one manifest argument

What it means

Skaffold's `apply` command requires at least one positional argument: the path to a manifest (e.g. skaffold.yaml or a k8s manifest) to apply. The Args validator on the cobra command returns this error before doApply runs when no arguments are passed. It exists to fail fast with a clear message instead of failing later inside the apply pipeline.

Source

Thrown at cmd/skaffold/app/cmd/apply.go:51

// NewCmdApply describes the CLI command to apply manifests to a cluster.
func NewCmdApply() *cobra.Command {
	return NewCmd("apply").
		WithDescription("Apply hydrated manifests to a cluster").
		WithExample("Hydrate Kubernetes pod manifest first", "render --output rendered-pod.yaml").
		WithExample("Then create resources on your cluster from that hydrated manifest", "apply rendered-pod.yaml").
		WithCommonFlags().
		WithFlags([]*Flag{
			{Value: &opts.InventoryNamespace, Name: "inventory-namespace", Hidden: true, DefValue: "",
				Usage: "The namespace for the ResourceGroup resource that contains the inventory"},
			{Value: &opts.InventoryID, Name: "inventory-id", Hidden: true, DefValue: "",
				Usage: "The inventory name, default to `.kpt-pipeline`"},
			{Value: &opts.InventoryName, Name: "inventory-name", Hidden: true, DefValue: "",
				Usage: "Inventory identifier."},
		}).
		WithHouseKeepingMessages().
		WithArgs(func(cmd *cobra.Command, args []string) error {
			if len(args) < 1 {
				return errors.New("`apply` requires at least one manifest argument")
			}
			return nil
		}, doApply)
}

func doApply(ctx context.Context, out io.Writer, args []string) error {
	// force set apply boolean to select default options in runner creation
	opts.Apply = true
	opts.HydratedManifests = args
	if err := validateManifests(args); err != nil {
		return err
	}
	return withRunner(ctx, out, func(r runner.Runner, configs []util.VersionedConfig) error {
		return r.Apply(ctx, out)
	})
}

func validateManifests(manifests []string) error {

View on GitHub (pinned to a1189de023)

Solutions

  1. Pass at least one manifest argument: `skaffold apply skaffold.yaml`
  2. If the argument comes from a variable, guard it: `skaffold apply "${MANIFEST:?manifest path required}"`
  3. Use `--filename`/`-f` flag if you intended to point at a config rather than pass a positional manifest

Example fix

// before
skaffold apply
// after
skaffold apply skaffold.yaml
Defensive patterns

Strategy: validation

Validate before calling

const args = process.argv.slice(2); // shell-side guard
if [ -z "$1" ]; then echo "usage: skaffold apply <manifest>"; exit 1; fi

Prevention

When it happens

Trigger: Running `skaffold apply` with zero positional arguments. Any invocation where cmd args is empty, e.g. just `skaffold apply` or `skaffold apply --profile=prod` with no manifest path.

Common situations: Users coming from `skaffold dev` habits where no manifest argument was needed; CI scripts that lost their argument due to an unset variable (`skaffold apply $MANIFEST` with MANIFEST empty).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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