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

ODO push doesn't work with volumeMounts for v2 #3308

Closed
mik-dass opened this issue Jun 5, 2020 · 2 comments
Closed

ODO push doesn't work with volumeMounts for v2 #3308

mik-dass opened this issue Jun 5, 2020 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mik-dass
Copy link
Contributor

mik-dass commented Jun 5, 2020

/kind bug

How did you run odo exactly?

odo push

with a V2 devfile with volumeMounts

schemaVersion: 2.0.0
metadata:
  name: test-devfile
projects:
  - name: nodejs-web-app
    git:
      location: "https://github.com/che-samples/web-nodejs-sample.git"
components:
  - container:
      name: runtime
      image: quay.io/eclipse/che-nodejs10-ubi:nightly
      memoryLimit: 1024Mi
      env:
        - name: FOO
          value: "bar"
      endpoints:
        - name: "3000/tcp"
          configuration:
            protocol: tcp
            scheme: http
          targetPort: 3000
      mountSources: true
      volumes:
        - name: myvol
          containerPath: /data
  - container:
      name: runtime2
      image: quay.io/eclipse/che-nodejs10-ubi:nightly
      memoryLimit: 1024Mi
      mountSources: false
      volumes:
        - name: myvol
          containerPath: /data
        - name: myvol2
          containerPath: /data2
commands:
  - exec:
      id: devBuild
      component: runtime
      commandLine: "echo hello >> myfile.log"
      workingDir: /data
      group:
        kind: build
        isDefault: true
  - exec:
      id: devRun
      component: runtime2
      commandLine: "cat myfile.log"
      workingDir: /data
      group:
        kind: run
        isDefault: true

Actual behavior

 ✗  Executing devBuild command "echo hello >> myfile.log" [82ms]
 ✗  Failed to start component with name nodejs.
Error: Failed to create the component: unable to execute the build command: error while streaming command: command terminated with exit code 1

Expected behavior

odo push should not error out.

Any logs, error output, etc?

While debugging, I found that volumeMounts are not picked up from the V2 devfile while parsing. Thus no volume is created.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 5, 2020
@adisky
Copy link
Contributor

adisky commented Jun 5, 2020

@mik-dass volumes needs to specified like this
https://github.com/openshift/odo/blob/master/tests/examples/source/devfilesV2/springboot/devfile.yaml#L20

volumeMounts
     - name: myvol
      -path: /data

@mik-dass
Copy link
Contributor Author

mik-dass commented Jun 5, 2020

@mik-dass volumes needs to specified like this
https://github.com/openshift/odo/blob/master/tests/examples/source/devfilesV2/springboot/devfile.yaml#L20

OK, it seems the way to declare a volume mount has changed with V2. and thus the error was occurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants