* Add Virtual Kubelet provider for VIC Initial virtual kubelet provider for VMware VIC. This provider currently handles creating and starting of a pod VM via the VIC portlayer and persona server. Image store handling via the VIC persona server. This provider currently requires the feature/wolfpack branch of VIC. * Added pod stop and delete. Also added node capacity. Added the ability to stop and delete pod VMs via VIC. Also retrieve node capacity information from the VCH. * Cleanup and readme file Some file clean up and added a Readme.md markdown file for the VIC provider. * Cleaned up errors, added function comments, moved operation code 1. Cleaned up error handling. Set standard for creating errors. 2. Added method prototype comments for all interface functions. 3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder. * Add mocking code and unit tests for podcache, podcreator, and podstarter Used the unit test framework used in VIC to handle assertions in the provider's unit test. Mocking code generated using OSS project mockery, which is compatible with the testify assertion framework. * Vendored packages for the VIC provider Requires feature/wolfpack branch of VIC and a few specific commit sha of projects used within VIC. * Implementation of POD Stopper and Deleter unit tests (#4) * Updated files for initial PR
213 lines
5.7 KiB
JSON
213 lines
5.7 KiB
JSON
[
|
|
{
|
|
"description": "root pointer ref",
|
|
"schema": {
|
|
"properties": {
|
|
"foo": {"$ref": "#"}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "match",
|
|
"data": {"foo": false},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "recursive match",
|
|
"data": {"foo": {"foo": false}},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "mismatch",
|
|
"data": {"bar": false},
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "recursive mismatch",
|
|
"data": {"foo": {"bar": false}},
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "relative pointer ref to object",
|
|
"schema": {
|
|
"properties": {
|
|
"foo": {"type": "integer"},
|
|
"bar": {"$ref": "#/properties/foo"}
|
|
}
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "match",
|
|
"data": {"bar": 3},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "mismatch",
|
|
"data": {"bar": true},
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "relative pointer ref to array",
|
|
"schema": {
|
|
"items": [
|
|
{"type": "integer"},
|
|
{"$ref": "#/items/0"}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "match array",
|
|
"data": [1, 2],
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "mismatch array",
|
|
"data": [1, "foo"],
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "escaped pointer ref",
|
|
"schema": {
|
|
"tilda~field": {"type": "integer"},
|
|
"slash/field": {"type": "integer"},
|
|
"percent%field": {"type": "integer"},
|
|
"properties": {
|
|
"tilda": {"$ref": "#/tilda~0field"},
|
|
"slash": {"$ref": "#/slash~1field"},
|
|
"percent": {"$ref": "#/percent%25field"}
|
|
}
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "slash invalid",
|
|
"data": {"slash": "aoeu"},
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "tilda invalid",
|
|
"data": {"tilda": "aoeu"},
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "percent invalid",
|
|
"data": {"percent": "aoeu"},
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "slash valid",
|
|
"data": {"slash": 123},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "tilda valid",
|
|
"data": {"tilda": 123},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "percent valid",
|
|
"data": {"percent": 123},
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "nested refs",
|
|
"schema": {
|
|
"definitions": {
|
|
"a": {"type": "integer"},
|
|
"b": {"$ref": "#/definitions/a"},
|
|
"c": {"$ref": "#/definitions/b"}
|
|
},
|
|
"$ref": "#/definitions/c"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "nested ref valid",
|
|
"data": 5,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "nested ref invalid",
|
|
"data": "a",
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "ref overrides any sibling keywords",
|
|
"schema": {
|
|
"definitions": {
|
|
"reffed": {
|
|
"type": "array"
|
|
}
|
|
},
|
|
"properties": {
|
|
"foo": {
|
|
"$ref": "#/definitions/reffed",
|
|
"maxItems": 2
|
|
}
|
|
}
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "ref valid",
|
|
"data": { "foo": [] },
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ref valid, maxItems ignored",
|
|
"data": { "foo": [ 1, 2, 3] },
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ref invalid",
|
|
"data": { "foo": "string" },
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "remote ref, containing refs itself",
|
|
"schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
|
|
"tests": [
|
|
{
|
|
"description": "remote ref valid",
|
|
"data": {"minLength": 1},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "remote ref invalid",
|
|
"data": {"minLength": -1},
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "property named $ref that is not a reference",
|
|
"schema": {
|
|
"properties": {
|
|
"$ref": {"type": "string"}
|
|
}
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "property named $ref valid",
|
|
"data": {"$ref": "a"},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "property named $ref invalid",
|
|
"data": {"$ref": 2},
|
|
"valid": false
|
|
}
|
|
]
|
|
}
|
|
]
|