Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom functions in dependencies section #2759

Open
jackwilsdon opened this issue Nov 21, 2023 · 1 comment
Open

Support custom functions in dependencies section #2759

jackwilsdon opened this issue Nov 21, 2023 · 1 comment
Labels
kind/feature New feature or feature request

Comments

@jackwilsdon
Copy link
Contributor

Is your feature request related to a problem?
No

Which solution do you suggest?
Allow calling custom functions in the dependencies section of devspace.yaml.

Which alternative solutions exist?
None

Additional context
Expressions in the configuration appear to be resolved using ExecuteSimpleShellCommand here, which doesn't look to support custom functions (they appear to be passed in via the handler, but ‎ExecuteSimpleShellCommand uses the basic handler).

I'd like to use a function in the dependencies section to provide the ability to override a dependency with a local copy:

version: v2beta1
functions:
  get_dependency: |
    VAR_NAME=DEVSPACE_DEPENDENCY_${1^^}
    if [ -z "${!VAR_NAME}" ]; then
      echo "git: $2"
      if [ $# -gt 2 ]; then
        echo "subPath: $3"
      fi
    else
      if [ $# -gt 2 ]; then
        echo "path: ${!VAR_NAME}/$3"
      else
        echo "path: ${!VAR_NAME}"
      fi
    fi
dependencies:
  example: $(get_dependency example https://github.com/example)
@jackwilsdon jackwilsdon added the kind/feature New feature or feature request label Nov 21, 2023
@alexandradragodan
Copy link
Contributor

Hey, @jackwilsdon

Thanks for opening this issue!
We'll discuss this internally and decide how to prioritise it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants