skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Override placeholder in a required configuration

Open salvabot0001 opened this issue 1 year ago • 1 comments

Expected behavior

This is more a feature request than an issue. Background: We have a lot of microservices where we use skaffold and the configuration is mostly the same. It would be nice (like patches) to override some fields of configurations imported from other storage (local, remote etc.)

Actual behavior

  1. Somewhere on a different git repo, there is a config file: recipes/gradle_jib.yaml
apiVersion: skaffold/v4beta8
kind: Config
metadata:
   name: cfg
build:
  local:
    useDockerCLI: true
    useBuildkit: true
    push: false
  tagPolicy:
    gitCommit: {}
  artifacts:
    - image: placeholder
      jib:
        type: gradle
profiles:
  - name: build
    build:
      local:
        push: false
  1. Project configuration
apiVersion: skaffold/v4beta8
kind: Config
metadata:
  name: project
requires:
  - configs: [cfg]
    git:
      repo: ssh://git@repo_url
      path: recipes/gradle_jib.yaml
      ref: main
    activeProfiles:
      - name: build
profiles:
  - name: build
     patches:
       - op: replace
          path: /build/artifacts/0/image
          value: project_name

This is throwing an error because the patch is applied on the build profile of the project configuration and not on the cfg configuration.

Is there maybe some way to customize the configuration imported or is this feature planned for future releases?

Information

  • Skaffold version: 2.9.0
  • Operating system: Mac/Linux
  • Installed via: Homebrew
  • Contents of skaffold.yaml: see above

salvabot0001 avatar Dec 22 '23 16:12 salvabot0001

similar to #8600

ericzzzzzzz avatar Jan 02 '24 14:01 ericzzzzzzz