Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -0,0 +1,36 @@
// The package is intended for testing the openapi-gen API rule
// checker. The API rule violations are in format of:
//
// `{rule-name},{package},{type},{(optional) field}`
//
// The checker should sort the violations before
// reporting to a file or stderr.
//
// We have the dummytype package separately from the listtype
// package to test the sorting behavior on package level, e.g.
//
// -i "./testdata/listtype,./testdata/dummytype"
// -i "./testdata/dummytype,./testdata/listtype"
//
// The violations from dummytype should always come first in
// report.
package dummytype
// +k8s:openapi-gen=true
type Foo struct {
Second string
First int
}
// +k8s:openapi-gen=true
type Bar struct {
ViolationBehind bool
Violation bool
}
// +k8s:openapi-gen=true
type Baz struct {
Violation bool
ViolationBehind bool
}

View File

@@ -0,0 +1,24 @@
// The package is intended for testing the openapi-gen API rule
// checker. The API rule violations are in format of:
//
// `{rule-name},{package},{type},{(optional) field}`
//
// The checker should sort the violations before
// reporting to a file or stderr.
//
// We have the dummytype package separately from the listtype
// package to test the sorting behavior on package level, e.g.
//
// -i "./testdata/listtype,./testdata/dummytype"
// -i "./testdata/dummytype,./testdata/listtype"
//
// The violations from dummytype should always come first in
// report.
package dummytype
// +k8s:openapi-gen=true
type Waldo struct {
First int
Second string
}

View File

@@ -0,0 +1,157 @@
{
"swagger": "2.0",
"info": {
"title": "Integration Test",
"version": "1.0"
},
"paths": {
"/test": {
"get": {
"schemes": [
"https"
],
"operationId": "func1",
"responses": {
"404": {
"$ref": "#/responses/NotFound"
}
}
}
}
},
"definitions": {
"dummytype.Bar": {
"required": [
"ViolationBehind",
"Violation"
],
"properties": {
"Violation": {
"type": "boolean"
},
"ViolationBehind": {
"type": "boolean"
}
}
},
"dummytype.Baz": {
"required": [
"Violation",
"ViolationBehind"
],
"properties": {
"Violation": {
"type": "boolean"
},
"ViolationBehind": {
"type": "boolean"
}
}
},
"dummytype.Foo": {
"required": [
"Second",
"First"
],
"properties": {
"First": {
"type": "integer",
"format": "int32"
},
"Second": {
"type": "string"
}
}
},
"dummytype.Waldo": {
"required": [
"First",
"Second"
],
"properties": {
"First": {
"type": "integer",
"format": "int32"
},
"Second": {
"type": "string"
}
}
},
"listtype.AtomicList": {
"required": [
"Field"
],
"properties": {
"Field": {
"type": "array",
"items": {
"type": "string"
},
"x-kubernetes-list-type": "atomic"
}
}
},
"listtype.Item": {
"required": [
"Protocol",
"Port"
],
"properties": {
"Port": {
"type": "integer",
"format": "int32"
},
"Protocol": {
"type": "string"
},
"a": {
"type": "integer",
"format": "int32"
},
"b": {
"type": "integer",
"format": "int32"
},
"c": {
"type": "integer",
"format": "int32"
}
}
},
"listtype.MapList": {
"required": [
"Field"
],
"properties": {
"Field": {
"type": "array",
"items": {
"$ref": "#/definitions/listtype.Item"
},
"x-kubernetes-list-map-keys": "port",
"x-kubernetes-list-type": "map"
}
}
},
"listtype.SetList": {
"required": [
"Field"
],
"properties": {
"Field": {
"type": "array",
"items": {
"type": "string"
},
"x-kubernetes-list-type": "set"
}
}
}
},
"responses": {
"NotFound": {
"description": "Entity not found."
}
}
}

View File

@@ -0,0 +1,14 @@
API rule violation: names_match,./testdata/dummytype,Bar,Violation
API rule violation: names_match,./testdata/dummytype,Bar,ViolationBehind
API rule violation: names_match,./testdata/dummytype,Baz,Violation
API rule violation: names_match,./testdata/dummytype,Baz,ViolationBehind
API rule violation: names_match,./testdata/dummytype,Foo,First
API rule violation: names_match,./testdata/dummytype,Foo,Second
API rule violation: names_match,./testdata/dummytype,Waldo,First
API rule violation: names_match,./testdata/dummytype,Waldo,Second
API rule violation: names_match,./testdata/listtype,AtomicList,Field
API rule violation: names_match,./testdata/listtype,Item,Port
API rule violation: names_match,./testdata/listtype,Item,Protocol
API rule violation: names_match,./testdata/listtype,MapList,Field
API rule violation: names_match,./testdata/listtype,SetList,Field
API rule violation: omitempty_match_case,./testdata/listtype,Item,C

View File

@@ -0,0 +1,7 @@
package listtype
// +k8s:openapi-gen=true
type AtomicList struct {
// +listType=atomic
Field []string
}

View File

@@ -0,0 +1,20 @@
package listtype
// +k8s:openapi-gen=true
type MapList struct {
// +listType=map
// +listMapKey=port
Field []Item
}
// +k8s:openapi-gen=true
type Item struct {
Protocol string
Port int
// +optional
A int `json:"a"`
// +optional
B int `json:"b,omitempty"`
// +optional
C int `json:"c,omitEmpty"`
}

View File

@@ -0,0 +1,7 @@
package listtype
// +k8s:openapi-gen=true
type SetList struct {
// +listType=set
Field []string
}