Commands editing the devfile (like `odo add binding` or `odo remove binding`) reorder it
when using odo 2.4.0 (and 2.3.1 as well)
▶ odo create java-springboot
Devfile Object Validation
✓ Checking devfile existence [21080ns]
✓ Creating a devfile component from registry: DefaultDevfileRegistry [33560ns]
Validation
✓ Validating if devfile name is correct [29220ns]
Please use `odo push` command to create the component with source deployed
Devfile keys are sorted alphabetically, but they should be in the order as they are in original file
▶ cat devfile.yaml
commands:
- exec:
commandLine: mvn clean -Dmaven.repo.local=/home/user/.m2/repository package -Dmaven.test.skip=true
component: tools
group:
isDefault: true
kind: build
id: build
- exec:
commandLine: mvn -Dmaven.repo.local=/home/user/.m2/repository spring-boot:run
component: tools
group:
isDefault: true
kind: run
id: run
- exec:
commandLine: java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n
-jar target/*.jar
component: tools
group:
isDefault: true
kind: debug
id: debug
components:
- container:
endpoints:
- name: 8080-tcp
targetPort: 8080
image: quay.io/eclipse/che-java11-maven:next
memoryLimit: 768Mi
mountSources: true
volumeMounts:
- name: m2
path: /home/user/.m2
name: tools
- name: m2
volume:
size: 3Gi
metadata:
description: Spring Boot® using Java
displayName: Spring Boot®
globalMemoryLimit: 2674Mi
icon: https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg
language: java
name: java-springboot-spring-petcl-egpl
projectType: spring
tags:
- Java
- Spring
version: 1.1.0
schemaVersion: 2.0.0
starterProjects:
- git:
remotes:
origin: https://github.com/odo-devfiles/springboot-ex.git
name: springbootproject
when using 2.3.0
▶ odo create java-springboot
Devfile Object Validation
✓ Checking devfile existence [20670ns]
✓ Creating a devfile component from registry: DefaultDevfileRegistry [33010ns]
Validation
✓ Validating if devfile name is correct [20070ns]
cat de
Please use `odo push` command to create the component with source deployed
Devfile is in the same format as it is in devfile registry
▶ cat devfile.yaml
```yaml schemaVersion: 2.0.0 metadata: name: java-springboot version: 1.1.0 displayName: Spring Boot® description: Spring Boot® using Java tags: ['Java', 'Spring'] globalMemoryLimit: 2674Mi icon: https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg projectType: 'spring' language: 'java' starterProjects: - name: springbootproject git: remotes: origin: 'https://github.com/odo-devfiles/springboot-ex.git' components: - name: tools container: image: quay.io/eclipse/che-java11-maven:next memoryLimit: 768Mi mountSources: true endpoints: - name: '8080-tcp' targetPort: 8080 volumeMounts: - name: m2 path: /home/user/.m2 - name: m2 volume: size: 3Gi commands: - id: build exec: component: tools commandLine: 'mvn clean -Dmaven.repo.local=/home/user/.m2/repository package -Dmaven.test.skip=true' group: kind: build isDefault: true - id: run exec: component: tools commandLine: 'mvn -Dmaven.repo.local=/home/user/.m2/repository spring-boot:run' group: kind: run isDefault: true - id: debug exec: component: tools commandLine: 'java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n -jar target/*.jar' group: kind: debug isDefault: true
/kind bug
/priority low
Not sure if this is relevant but similar net impact: https://github.com/devfile/api/issues/371
Not sure if this is relevant but similar net impact: devfile/api#371
yes, this is definitely related. The reordering is done by devfile/library.
But prior to odo v2.3.1 odo create was just downloading devfile.yaml without unmarshaling/marshalling cycle.
But something changed and now odo probably parses the devfile in memory and then saves it.
I think that #5115 and #5112 are another side effects if this. All this could be related
Devfile keys are sorted alphabetically, but they should be in the order as they are in original file
Also: newlines should be maintained between (at least the) top-level sections.
A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.
/retitle Commands editing the devfile (like odo add binding or odo remove binding) reorder it
/lifecycle frozen
odo create no longer exists in v3. But this issue still applies to current commands that can edit the Devfile, like odo add binding or odo remove binding.
Related to https://github.com/redhat-developer/odo/issues/5789