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

sync: extend the devspace sync cli with ability to operate thought the config file #863

Closed
dsuievalov opened this issue Jan 13, 2020 · 1 comment
Assignees
Labels
area/sync Issues related to the real-time code synchronization kind/feature New feature or feature request

Comments

@dsuievalov
Copy link

Is your feature request related to a problem?
No

Which solution do you suggest?

If it is possible it would be nice if devspace sync cli will have the ability to operate with devspace.yaml in the same way as devspace dev. In that way, sync cli can be extended with the additional functionality which is available in a declaration of dev.sync (like #849) without making it more complicated (with addition cli arguments). The name of sync cli arguments can be the following: --config=<config-file.yaml>

When we have defined only one rule for sync in yaml (dev.sync[0]) devspace sync will pick up the sync config from yaml and apply it based on its own pod/container selection if it is defined, If not - interactively pick up the correct pod/container. An example:

devspace.yaml:

images:
  backend:
    image: john/devbackend
  backend-debugger:
    image: john/debugger
deployments:
- name: app-backend
  helm:
    componentChart: true
    values:
      containers:
      - name: container-0
        image: john/devbackend
      - name: container-1
        image: john/debugger
dev:
  sync:
  - labelSelector:
      app.kubernetes.io/name: devspace-app
      app.kubernetes.io/component: app-backend
      custom-label: custom-label-value
    containerName: container-0
    localSubPath: ./src
    containerPath: /app/src

The sync command:

# interactively pick the pod to sync
devspace sync --config=devspace.yaml
# pick up the correct pod by set labels/container name
devspace sync -l app.kubernetes.io/instance=myapp -c mycontainer --config=devspace.yaml

When we have defined multiple rules for sync in yaml (dev.sync[*]) devspace sync will pick up the sync config from yaml and run an interactive window to pick up the correct sync rule. An example:

devspace.yaml:

images:
  backend:
    image: john/devbackend
  frontend:
    image: john/devfrontend
  backend-debugger:
    image: john/debugger
deployments:
- name: app-backend
  helm:
    componentChart: true
    values:
      containers:
      - name: container-0
        image: john/devbackend
      - name: container-1
        image: john/debugger
- name: app-frontend
  helm:
    componentChart: true
    values:
      containers:
      - name: container-0
        image: john/devfrontend
dev:
  sync:
  - labelSelector:
      app.kubernetes.io/name: devspace-app
      app.kubernetes.io/component: app-backend
      custom-label: custom-label-value
    containerName: container-0
    localSubPath: ./backend/src
    containerPath: /app/src
  - labelSelector:
      app.kubernetes.io/name: devspace-app
      app.kubernetes.io/component: app-frontend
      custom-label: custom-label-value
    containerName: container-0
    localSubPath: ./frontend/src
    containerPath: /app/src

The sync command:

# interactively pick the sync config to apply and pod to sync
devspace sync --config=devspace.yaml
# interactively pick the sync config to apply but automatically pick the correct pod by set labels/container name
devspace sync -l app.kubernetes.io/instance=myapp -c mycontainer --config=devspace.yaml

Which alternative solutions exist?

Additional context

/kind feature

@FabianKramm FabianKramm added area/sync Issues related to the real-time code synchronization kind/feature New feature or feature request labels Jan 13, 2020
@FabianKramm FabianKramm self-assigned this Jan 13, 2020
FabianKramm added a commit that referenced this issue Jan 14, 2020
@FabianKramm
Copy link
Collaborator

Implemented with #868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync Issues related to the real-time code synchronization kind/feature New feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants