Odo: push failed with devfile without endpoinds

Created on 23 Mar 2020  Â·  4Comments  Â·  Source: openshift/odo

apiVersion: 1.0.0
metadata:
  name: java
components:
  - type: dockerimage
    alias: tools
    image: quay.io/eclipse/che-java11-maven:nightly
    memoryLimit: 512Mi
    mountSources: true
    volumes:
      - name: m2
        containerPath: /home/user/.m2
commands:
  - name: devBuild
    actions:
      - type: exec
        component: tools
        command: "mvn package"
  - name: devRun
    actions:
      - type: exec
        component: tools
        command: "java -jar target/*.jar"
â–¶ odo push
 •  Push devfile component demo-backend  ...
 ✗  Failed to start component with name demo-backend.
Error: Failed to create the component: unable to create or update component: unable to create Service for demo-backend: Service "demo-backend" is invalid: spec.ports: Required value

/kind bug
/priority high
/area devfile

aredevfile kinbug prioritHigh

Most helpful comment

I don't think that we need to do any of this. Devfile without endpoint is perfectly valid devfile, not every application need to have ports exposed.

All 4 comments

ping @yangcao77

I'm wondering... maybe if no endpoint is specified in the devfile, we should:

  • Allow the user to specify a port during odo create via the existing --port flag (although we should support this even if there's an endpoint specified, so the user can override)
  • Default to some default value otherwise (and warn the user?)

Thoughts?

I don't think that we need to do any of this. Devfile without endpoint is perfectly valid devfile, not every application need to have ports exposed.

/assign

Was this page helpful?
0 / 5 - 0 ratings