devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.19k stars 351 forks source link

imports does not import profiles #2134

Closed tobalsgithub closed 2 years ago

tobalsgithub commented 2 years ago

What happened?
I'm unsure if this is a bug or a feature request.

I tried to use the new imports feature in v6 to import a profile. I want to be able to standardize some profiles across many different applications, so importing them seemed like the best way to do this ( can't use expressions cause expressions don't work in the profiles section as I understand).

However, when doing this, the profile does not seem to be imported.

What did you expect to happen instead?
I don't see anyting in the documentation that suggests profiles will not be imported. So either I would expect the docs to make it clear what types of things can be imported and which can't, or I would expect profile imports to work the same way other sections work.

How can we reproduce the bug? (as minimally and precisely as possible)

Here's the devspace.yaml that I want the profile imported into. Note the imports statement towards the top:

version: v2beta1
name: email
imports:
  - path: ../../devspace/default-pipelines.yaml
deployments:
  email:
    kubectl:
      manifests:
        - ./redoxlocal/configmap.yaml
        - ./redoxlocal/manifest.yaml
dev:
  email:
    labelSelector:
      service: email
      service-target-name: email-app
      ksync: app
    command:
      - bash
      - -c
      - npm run debug
    args: []
    ports:
      - port: 9229:9229
    sync:
      - $(cat ../../devspace/default-terminal-sync.yaml)

And here's the file that has the "shared" profile and pipelines:

version: v2beta1
name: default-pipelines

imports:
- path: ./common.yaml

pipelines:
  dev:
    run: |-
      run_dependencies --all
      create_deployments --all
      start_dev --all
  deploy:
    run: |-
      run_dependencies --all
      create_deployments --all

profiles:
- name: logs
  patches:
    - op: replace
      path: dev.*.logs
      value:
        enabled: true
        lastLines: 200

When I run devspace dev -p logs I get the following:

fatal Couldn't find profile 'logs'

Local Environment: MacOS Monterey

Anything else we need to know?

/kind bug

FabianKramm commented 2 years ago

@tobalsgithub thanks for creating this issue! This is currently expected and currently a limitation of the imports functionality. We can think about adding profiles to the imports functionality, but as of now, this is not working.

tobalsgithub commented 2 years ago

Thanks @FabianKramm . Are there other limitations of the imports functionality? It would be great if the documentation made it clear what types of things can be imported vs what types of things cannot.

And for what it's worth, it would be great if imports worked for profiles. Right now, there's no good way that I know of to share profiles across a lot of different projects, because both imports and expressions cannot be used with profiles. So consider this a feature request 😄

FabianKramm commented 2 years ago

@tobalsgithub yes I see the problem and since its pretty simple to add, we added support for profiles and hooks in the latest devspace beta version.

EDIT: feel free to reopen if something is not working correctly there

tobalsgithub commented 2 years ago

Looks like it's working great! Y'all are fantastic, thanks.