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

Okteto destroy doesn't work as expected in VS Code plugin #213

Closed
rachitchauhan43 opened this issue Nov 15, 2022 · 0 comments · Fixed by #215
Closed

Okteto destroy doesn't work as expected in VS Code plugin #213

rachitchauhan43 opened this issue Nov 15, 2022 · 0 comments · Fixed by #215

Comments

@rachitchauhan43
Copy link

rachitchauhan43 commented Nov 15, 2022

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

Scenario 1:

  1. Do okteto up using VS code plugin (use VS code command palette to run plugin related commands)
  2. It will run deploy and dev sections and will bring env up successfully
  3. Now run okteto destroy using VS Code plugin only

Expectation:

  1. VS Code should ask to choose okteto manifest for destroy just like it asks for up and down commands
  2. And then destroy should take care of deleting all the resources -- created under deploy section as well as deployment created as part of creating okteto env

Actual:

  1. VS code doesn't ask to choose the manifest (see First Image )and destroys an env by the name of okteto everytime (see Second image) and now i have to run okteto destroy -f $MANIFEST_FILE using okteto binary (see Third image).

First Image:

Screen Shot 2022-11-15 at 10 58 21 AM

Second image:

Screen Shot 2022-11-15 at 10 58 38 AM

Third image:

See how, only after running destroy command using okteto's binary, a service named test-wq-spark-rac-1 gets deleted.

Screen Shot 2022-11-15 at 11 02 14 AM

okteto.yaml used:

deploy:
  - name: Deploy svc
    command: kubectl apply -f service.yaml

dev:
  api:
    image: docker.mycompany.com/myrepo/datamechanics/spark:3.2.0-hadoop-3.3.1-java-11-scala-2.12-python-3.8-dm16
    workdir: /tmp
    namespace: intlgntsys-mlplatform-winequality-usw2-e2e
    autocreate: true
    initContainer:
      image: docker.mycompany.com/myrepo/okteto/bin:1.3.4
    command:
      - bash
    securityContext:
      capabilities:
        add:
        - SYS_PTRACE # required by C++ and go debuggers
    forward:
      - 8080:8080

Scenario 2:

  1. Do okteto up using VS code plugin.
  2. It will run deploy section and will bring env up successfully
  3. Now run okteto destroy -f OKTETO_FILE_LOCATION on command line using okteto's binary since running destroy via VS Code plugin doesn't work as mentioned in Scenario 1.

Expectation:
Everything should go away — resources mentioned in deploy section as well as any deployment/rs/pod.

Actual:
Only resources created under deploy section go away. Still had to run okteto down using VS code plugin to tear down deployment.

okteto.yaml used:

deploy:
  - name: Deploy svc
    command: kubectl apply -f service.yaml

dev:
  api:
    image: docker.mycompany.com/myrepo/datamechanics/spark:3.2.0-hadoop-3.3.1-java-11-scala-2.12-python-3.8-dm16
    workdir: /tmp
    namespace: mynamespace
    autocreate: true
    initContainer:
      image: docker.mycompany.com/myrepo/okteto/bin:1.3.4
    command:
      - bash
    securityContext:
      capabilities:
        add:
        - SYS_PTRACE # required by C++ and go debuggers
    forward:
      - 8080:8080

service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: test-wq-spark-rac-1
spec:
  selector:
    app: api
  ports:
  - name: test-wq-spark-rac-1
    port: 8080
    protocol: TCP
    targetPort: 8080
  - name: sparkui
    port: 4040
    protocol: TCP
    targetPort: 4040
  - name: blockmgr
    port: 6060
    protocol: TCP
    targetPort: 6060
  - name: driver
    port: 35201
    protocol: TCP
    targetPort: 35201

So in essence 2 problems:

  1. VS Code Plugin should ask to choose manifest file.
  2. okteto destroy command is supposed to clean everything but it cleans only the resources created under deploy section.

Desktop (please complete the following information):

  • OS: MAC OS 12.6
  • VS Code Plugin Version: 0.4.5
  • Okteto version: 2.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant