Skip to content

Commit

Permalink
Extend relationships to support the new formats
Browse files Browse the repository at this point in the history
  • Loading branch information
akalipetis committed Jun 14, 2024
1 parent 7463bed commit 6445e17
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 14 deletions.
3 changes: 0 additions & 3 deletions platformifier/platformifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package platformifier
import (
"context"
"errors"
"fmt"
"io/fs"
"os"
"reflect"
Expand Down Expand Up @@ -574,8 +573,6 @@ func TestPlatformifier_Upsunify(t *testing.T) {
if err := validator.ValidateConfig(dir, "upsun"); (err != nil) != tt.wantErr {
t.Errorf("Platformifier.Platformify() validation error = %v, wantErr %v", err, tt.wantErr)
}
out, _ := os.ReadFile(dir + "/.upsun/config.yaml")
fmt.Println(string(out))
})
}
}
66 changes: 61 additions & 5 deletions validator/schema/platformsh.application.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,25 @@
"relationships": {
"type": "object",
"additionalProperties": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "null"
},
{
"type": "object",
"properties": {
"service": {
"type": "string"
},
"endpoint": {
"type": "string"
}
}
}
]
},
"title": "The relationships of the application to defined services.",
"default": {}
Expand Down Expand Up @@ -373,9 +391,28 @@
"relationships": {
"type": "object",
"additionalProperties": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "null"
},
{
"type": "object",
"properties": {
"service": {
"type": "string"
},
"endpoint": {
"type": "string"
}
}
}
]
},
"title": "The relationships of the application to defined services."
"title": "The relationships of the application to defined services.",
"default": {}
},
"access": {
"type": "object",
Expand Down Expand Up @@ -762,9 +799,28 @@
"relationships": {
"type": "object",
"additionalProperties": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "null"
},
{
"type": "object",
"properties": {
"service": {
"type": "string"
},
"endpoint": {
"type": "string"
}
}
}
]
},
"title": "The relationships of the application to defined services."
"title": "The relationships of the application to defined services.",
"default": {}
},
"access": {
"type": "object",
Expand Down
55 changes: 49 additions & 6 deletions validator/schema/upsun.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
{
"type": "string"
},
{
"type": "null"
},
{
"type": "object",
"properties": {
Expand All @@ -57,8 +60,7 @@
"endpoint": {
"type": "string"
}
},
"nullable": true
}
}
]
},
Expand Down Expand Up @@ -384,9 +386,28 @@
"relationships": {
"type": "object",
"additionalProperties": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "null"
},
{
"type": "object",
"properties": {
"service": {
"type": "string"
},
"endpoint": {
"type": "string"
}
}
}
]
},
"title": "The relationships of the application to defined services."
"title": "The relationships of the application to defined services.",
"default": {}
},
"access": {
"type": "object",
Expand Down Expand Up @@ -769,9 +790,28 @@
"relationships": {
"type": "object",
"additionalProperties": {
"type": "string"
"oneOf": [
{
"type": "null"
},
{
"type": "string"
},
{
"type": "object",
"properties": {
"service": {
"type": "string"
},
"endpoint": {
"type": "string"
}
}
}
]
},
"title": "The relationships of the application to defined services."
"title": "The relationships of the application to defined services.",
"default": {}
},
"access": {
"type": "object",
Expand Down Expand Up @@ -1278,6 +1318,9 @@
{
"type": "string"
},
{
"type": "null"
},
{
"type": "object",
"properties": {
Expand Down

0 comments on commit 6445e17

Please sign in to comment.