Skip to content

skaffold apply rejects deploy flags when dependency config creates implicit deployer #10071

@Z3po

Description

@Z3po

Description

When a skaffold config uses requires to import a dependency config that only provides a resourceSelector, skaffold apply rejects any deploy.kubectl.flags with:

creating runner: creating deployer: conflicting sets of kubectl deploy flags not supported in `skaffold apply` (flag: --server-side)

The dependency config has no deploy section — it only defines a resourceSelector. Skaffold creates an implicit (empty) deployer for it, and skaffold apply treats the parent's deploy flags and the dependency's implicit deployer as "conflicting sets."

skaffold dev and skaffold deploy work fine with the same configuration — only skaffold apply rejects it.

Reproduction

Dependency config (dependency.yaml):

apiVersion: skaffold/v4beta2
kind: Config
metadata:
  name: "MyResourceSelector"
resourceSelector:
  allow:
    - groupKind: "MyResource.example.com"
      image: [".*"]

Parent config (skaffold.yaml):

apiVersion: skaffold/v4beta12
kind: Config
requires:
  - configs: ["MyResourceSelector"]
    path: dependency.yaml
build:
  artifacts:
    - image: my-image
manifests:
  kustomize:
    paths:
      - ./k8s/
deploy:
  kubectl:
    flags:
      apply:
        - --server-side
$ skaffold apply --status-check=false --interactive=false \
    -f skaffold.yaml rendered-manifest.yaml
creating runner: creating deployer: conflicting sets of kubectl deploy flags \
    not supported in `skaffold apply` (flag: --server-side)

Moving deploy.kubectl.flags into a profile instead of the top-level config does not help — skaffold apply still rejects it.

Workaround

Inline the resourceSelector directly into the parent config and remove the requires section.

Expected behavior

skaffold apply should not treat an implicit (empty) deployer from a dependency config as a conflicting set of deploy flags. Dependency configs that only provide non-deploy settings like resourceSelector should not interfere with the parent's deploy configuration.

Environment

  • Skaffold version: v2.18.3, v2.19.0
  • OS: Linux
  • Kubernetes: v1.35.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions