Creating workspace with valid but unsupported devfile returns 500 error
Reproduce with
-
Store the following snippet as
.devfile.yaml
schemaVersion: 2.2.0 metadata: name: go displayName: Go Runtime description: 'Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.' icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg language: Go projectType: Go tags: - Go version: 1.1.0 provider: Red Hat supportUrl: https://github.com/devfile-samples/devfile-support#support-information attributes: alpha.dockerimage-port: 8081 parent: id: go registryUrl: 'https://registry.devfile.io' components: - name: image-build image: imageName: go-image:latest dockerfile: uri: docker/Dockerfile buildContext: . rootRequired: false - name: kubernetes-deploy attributes: deployment/replicas: 1 deployment/cpuLimit: '100m' deployment/cpuRequest: 10m deployment/memoryLimit: 100Mi deployment/memoryRequest: 10Mi deployment/container-port: 8081 kubernetes: uri: deploy.yaml endpoints: - name: http-8081 targetPort: 8081 path: / commands: - id: build-image apply: component: image-build - id: deployk8s apply: component: kubernetes-deploy - id: deploy composite: commands: - build-image - deployk8s group: kind: deploy isDefault: true
-
Try to use the file to create a workspace
-
See the following error:
-
/Users/tomas/workspace/gl/gdk/gitlab/ee/lib/remote_development/workspaces/reconcile/devfile_processor.rb:52:in `add_editor' <-- /Users/tomas/workspace/gl/gdk/gitlab/ee/lib/remote_development/workspaces/reconcile/devfile_processor.rb:11:in `process' <-- /Users/tomas/workspace/gl/gdk/gitlab/ee/lib/remote_development/workspaces/create/create_processor.rb:33:in `process' <-- /Users/tomas/workspace/gl/gdk/gitlab/ee/app/services/remote_development/workspaces/create_service.rb:8:in `execute' <-- /Users/tomas/workspace/gl/gdk/gitlab/ee/app/graphql/mutations/remote_development/workspaces/create.rb:78:in `resolve' <-- /Users/tomas/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-1.13.12/lib/graphql/schema/resolver.rb:107:in `public_send' <-- /Users/tomas/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-1.13.12/lib/graphql/schema/resolver.rb:107:in `block (3 levels) in resolve_with_support' <-- /Users/tomas/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-1.13.12/lib/graphql/schema.rb:118:in `after_lazy' <-- /Users/tomas/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-1.13.12/lib/graphql/schema/resolver.rb:95:in `block (2 levels) in resolve_with_support' <-- /Users/tomas/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-1.13.12/lib/graphql/schema.rb:118:in `after_lazy' <-- /Users/tomas/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-1.13.12/lib/graphql/schema/resolver.rb:86:in `block in resolve_with_support'
-
@vtak explained the error with
Your devfile is missing an attribute which specifies where we want to inject the editor. Also the devfile components are outerloop i.e. build and deploy. We will only be supporting innerloop components i.e. components of type containers.
Edited by Tomas Vik (OOO back on 2024-08-12)