mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Warning if version of Devfile is different from 2.2.0 (#7065)
* Warning if version of Devfile is different from 2.2.0 * Fix unit tests
This commit is contained in:
3
pkg/apiserver-gen/go/model_devfile_content.go
generated
3
pkg/apiserver-gen/go/model_devfile_content.go
generated
@@ -12,6 +12,8 @@ package openapi
|
||||
type DevfileContent struct {
|
||||
Content string `json:"content"`
|
||||
|
||||
Version string `json:"version"`
|
||||
|
||||
Commands []Command `json:"commands"`
|
||||
|
||||
Containers []Container `json:"containers"`
|
||||
@@ -31,6 +33,7 @@ type DevfileContent struct {
|
||||
func AssertDevfileContentRequired(obj DevfileContent) error {
|
||||
elements := map[string]interface{}{
|
||||
"content": obj.Content,
|
||||
"version": obj.Version,
|
||||
"commands": obj.Commands,
|
||||
"containers": obj.Containers,
|
||||
"images": obj.Images,
|
||||
|
||||
@@ -83,6 +83,7 @@ components:
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{
|
||||
{
|
||||
Name: "an-exec-command",
|
||||
@@ -183,6 +184,7 @@ components:
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{
|
||||
{
|
||||
Name: "an-apply-command",
|
||||
@@ -311,6 +313,7 @@ components:
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{
|
||||
{
|
||||
Name: "an-exec-command",
|
||||
@@ -440,6 +443,7 @@ func TestDevfileState_DeleteCommand(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{
|
||||
{
|
||||
@@ -655,6 +659,7 @@ func TestDevfileState_MoveCommand(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{
|
||||
{
|
||||
Name: "an-exec-command",
|
||||
@@ -742,6 +747,7 @@ func TestDevfileState_SetDefaultCommand(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{
|
||||
{
|
||||
Name: "an-exec-command",
|
||||
@@ -831,6 +837,7 @@ func TestDevfileState_UnsetDefaultCommand(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{
|
||||
{
|
||||
Name: "an-exec-command",
|
||||
|
||||
@@ -78,6 +78,7 @@ func TestDevfileState_AddContainer(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{
|
||||
{
|
||||
@@ -150,6 +151,7 @@ schemaVersion: 2.2.0
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{
|
||||
{
|
||||
@@ -243,6 +245,7 @@ func TestDevfileState_DeleteContainer(t *testing.T) {
|
||||
Content: `metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -349,6 +352,7 @@ func TestDevfileState_AddImage(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{
|
||||
@@ -424,6 +428,7 @@ func TestDevfileState_DeleteImage(t *testing.T) {
|
||||
Content: `metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -507,6 +512,7 @@ func TestDevfileState_AddResource(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -539,6 +545,7 @@ schemaVersion: 2.2.0
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -607,6 +614,7 @@ func TestDevfileState_Deleteresource(t *testing.T) {
|
||||
Content: `metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -688,6 +696,7 @@ func TestDevfileState_AddVolume(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -753,6 +762,7 @@ func TestDevfileState_DeleteVolume(t *testing.T) {
|
||||
Content: `metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -20,6 +20,7 @@ func TestDevfileState_GetContent(t *testing.T) {
|
||||
},
|
||||
want: DevfileContent{
|
||||
Content: "metadata: {}\nschemaVersion: 2.2.0\n",
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
|
||||
@@ -35,6 +35,7 @@ func TestDevfileState_UpdateEvents(t *testing.T) {
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
@@ -67,6 +68,7 @@ schemaVersion: 2.2.0
|
||||
metadata: {}
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
|
||||
@@ -71,6 +71,7 @@ func TestDevfileState_SetMetadata(t *testing.T) {
|
||||
website: http://example.com
|
||||
schemaVersion: 2.2.0
|
||||
`,
|
||||
Version: "2.2.0",
|
||||
Commands: []Command{},
|
||||
Containers: []Container{},
|
||||
Images: []Image{},
|
||||
|
||||
@@ -1642,6 +1642,7 @@ components:
|
||||
type: object
|
||||
required:
|
||||
- content
|
||||
- version
|
||||
- commands
|
||||
- containers
|
||||
- images
|
||||
@@ -1652,6 +1653,8 @@ components:
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
commands:
|
||||
type: array
|
||||
items:
|
||||
|
||||
2
pkg/apiserver-impl/ui/index.html
generated
2
pkg/apiserver-impl/ui/index.html
generated
@@ -11,6 +11,6 @@
|
||||
<body class="mat-typography">
|
||||
<div id="loading">Loading, please wait...</div>
|
||||
<app-root></app-root>
|
||||
<script src="runtime.1289ea0acffcdc5e.js" type="module"></script><script src="polyfills.8b3b37cedaf377c3.js" type="module"></script><script src="main.113aa354c1f3bda4.js" type="module"></script>
|
||||
<script src="runtime.1289ea0acffcdc5e.js" type="module"></script><script src="polyfills.8b3b37cedaf377c3.js" type="module"></script><script src="main.4d8dc3ef32c88ca3.js" type="module"></script>
|
||||
|
||||
</body></html>
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user