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

Shared images namespace for different devspace configs #1633

Closed
tbondarchuk opened this issue Sep 6, 2021 · 3 comments
Closed

Shared images namespace for different devspace configs #1633

tbondarchuk opened this issue Sep 6, 2021 · 3 comments
Labels
area/dev Issues related to devspace dev kind/bug Something isn't working

Comments

@tbondarchuk
Copy link
Contributor

What happened?
I have two different devspace.yaml files in different repos, but with the same image name:

images:
  app:
    image: repo/app-ONE

and

images:
  app:
    image: repo/app-TWO

When I try to run devspace in parallel, app one works properly but app two uses app-one's image for replacePods, terminal, etc. and vice versa, depending on which repo I've started devspace first. Everything works properly if I use different names, like app and app2, or if I use imageSelector: repo/app-TWO or labelSelector.

Not sure if it's a bug or a feature, but it looks like different devspace's instances (runs?) are using the same shared namespace for images. not sure where it's stored, haven't found nothing related in $HOME/.devspace and each repo's .devspace/generated.yaml has correct imageName value.

I have read that big red warning in docs that devspace shouldn't be run in parallel, but I was under impression that it's true only for the same repo - ports forwarding and sync conflicts. Can't see why you shouldn't use devspace simultaneously for different apps as long as different ports are use for forwarding.

So have I missed something in docs and it's indeed a feature, not bug? :) I guess shared namespace can be used to avoid conflicts while using dependencies or something, but might be worth to update docs with explicit mention of this?

If it's a bug, please let me know if any other info is needed.

For now I'll just avoid using image(app) and use full image name in selectors. And reason for using same image name: I want to have boilerplate devspace.yaml file for different apps with everything app-specific controlled by variables. Plus I don't want to maintaining unique image names globally - too much repos and using repo name as image name is just too long for my taste :)

What did you expect to happen instead?
each devspace using it's own image despite having same name in config.

How can we reproduce the bug?
example config (the only difference for second repo is image: repo/app-two)

version: v1beta10

images:
  api:
    image: repo/app-one
    build:
      disabled: true

dev:
  replacePods:
  - imageSelector: image(api)
    patches:
    - op: replace
      path: spec.containers[0].command
      value:
      - sleep
    - op: replace
      path: spec.containers[0].args
      value:
      - "999999"

  terminal:
    imageSelector: image(api)
    command:
    - /bin/sh
    - -c
    - hostname

then run devspace dev in one repo, wait for pod to be replaced and then run it in second repo. (skipped build and deployment configs for brevity)

Local Environment:

  • DevSpace Version: 5.15.0
  • Operating System: mac

/kind bug

@tbondarchuk
Copy link
Contributor Author

Just realized that for deployments image(app) seems to work properly:

deployments:
- name: app-one
  helm:
    chart:
      name: ./chart
    values:
      image:
        repository: image(api)
        tag: tag(api)

And I recall that during my tests imageSelector: image(app):tag(app) worked properly as well. will try to retest that tomorrow.

@FabianKramm
Copy link
Collaborator

FabianKramm commented Sep 7, 2021

@aliusmiles thanks for creating this issue! Yes you are correct, the problem is that currently we saved the image selector unresolved in the label, which is problematic if you are using the same selector in another devspace.yaml in the same namespace. We issued a fix for this in #1635 which saves the image selector resolved instead (image(app) -> repo/app-one) on the replaced pod which also should solve your issue

@FabianKramm FabianKramm added area/dev Issues related to devspace dev kind/bug Something isn't working labels Sep 7, 2021
@FabianKramm
Copy link
Collaborator

Should be fixed with v5.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev Issues related to devspace dev kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants