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

Support for devfile v2 parents #21098

Closed
nils-mosbach opened this issue Jan 31, 2022 · 8 comments
Closed

Support for devfile v2 parents #21098

nils-mosbach opened this issue Jan 31, 2022 · 8 comments
Assignees
Labels
area/dashboard area/devworkspace-operator kind/bug Outline of a bug - must adhere to the bug report template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes severity/P1 Has a major impact to usage or development of the system. sprint/current
Milestone

Comments

@nils-mosbach
Copy link

nils-mosbach commented Jan 31, 2022

Describe the bug

Based on the devfile 2.1 specification parent devfiles should be resolved if e.g. parent.uri is given. (Referring to a parent devfile in a devfile)

That doesn't seem to work in the current version.

I've created a parent file that contains a database container, e.g.
https://github.com/nils-mosbach/devfile.io-demo-che-parent

# Parent Devfile
schemaVersion: 2.1.0
metadata:
  name: devfile-test
components:
  - name: db-service
    container:
      image: "bitnami/postgresql:12.5.0"
      env:
        - value: root
          name: POSTGRES_USER
        - value: password
          name: POSTGRES_PASSWORD
      memoryLimit: 256Mi

And a child devfile that should inherit e.g. the database container from parent.
https://github.com/nils-mosbach/devfile.io-demo-che-child

# Child Devfile
schemaVersion: 2.1.0
metadata:
  name: devfile-test
parent:
  uri: https://raw.githubusercontent.com/nils-mosbach/devfile.io-demo-che-parent/main/devfile.yaml
components:
  - name: nodejsdev
    container:
      image: quay.io/devfile/universal-developer-image:ubi8-b452131
      endpoints:
        - exposure: public
          name: nodejs
          protocol: http
          targetPort: 3000
      memoryLimit: 1G
      mountSources: true

The resulting workspace only contains the child devfile contents. Strange thing is, that at least there's a message Resolved plugins and parents from DevWorkspace in the devfiles log. See:

$ kubectl get devworkspace devfile-test -o yaml

apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  annotations:
    che.eclipse.org/che-editor: eclipse/che-theia/next
    che.eclipse.org/last-updated-timestamp: "2022-01-31T15:21:21.515Z"
    controller.devfile.io/started-at: "1643642490609"
  creationTimestamp: "2022-01-31T15:21:23Z"
  finalizers:
  - storage.controller.devfile.io
  generation: 2
  labels:
    controller.devfile.io/creator: ""
  managedFields:
  - apiVersion: workspace.devfile.io/v1alpha2
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:che.eclipse.org/che-editor: {}
          f:che.eclipse.org/last-updated-timestamp: {}
      f:spec:
        .: {}
        f:routingClass: {}
        f:started: {}
        f:template:
          .: {}
          f:components: {}
          f:projects: {}
    manager: unknown
    operation: Update
    time: "2022-01-31T15:21:23Z"
  - apiVersion: workspace.devfile.io/v1alpha2
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:controller.devfile.io/started-at: {}
        f:finalizers:
          .: {}
          v:"storage.controller.devfile.io": {}
      f:status:
        .: {}
        f:conditions: {}
        f:devworkspaceId: {}
        f:mainUrl: {}
        f:message: {}
        f:phase: {}
    manager: devworkspace-controller
    operation: Update
    time: "2022-01-31T15:21:46Z"
  name: devfile-test
  namespace: dev-studio-workspace-nm-company-com-zsobsb
  resourceVersion: "326197176"
  uid: 85590186-f9b2-4647-957c-0d514e9507c3
spec:
  routingClass: che
  started: true
  template:
    components:
    - container:
        endpoints:
        - exposure: public
          name: nodejs
          protocol: http
          targetPort: 3000
        image: quay.io/devfile/universal-developer-image:ubi8-b452131
        memoryLimit: 1G
        mountSources: true
        sourceMapping: /projects
      name: nodejsdev
    - name: theia-ide-workspace85590186f9b24647
      plugin:
        kubernetes:
          name: theia-ide-workspace85590186f9b24647
          namespace: dev-studio-workspace-nm-company-com-zsobsb
    projects:
    - git:
        remotes:
          origin: https://github.com/nils-mosbach/devfile.io-demo-che-child.git
      name: devfile-io-demo-che-child
status:
  conditions:
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: No warnings in processing DevWorkspace
    status: "False"
    type: DevWorkspaceWarning
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: DevWorkspace is starting
    status: "True"
    type: Started
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: Resolved plugins and parents from DevWorkspace
    status: "True"
    type: DevWorkspaceResolved
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: Storage ready
    status: "True"
    type: StorageReady
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: Networking ready
    status: "True"
    type: RoutingReady
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: DevWorkspace serviceaccount ready
    status: "True"
    type: ServiceAccountReady
  - lastTransitionTime: "2022-01-31T15:21:08Z"
    message: DevWorkspace secrets ready
    status: "True"
    type: PullSecretsReady
  - lastTransitionTime: "2022-01-31T15:21:30Z"
    message: DevWorkspace deployment ready
    status: "True"
    type: DeploymentReady
  - lastTransitionTime: "2022-01-31T15:21:30Z"
    status: "True"
    type: Ready
  devworkspaceId: workspace85590186f9b24647
  mainUrl: https://che.company.dev/workspace85590186f9b24647/theia-ide/3100/
  message: https://che.company.dev/workspace85590186f9b24647/theia-ide/3100/
  phase: Running

Che version

next (development version)

Steps to reproduce

Run a devfile that references a parent devfile. e.g.
https://github.com/nils-mosbach/devfile.io-demo-che-child

Expected behavior

Child devworkspace should contain all components and settings from the parents' devfile.

Runtime

Kubernetes (vanilla)

Screenshots

No response

Installation method

chectl/next

Environment

Linux

Eclipse Che Logs

# Devworkspace Operator

{"level":"info","ts":1643642468.1432917,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":""}
{"level":"info","ts":1643642468.157668,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.178481,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2051284,"logger":"controllers.DevWorkspace","msg":"Created object","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","kind":"v1alpha1.DevWorkspaceRouting","name":"routing-workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2051394,"logger":"controllers.DevWorkspace","msg":"Waiting on routing to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2173388,"logger":"controllers.DevWorkspace","msg":"Error updating workspace status: Operation cannot be fulfilled on devworkspaces.workspace.devfile.io \"devfile-test\": the object has been modified; please apply your changes to the latest version and try again","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.217401,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.237505,"logger":"controllers.DevWorkspace","msg":"Updated object","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","kind":"v1alpha1.DevWorkspaceRouting","name":"routing-workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2375166,"logger":"controllers.DevWorkspace","msg":"Waiting on routing to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2556083,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2683697,"logger":"controllers.DevWorkspace","msg":"Waiting on routing to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.2746427,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.285652,"logger":"controllers.DevWorkspace","msg":"Waiting on routing to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.3059316,"logger":"controllers.DevWorkspaceRouting","msg":"Reconciling DevWorkspaceRouting","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"routing-workspace85590186f9b24647","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.3324785,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.3747895,"logger":"controllers.DevWorkspace","msg":"Waiting on routing to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.4269297,"logger":"controllers.DevWorkspaceRouting","msg":"Reconciling DevWorkspaceRouting","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"routing-workspace85590186f9b24647","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.4425676,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.4751227,"logger":"controllers.DevWorkspace","msg":"Updating workspace status","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.4863222,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5028675,"logger":"controllers.DevWorkspace","msg":"Created object","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","kind":"v1.ConfigMap","name":"workspace85590186f9b24647-metadata"}
{"level":"info","ts":1643642468.5028777,"logger":"controllers.DevWorkspace","msg":"Waiting for DevWorkspace metadata configmap to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5113842,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5276585,"logger":"controllers.DevWorkspace","msg":"Created object","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","kind":"v1.ServiceAccount","name":"workspace85590186f9b24647-sa"}
{"level":"info","ts":1643642468.5276685,"logger":"controllers.DevWorkspace","msg":"Waiting for workspace ServiceAccount","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5364704,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5550892,"logger":"controllers.DevWorkspace","msg":"Error updating workspace status: Operation cannot be fulfilled on devworkspaces.workspace.devfile.io \"devfile-test\": the object has been modified; please apply your changes to the latest version and try again","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"error","ts":1643642468.5551393,"logger":"controller-runtime.manager.controller.devworkspace","msg":"Reconciler error","reconciler group":"workspace.devfile.io","reconciler kind":"DevWorkspace","name":"devfile-test","namespace":"dev-studio-workspace-nm-company-com-zsobsb","error":"Operation cannot be fulfilled on devworkspaces.workspace.devfile.io \"devfile-test\": the object has been modified; please apply your changes to the latest version and try again","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214"}
{"level":"info","ts":1643642468.5552216,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5741203,"logger":"controllers.DevWorkspace","msg":"Created object","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","kind":"v1.Deployment","name":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.574142,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.5938861,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.6188617,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.63552,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.6804729,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.6980124,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.7315493,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.7464192,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.7721932,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.784495,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642468.8106456,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642470.0678377,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642470.0929105,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642473.698849,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642473.73298,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642478.7424645,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642478.7730224,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642483.7886868,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642483.8201244,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642486.3269165,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642486.3669064,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642488.4265115,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642488.4554167,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642488.8340263,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642488.8678536,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642490.535104,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642490.5690937,"logger":"controllers.DevWorkspace","msg":"Waiting on deployment to be ready","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642490.5797062,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642490.6395772,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}
{"level":"info","ts":1643642493.8819191,"logger":"controllers.DevWorkspace","msg":"Reconciling Workspace","Request.Namespace":"dev-studio-workspace-nm-company-com-zsobsb","Request.Name":"devfile-test","devworkspace_id":"workspace85590186f9b24647"}

# Che-Dashboard
(node:7) UnhandledPromiseRejectionWarning: #<o>
(node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 45)

# Che Operator
2022-01-31T15:21:08.206Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.206Z	INFO	controllers.DevWorkspaceRouting	Adding Finalizer for the DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.253Z	INFO	sync	Creating a new object	{"kind": "v1.ConfigMap", "name": "workspace85590186f9b24647-route", "namespace": "dev-studio"}
2022-01-31T15:21:08.263Z	INFO	sync	Creating a new object	{"kind": "v1.ConfigMap", "name": "workspace85590186f9b24647-route", "namespace": "dev-studio-workspace-nm-company-com-zsobsb"}
2022-01-31T15:21:08.307Z	INFO	controllers.DevWorkspaceRouting	Created object	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "kind": "v1.Service", "name": "workspace85590186f9b24647-service"}
2022-01-31T15:21:08.307Z	INFO	controllers.DevWorkspaceRouting	Services not in sync	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.318Z	ERROR	controller-runtime.manager.controller.devworkspacerouting	Reconciler error	{"reconciler group": "controller.devfile.io", "reconciler kind": "DevWorkspaceRouting", "name": "routing-workspace85590186f9b24647", "namespace": "dev-studio-workspace-nm-company-com-zsobsb", "error": "Operation cannot be fulfilled on devworkspaceroutings.controller.devfile.io \"routing-workspace85590186f9b24647\": the object has been modified; please apply your changes to the latest version and try again"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/che-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:253
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/che-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:214
2022-01-31T15:21:08.318Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.318Z	INFO	controllers.DevWorkspaceRouting	Adding Finalizer for the DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.334Z	INFO	sync	Updating existing object	{"kind": "ConfigMap", "name": "workspace85590186f9b24647-route", "namespace": "dev-studio"}
2022-01-31T15:21:08.341Z	INFO	sync	Updating existing object	{"kind": "ConfigMap", "name": "workspace85590186f9b24647-route", "namespace": "dev-studio-workspace-nm-company-com-zsobsb"}
2022-01-31T15:21:08.422Z	INFO	controllers.DevWorkspaceRouting	Created object	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "kind": "v1.Ingress", "name": "workspace85590186f9b24647-nodejsdev-3000-nodejs"}
2022-01-31T15:21:08.422Z	INFO	controllers.DevWorkspaceRouting	Ingresses not in sync	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.437Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.445Z	ERROR	controller-runtime.manager.controller.devworkspacerouting	Reconciler error	{"reconciler group": "controller.devfile.io", "reconciler kind": "DevWorkspaceRouting", "name": "routing-workspace85590186f9b24647", "namespace": "dev-studio-workspace-nm-company-com-zsobsb", "error": "Operation cannot be fulfilled on devworkspaceroutings.controller.devfile.io \"routing-workspace85590186f9b24647\": the object has been modified; please apply your changes to the latest version and try again"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/che-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:253
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/che-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:214
2022-01-31T15:21:08.445Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:21:08.456Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
I0131 15:21:09.326236       1 request.go:668] Waited for 1.04794584s due to client-side throttling, not priority and fairness, request: GET:https://10.43.0.1:443/apis/operators.coreos.com/v1alpha2?timeout=32s
time="2022-01-31T15:21:14Z" level=info msg="Successfully reconciled."
I0131 15:21:19.376120       1 request.go:668] Waited for 1.246636655s due to client-side throttling, not priority and fairness, request: GET:https://10.43.0.1:443/apis/networking.k8s.io/v1beta1?timeout=32s
time="2022-01-31T15:21:22Z" level=info msg="Successfully reconciled."
2022-01-31T15:22:04.847Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}
2022-01-31T15:22:04.869Z	INFO	controllers.DevWorkspaceRouting	Reconciling DevWorkspaceRouting	{"Request.Namespace": "dev-studio-workspace-nm-company-com-zsobsb", "Request.Name": "routing-workspace85590186f9b24647", "devworkspace_id": "workspace85590186f9b24647"}

Release Notes Text

The Devfile v2 specification introduced the concept of parent that allow to refernce an existing Devfile. Che now supports that with DevWorkspace bassed workspaces.

@nils-mosbach nils-mosbach added the kind/bug Outline of a bug - must adhere to the bug report template. label Jan 31, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jan 31, 2022
@skabashnyuk skabashnyuk added severity/P1 Has a major impact to usage or development of the system. area/devworkspace-operator and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Feb 1, 2022
@ibuziuk ibuziuk mentioned this issue Feb 2, 2022
35 tasks
@amisevsk
Copy link
Contributor

amisevsk commented Feb 2, 2022

It seems the parent in the devfile is getting dropped before it hits the cluster. I tested creating the DevWorkspace

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: test-dw
spec:
  started: true
  routingClass: che
  template:
    parent:
      uri: https://raw.githubusercontent.com/nils-mosbach/devfile.io-demo-che-parent/main/devfile.yaml
    components:
      - name: nodejsdev
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-b452131
          endpoints:
            - exposure: public
              name: nodejs
              protocol: http
              targetPort: 3000
          memoryLimit: 1G
          mountSources: true

directly and the parent is resolved (the resulting pod contains the postgres container).

The workspace fails to start regardless, with Container db-service has state CrashLoopBackOff (maybe it needs an cmd/args override, I haven't looked into it).

@amisevsk
Copy link
Contributor

amisevsk commented Feb 2, 2022

To isolate the Operators part of the process, you can try applying the following DevWorkspace directly to the cluster (in your user's Che namespace):

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: devfile-parent-test
spec:
  started: true
  routingClass: che
  template:
    projects:
      - name: devfile-io-demo-che-child
        git:
          remotes:
            origin: 'https://github.com/nils-mosbach/devfile.io-demo-che-child.git'
    parent:
      uri: https://raw.githubusercontent.com/nils-mosbach/devfile.io-demo-che-parent/main/devfile.yaml
    components:
      - name: nodejsdev
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-b452131
          endpoints:
            - exposure: public
              name: nodejs
              protocol: http
              targetPort: 3000
          memoryLimit: 1G
          mountSources: true
      - name: theia-ide
        plugin:
          uri: https://eclipse-che.github.io/che-plugin-registry/main/v3/plugins/eclipse/che-theia/next/devfile.yaml

@ibuziuk
Copy link
Member

ibuziuk commented Feb 4, 2022

@amisevsk thank you for the investigation, it looks like UD ignores parent atm. Could you please clarify if the DevWorksapce Operator currently supports parent ref by id e.g.

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: devfile-parent-test
spec:
  template:
    projects:
      - name: 
      ...
    parent:
      id: nodejs
      registryUrl: "https://registry.devfile.io"
    components:
...

?

@akurinnoy akurinnoy self-assigned this Feb 4, 2022
@ibuziuk
Copy link
Member

ibuziuk commented Feb 4, 2022

Looks like it is failing currently with

Error processing devfile: failed to resolve component parent from registry https://registry.devfile.io: could not fetch file from https://registry.devfile.io/nodejs: got status 404

basically, DWO controller tries to resolve

parent:
      id: nodejs
      registryUrl: "https://registry.devfile.io"

as https://registry.devfile.io/nodejs whereas the actual link is https://registry.devfile.io/devfiles/nodejs

@amisevsk
Copy link
Contributor

amisevsk commented Feb 4, 2022

DWO supports the same reference types as it does for plugins (registry + ID, URI, and DWT within the cluster).

However, the devfile/api specification is not explicit in how registryURL should be handled. For safety, the DevWorkspace Operator defaulted to using url := <registryURL>/<id>, as allows using id with anything that looks like a registry. It seems like the expected format in the linked devfile is <registryURL>/devfiles/<id>, so DWO should probably do the same.

I believe (this was a long time ago now) the reasoning was that you might want to use a registry for plugin devfiles, which might be stored at e.g. <registryUrl>/plugins/<id>

@ibuziuk
Copy link
Member

ibuziuk commented Feb 9, 2022

thanks, folks, for the investigation
I believe the issue can be closed now since the following PRs have been merged:

@ibuziuk
Copy link
Member

ibuziuk commented Feb 9, 2022

Closing. feel free to reopen if needed

@ibuziuk ibuziuk closed this as completed Feb 9, 2022
@l0rd l0rd added the new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes label Feb 10, 2022
@l0rd l0rd changed the title devfile v2 - Parent is not resolved Support for devfile v2 parents Feb 10, 2022
@l0rd l0rd added the status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording label Feb 10, 2022
@l0rd l0rd added this to the 7.44 milestone Feb 10, 2022
@devstudio-release
Copy link

sync'd to Red Hat JIRA https://issues.redhat.com/browse/CRW-2747

@max-cx max-cx removed the status/release-notes-review-needed Issues that needs to be reviewed by the doc team for the Release Notes wording label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard area/devworkspace-operator kind/bug Outline of a bug - must adhere to the bug report template. new&noteworthy For new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notes severity/P1 Has a major impact to usage or development of the system. sprint/current
Projects
None yet
Development

No branches or pull requests

9 participants