Skip to content

Commit

Permalink
Warning if version of Devfile is different from 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Sep 1, 2023
1 parent cb84943 commit f1b45b7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ododevapispec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,7 @@ components:
type: object
required:
- content
- version
- commands
- containers
- images
Expand All @@ -1572,6 +1573,8 @@ components:
properties:
content:
type: string
version:
type: string
commands:
type: array
items:
Expand Down
3 changes: 3 additions & 0 deletions pkg/apiserver-gen/go/model_devfile_content.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apiserver-impl/devstate/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (o *DevfileState) GetContent() (DevfileContent, error) {

return DevfileContent{
Content: string(result),
Version: o.Devfile.Data.GetSchemaVersion(),
Commands: commands,
Containers: containers,
Images: images,
Expand Down
3 changes: 3 additions & 0 deletions pkg/apiserver-impl/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,7 @@ components:
type: object
required:
- content
- version
- commands
- containers
- images
Expand All @@ -1572,6 +1573,8 @@ components:
properties:
content:
type: string
version:
type: string
commands:
type: array
items:
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver-impl/ui/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ui/src/app/api-gen/model/devfileContent.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export class AppComponent implements OnInit {
console.log(error);
}
});

if (newContent.version != "2.2.0") {
this.snackbar.open("The version of the Devfile is "+newContent.version+".\nOnly version 2.2.0 is supported", "ok")
}
});

this.sse.subscribeTo(['DevfileUpdated']).subscribe(event => {
Expand Down

0 comments on commit f1b45b7

Please sign in to comment.