odo icon indicating copy to clipboard operation
odo copied to clipboard

odo commands editing a Devfile with a parent reference

Open feloy opened this issue 3 years ago • 0 comments

/kind bug

What versions of software are you using?

Operating System:

Fedora Linux

Output of odo version:

odo v3.0.0-beta2 (854e7566c)

How did you run odo exactly?

$ cat devfile.yaml
schemaVersion: 2.1.0
metadata:
  name: child
parent:
  uri: "../devfile.yaml"

$ odo add binding --service cluster-sample.Cluster.postgresql.k8s.enterprisedb.io --name child-devfile-cluster-sample

$ cat devfile.yaml 
commands:
- attributes:
    api.devfile.io/imported-from: 'uri: ../devfile.yaml'
  exec:
    commandLine: GOCACHE=${PROJECT_SOURCE}/.cache go build main.go
    component: runtime
    group:
      isDefault: true
      kind: build
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: build
- attributes:
    api.devfile.io/imported-from: 'uri: ../devfile.yaml'
  exec:
    commandLine: ./main
    component: runtime
    group:
      isDefault: true
      kind: run
    hotReloadCapable: false
    workingDir: ${PROJECT_SOURCE}
  id: run
components:
- attributes:
    api.devfile.io/imported-from: 'uri: ../devfile.yaml'
  container:
    dedicatedPod: false
    endpoints:
    - name: http
      secure: false
      targetPort: 8080
    image: quay.io/devfile/golang:latest
    memoryLimit: 1024Mi
    mountSources: true
  name: runtime
- kubernetes:
    inlined: |
      apiVersion: binding.operators.coreos.com/v1alpha1
      kind: ServiceBinding
      metadata:
        creationTimestamp: null
        name: child-devfile-cluster-sample
      spec:
        application:
          group: apps
          kind: Deployment
          name: child-app
          version: v1
        bindAsFiles: true
        detectBindingResources: true
        services:
        - group: postgresql.k8s.enterprisedb.io
          id: child-devfile-cluster-sample
          kind: Cluster
          name: cluster-sample
          resource: clusters
          version: v1
      status:
        secret: ""
  name: child-devfile-cluster-sample
metadata:
  name: child
schemaVersion: 2.1.0
starterProjects:
- attributes:
    api.devfile.io/imported-from: 'uri: ../devfile.yaml'
  git:
    checkoutFrom:
      revision: main
    remotes:
      origin: https://github.com/devfile-samples/devfile-stack-go.git
  name: go-starter

Actual behavior

The resulting devfile inlines the components and commands of the parent devfile.

Expected behavior

The resulting devfile still references the parent devfile.

Any logs, error output, etc?

feloy avatar Aug 02 '22 09:08 feloy