Commit 43dfcd7a authored by Maciej Szulik's avatar Maciej Szulik

Remove extensions/v1beta1 Job - staging client

parent cdec9452
...@@ -26,11 +26,6 @@ ...@@ -26,11 +26,6 @@
"Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e"
}, },
{ {
"ImportPath": "github.com/blang/semver",
"Comment": "v3.0.1",
"Rev": "31b736133b98f26d5e078ec9eb591666edfd091f"
},
{
"ImportPath": "github.com/coreos/go-oidc/http", "ImportPath": "github.com/coreos/go-oidc/http",
"Rev": "5644a2f50e2d2d5ba0b474bc5bc55fea1925936d" "Rev": "5644a2f50e2d2d5ba0b474bc5bc55fea1925936d"
}, },
...@@ -89,18 +84,18 @@ ...@@ -89,18 +84,18 @@
}, },
{ {
"ImportPath": "github.com/emicklei/go-restful", "ImportPath": "github.com/emicklei/go-restful",
"Comment": "v1.2-79-g89ef8af", "Comment": "v1.2-96-g09691a3",
"Rev": "89ef8af493ab468a45a42bb0d89a06fccdd2fb22" "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22"
}, },
{ {
"ImportPath": "github.com/emicklei/go-restful/log", "ImportPath": "github.com/emicklei/go-restful/log",
"Comment": "v1.2-79-g89ef8af", "Comment": "v1.2-96-g09691a3",
"Rev": "89ef8af493ab468a45a42bb0d89a06fccdd2fb22" "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22"
}, },
{ {
"ImportPath": "github.com/emicklei/go-restful/swagger", "ImportPath": "github.com/emicklei/go-restful/swagger",
"Comment": "v1.2-79-g89ef8af", "Comment": "v1.2-96-g09691a3",
"Rev": "89ef8af493ab468a45a42bb0d89a06fccdd2fb22" "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22"
}, },
{ {
"ImportPath": "github.com/ghodss/yaml", "ImportPath": "github.com/ghodss/yaml",
...@@ -146,7 +141,7 @@ ...@@ -146,7 +141,7 @@
}, },
{ {
"ImportPath": "github.com/google/gofuzz", "ImportPath": "github.com/google/gofuzz",
"Rev": "bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5" "Rev": "44d81051d367757e1c7c6a5a86423ece9afcf63c"
}, },
{ {
"ImportPath": "github.com/howeyc/gopass", "ImportPath": "github.com/howeyc/gopass",
......
The MIT License
Copyright (c) 2014 Benedikt Lang <github at benediktlang.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
semver for golang [![Build Status](https://drone.io/github.com/blang/semver/status.png)](https://drone.io/github.com/blang/semver/latest) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master)
======
semver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`.
Usage
-----
```bash
$ go get github.com/blang/semver
```
Note: Always vendor your dependencies or fix on a specific version tag.
```go
import github.com/blang/semver
v1, err := semver.Make("1.0.0-beta")
v2, err := semver.Make("2.0.0-beta")
v1.Compare(v2)
```
Also check the [GoDocs](http://godoc.org/github.com/blang/semver).
Why should I use this lib?
-----
- Fully spec compatible
- No reflection
- No regex
- Fully tested (Coverage >99%)
- Readable parsing/validation errors
- Fast (See [Benchmarks](#benchmarks))
- Only Stdlib
- Uses values instead of pointers
- Many features, see below
Features
-----
- Parsing and validation at all levels
- Comparator-like comparisons
- Compare Helper Methods
- InPlace manipulation
- Sortable (implements sort.Interface)
- database/sql compatible (sql.Scanner/Valuer)
- encoding/json compatible (json.Marshaler/Unmarshaler)
Example
-----
Have a look at full examples in [examples/main.go](examples/main.go)
```go
import github.com/blang/semver
v, err := semver.Make("0.0.1-alpha.preview+123.github")
fmt.Printf("Major: %d\n", v.Major)
fmt.Printf("Minor: %d\n", v.Minor)
fmt.Printf("Patch: %d\n", v.Patch)
fmt.Printf("Pre: %s\n", v.Pre)
fmt.Printf("Build: %s\n", v.Build)
// Prerelease versions array
if len(v.Pre) > 0 {
fmt.Println("Prerelease versions:")
for i, pre := range v.Pre {
fmt.Printf("%d: %q\n", i, pre)
}
}
// Build meta data array
if len(v.Build) > 0 {
fmt.Println("Build meta data:")
for i, build := range v.Build {
fmt.Printf("%d: %q\n", i, build)
}
}
v001, err := semver.Make("0.0.1")
// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE
v001.GT(v) == true
v.LT(v001) == true
v.GTE(v) == true
v.LTE(v) == true
// Or use v.Compare(v2) for comparisons (-1, 0, 1):
v001.Compare(v) == 1
v.Compare(v001) == -1
v.Compare(v) == 0
// Manipulate Version in place:
v.Pre[0], err = semver.NewPRVersion("beta")
if err != nil {
fmt.Printf("Error parsing pre release version: %q", err)
}
fmt.Println("\nValidate versions:")
v.Build[0] = "?"
err = v.Validate()
if err != nil {
fmt.Printf("Validation failed: %s\n", err)
}
```
Benchmarks
-----
BenchmarkParseSimple 5000000 328 ns/op 49 B/op 1 allocs/op
BenchmarkParseComplex 1000000 2105 ns/op 263 B/op 7 allocs/op
BenchmarkParseAverage 1000000 1301 ns/op 168 B/op 4 allocs/op
BenchmarkStringSimple 10000000 130 ns/op 5 B/op 1 allocs/op
BenchmarkStringLarger 5000000 280 ns/op 32 B/op 2 allocs/op
BenchmarkStringComplex 3000000 512 ns/op 80 B/op 3 allocs/op
BenchmarkStringAverage 5000000 387 ns/op 47 B/op 2 allocs/op
BenchmarkValidateSimple 500000000 7.92 ns/op 0 B/op 0 allocs/op
BenchmarkValidateComplex 2000000 923 ns/op 0 B/op 0 allocs/op
BenchmarkValidateAverage 5000000 452 ns/op 0 B/op 0 allocs/op
BenchmarkCompareSimple 100000000 11.2 ns/op 0 B/op 0 allocs/op
BenchmarkCompareComplex 50000000 40.9 ns/op 0 B/op 0 allocs/op
BenchmarkCompareAverage 50000000 43.8 ns/op 0 B/op 0 allocs/op
BenchmarkSort 5000000 436 ns/op 259 B/op 2 allocs/op
See benchmark cases at [semver_test.go](semver_test.go)
Motivation
-----
I simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like.
Contribution
-----
Feel free to make a pull request. For bigger changes create a issue first to discuss about it.
License
-----
See [LICENSE](LICENSE) file.
package semver
import (
"encoding/json"
)
// MarshalJSON implements the encoding/json.Marshaler interface.
func (v Version) MarshalJSON() ([]byte, error) {
return json.Marshal(v.String())
}
// UnmarshalJSON implements the encoding/json.Unmarshaler interface.
func (v *Version) UnmarshalJSON(data []byte) (err error) {
var versionString string
if err = json.Unmarshal(data, &versionString); err != nil {
return
}
*v, err = Parse(versionString)
return
}
package semver
import (
"errors"
"fmt"
"strconv"
"strings"
)
const (
numbers string = "0123456789"
alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"
alphanum = alphas + numbers
)
// SpecVersion is the latest fully supported spec version of semver
var SpecVersion = Version{
Major: 2,
Minor: 0,
Patch: 0,
}
// Version represents a semver compatible version
type Version struct {
Major uint64
Minor uint64
Patch uint64
Pre []PRVersion
Build []string //No Precendence
}
// Version to string
func (v Version) String() string {
b := make([]byte, 0, 5)
b = strconv.AppendUint(b, v.Major, 10)
b = append(b, '.')
b = strconv.AppendUint(b, v.Minor, 10)
b = append(b, '.')
b = strconv.AppendUint(b, v.Patch, 10)
if len(v.Pre) > 0 {
b = append(b, '-')
b = append(b, v.Pre[0].String()...)
for _, pre := range v.Pre[1:] {
b = append(b, '.')
b = append(b, pre.String()...)
}
}
if len(v.Build) > 0 {
b = append(b, '+')
b = append(b, v.Build[0]...)
for _, build := range v.Build[1:] {
b = append(b, '.')
b = append(b, build...)
}
}
return string(b)
}
// Equals checks if v is equal to o.
func (v Version) Equals(o Version) bool {
return (v.Compare(o) == 0)
}
// EQ checks if v is equal to o.
func (v Version) EQ(o Version) bool {
return (v.Compare(o) == 0)
}
// NE checks if v is not equal to o.
func (v Version) NE(o Version) bool {
return (v.Compare(o) != 0)
}
// GT checks if v is greater than o.
func (v Version) GT(o Version) bool {
return (v.Compare(o) == 1)
}
// GTE checks if v is greater than or equal to o.
func (v Version) GTE(o Version) bool {
return (v.Compare(o) >= 0)
}
// GE checks if v is greater than or equal to o.
func (v Version) GE(o Version) bool {
return (v.Compare(o) >= 0)
}
// LT checks if v is less than o.
func (v Version) LT(o Version) bool {
return (v.Compare(o) == -1)
}
// LTE checks if v is less than or equal to o.
func (v Version) LTE(o Version) bool {
return (v.Compare(o) <= 0)
}
// LE checks if v is less than or equal to o.
func (v Version) LE(o Version) bool {
return (v.Compare(o) <= 0)
}
// Compare compares Versions v to o:
// -1 == v is less than o
// 0 == v is equal to o
// 1 == v is greater than o
func (v Version) Compare(o Version) int {
if v.Major != o.Major {
if v.Major > o.Major {
return 1
}
return -1
}
if v.Minor != o.Minor {
if v.Minor > o.Minor {
return 1
}
return -1
}
if v.Patch != o.Patch {
if v.Patch > o.Patch {
return 1
}
return -1
}
// Quick comparison if a version has no prerelease versions
if len(v.Pre) == 0 && len(o.Pre) == 0 {
return 0
} else if len(v.Pre) == 0 && len(o.Pre) > 0 {
return 1
} else if len(v.Pre) > 0 && len(o.Pre) == 0 {
return -1
}
i := 0
for ; i < len(v.Pre) && i < len(o.Pre); i++ {
if comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 {
continue
} else if comp == 1 {
return 1
} else {
return -1
}
}
// If all pr versions are the equal but one has further prversion, this one greater
if i == len(v.Pre) && i == len(o.Pre) {
return 0
} else if i == len(v.Pre) && i < len(o.Pre) {
return -1
} else {
return 1
}
}
// Validate validates v and returns error in case
func (v Version) Validate() error {
// Major, Minor, Patch already validated using uint64
for _, pre := range v.Pre {
if !pre.IsNum { //Numeric prerelease versions already uint64
if len(pre.VersionStr) == 0 {
return fmt.Errorf("Prerelease can not be empty %q", pre.VersionStr)
}
if !containsOnly(pre.VersionStr, alphanum) {
return fmt.Errorf("Invalid character(s) found in prerelease %q", pre.VersionStr)
}
}
}
for _, build := range v.Build {
if len(build) == 0 {
return fmt.Errorf("Build meta data can not be empty %q", build)
}
if !containsOnly(build, alphanum) {
return fmt.Errorf("Invalid character(s) found in build meta data %q", build)
}
}
return nil
}
// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error
func New(s string) (vp *Version, err error) {
v, err := Parse(s)
vp = &v
return
}
// Make is an alias for Parse, parses version string and returns a validated Version or error
func Make(s string) (Version, error) {
return Parse(s)
}
// Parse parses version string and returns a validated Version or error
func Parse(s string) (Version, error) {
if len(s) == 0 {
return Version{}, errors.New("Version string empty")
}
// Split into major.minor.(patch+pr+meta)
parts := strings.SplitN(s, ".", 3)
if len(parts) != 3 {
return Version{}, errors.New("No Major.Minor.Patch elements found")
}
// Major
if !containsOnly(parts[0], numbers) {
return Version{}, fmt.Errorf("Invalid character(s) found in major number %q", parts[0])
}
if hasLeadingZeroes(parts[0]) {
return Version{}, fmt.Errorf("Major number must not contain leading zeroes %q", parts[0])
}
major, err := strconv.ParseUint(parts[0], 10, 64)
if err != nil {
return Version{}, err
}
// Minor
if !containsOnly(parts[1], numbers) {
return Version{}, fmt.Errorf("Invalid character(s) found in minor number %q", parts[1])
}
if hasLeadingZeroes(parts[1]) {
return Version{}, fmt.Errorf("Minor number must not contain leading zeroes %q", parts[1])
}
minor, err := strconv.ParseUint(parts[1], 10, 64)
if err != nil {
return Version{}, err
}
v := Version{}
v.Major = major
v.Minor = minor
var build, prerelease []string
patchStr := parts[2]
if buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 {
build = strings.Split(patchStr[buildIndex+1:], ".")
patchStr = patchStr[:buildIndex]
}
if preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 {
prerelease = strings.Split(patchStr[preIndex+1:], ".")
patchStr = patchStr[:preIndex]
}
if !containsOnly(patchStr, numbers) {
return Version{}, fmt.Errorf("Invalid character(s) found in patch number %q", patchStr)
}
if hasLeadingZeroes(patchStr) {
return Version{}, fmt.Errorf("Patch number must not contain leading zeroes %q", patchStr)
}
patch, err := strconv.ParseUint(patchStr, 10, 64)
if err != nil {
return Version{}, err
}
v.Patch = patch
// Prerelease
for _, prstr := range prerelease {
parsedPR, err := NewPRVersion(prstr)
if err != nil {
return Version{}, err
}
v.Pre = append(v.Pre, parsedPR)
}
// Build meta data
for _, str := range build {
if len(str) == 0 {
return Version{}, errors.New("Build meta data is empty")
}
if !containsOnly(str, alphanum) {
return Version{}, fmt.Errorf("Invalid character(s) found in build meta data %q", str)
}
v.Build = append(v.Build, str)
}
return v, nil
}
// MustParse is like Parse but panics if the version cannot be parsed.
func MustParse(s string) Version {
v, err := Parse(s)
if err != nil {
panic(`semver: Parse(` + s + `): ` + err.Error())
}
return v
}
// PRVersion represents a PreRelease Version
type PRVersion struct {
VersionStr string
VersionNum uint64
IsNum bool
}
// NewPRVersion creates a new valid prerelease version
func NewPRVersion(s string) (PRVersion, error) {
if len(s) == 0 {
return PRVersion{}, errors.New("Prerelease is empty")
}
v := PRVersion{}
if containsOnly(s, numbers) {
if hasLeadingZeroes(s) {
return PRVersion{}, fmt.Errorf("Numeric PreRelease version must not contain leading zeroes %q", s)
}
num, err := strconv.ParseUint(s, 10, 64)
// Might never be hit, but just in case
if err != nil {
return PRVersion{}, err
}
v.VersionNum = num
v.IsNum = true
} else if containsOnly(s, alphanum) {
v.VersionStr = s
v.IsNum = false
} else {
return PRVersion{}, fmt.Errorf("Invalid character(s) found in prerelease %q", s)
}
return v, nil
}
// IsNumeric checks if prerelease-version is numeric
func (v PRVersion) IsNumeric() bool {
return v.IsNum
}
// Compare compares two PreRelease Versions v and o:
// -1 == v is less than o
// 0 == v is equal to o
// 1 == v is greater than o
func (v PRVersion) Compare(o PRVersion) int {
if v.IsNum && !o.IsNum {
return -1
} else if !v.IsNum && o.IsNum {
return 1
} else if v.IsNum && o.IsNum {
if v.VersionNum == o.VersionNum {
return 0
} else if v.VersionNum > o.VersionNum {
return 1
} else {
return -1
}
} else { // both are Alphas
if v.VersionStr == o.VersionStr {
return 0
} else if v.VersionStr > o.VersionStr {
return 1
} else {
return -1
}
}
}
// PreRelease version to string
func (v PRVersion) String() string {
if v.IsNum {
return strconv.FormatUint(v.VersionNum, 10)
}
return v.VersionStr
}
func containsOnly(s string, set string) bool {
return strings.IndexFunc(s, func(r rune) bool {
return !strings.ContainsRune(set, r)
}) == -1
}
func hasLeadingZeroes(s string) bool {
return len(s) > 1 && s[0] == '0'
}
// NewBuildVersion creates a new valid build version
func NewBuildVersion(s string) (string, error) {
if len(s) == 0 {
return "", errors.New("Buildversion is empty")
}
if !containsOnly(s, alphanum) {
return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s)
}
return s, nil
}
package semver
import (
"sort"
)
// Versions represents multiple versions.
type Versions []Version
// Len returns length of version collection
func (s Versions) Len() int {
return len(s)
}
// Swap swaps two versions inside the collection by its indices
func (s Versions) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
// Less checks if version at index i is less than version at index j
func (s Versions) Less(i, j int) bool {
return s[i].LT(s[j])
}
// Sort sorts a slice of versions
func Sort(versions []Version) {
sort.Sort(Versions(versions))
}
package semver
import (
"database/sql/driver"
"fmt"
)
// Scan implements the database/sql.Scanner interface.
func (v *Version) Scan(src interface{}) (err error) {
var str string
switch src := src.(type) {
case string:
str = src
case []byte:
str = string(src)
default:
return fmt.Errorf("Version.Scan: cannot convert %T to string.", src)
}
if t, err := Parse(str); err == nil {
*v = t
}
return
}
// Value implements the database/sql/driver.Valuer interface.
func (v Version) Value() (driver.Value, error) {
return v.String(), nil
}
Change history of go-restful Change history of go-restful
= =
2016-11-26
- Default change! now use CurlyRouter (was RouterJSR311)
- Default change! no more caching of request content
- Default change! do not recover from panics
2016-09-22
- fix the DefaultRequestContentType feature
2016-02-14 2016-02-14
- take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response - take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response
- add constructors for custom entity accessors for xml and json - add constructors for custom entity accessors for xml and json
......
...@@ -25,10 +25,10 @@ type Container struct { ...@@ -25,10 +25,10 @@ type Container struct {
ServeMux *http.ServeMux ServeMux *http.ServeMux
isRegisteredOnRoot bool isRegisteredOnRoot bool
containerFilters []FilterFunction containerFilters []FilterFunction
doNotRecover bool // default is false doNotRecover bool // default is true
recoverHandleFunc RecoverHandleFunction recoverHandleFunc RecoverHandleFunction
serviceErrorHandleFunc ServiceErrorHandleFunction serviceErrorHandleFunc ServiceErrorHandleFunction
router RouteSelector // default is a RouterJSR311, CurlyRouter is the faster alternative router RouteSelector // default is a CurlyRouter (RouterJSR311 is a slower alternative)
contentEncodingEnabled bool // default is false contentEncodingEnabled bool // default is false
} }
...@@ -39,10 +39,10 @@ func NewContainer() *Container { ...@@ -39,10 +39,10 @@ func NewContainer() *Container {
ServeMux: http.NewServeMux(), ServeMux: http.NewServeMux(),
isRegisteredOnRoot: false, isRegisteredOnRoot: false,
containerFilters: []FilterFunction{}, containerFilters: []FilterFunction{},
doNotRecover: false, doNotRecover: true,
recoverHandleFunc: logStackOnRecover, recoverHandleFunc: logStackOnRecover,
serviceErrorHandleFunc: writeServiceError, serviceErrorHandleFunc: writeServiceError,
router: RouterJSR311{}, router: CurlyRouter{},
contentEncodingEnabled: false} contentEncodingEnabled: false}
} }
...@@ -69,7 +69,7 @@ func (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) { ...@@ -69,7 +69,7 @@ func (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) {
// DoNotRecover controls whether panics will be caught to return HTTP 500. // DoNotRecover controls whether panics will be caught to return HTTP 500.
// If set to true, Route functions are responsible for handling any error situation. // If set to true, Route functions are responsible for handling any error situation.
// Default value is false = recover from panics. This has performance implications. // Default value is true.
func (c *Container) DoNotRecover(doNot bool) { func (c *Container) DoNotRecover(doNot bool) {
c.doNotRecover = doNot c.doNotRecover = doNot
} }
......
...@@ -108,11 +108,13 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque ...@@ -108,11 +108,13 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque
return (matched && err == nil), false return (matched && err == nil), false
} }
var jsr311Router = RouterJSR311{}
// detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type // detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type
// headers of the Request. See also RouterJSR311 in jsr311.go // headers of the Request. See also RouterJSR311 in jsr311.go
func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) { func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) {
// tracing is done inside detectRoute // tracing is done inside detectRoute
return RouterJSR311{}.detectRoute(candidateRoutes.routes(), httpRequest) return jsr311Router.detectRoute(candidateRoutes.routes(), httpRequest)
} }
// detectWebService returns the best matching webService given the list of path tokens. // detectWebService returns the best matching webService given the list of path tokens.
......
...@@ -145,22 +145,11 @@ Performance options ...@@ -145,22 +145,11 @@ Performance options
This package has several options that affect the performance of your service. It is important to understand them and how you can change it. This package has several options that affect the performance of your service. It is important to understand them and how you can change it.
restful.DefaultContainer.Router(CurlyRouter{}) restful.DefaultContainer.DoNotRecover(false)
The default router is the RouterJSR311 which is an implementation of its spec (http://jsr311.java.net/nonav/releases/1.1/spec/spec.html).
However, it uses regular expressions for all its routes which, depending on your usecase, may consume a significant amount of time.
The CurlyRouter implementation is more lightweight that also allows you to use wildcards and expressions, but only if needed.
restful.DefaultContainer.DoNotRecover(true)
DoNotRecover controls whether panics will be caught to return HTTP 500. DoNotRecover controls whether panics will be caught to return HTTP 500.
If set to true, Route functions are responsible for handling any error situation. If set to false, the container will recover from panics.
Default value is false; it will recover from panics. This has performance implications. Default value is true
restful.SetCacheReadEntity(false)
SetCacheReadEntity controls whether the response data ([]byte) is cached such that ReadEntity is repeatable.
If you expect to read large amounts of payload data, and you do not use this feature, you should set it to false.
restful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20)) restful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20))
......
...@@ -24,3 +24,12 @@ func (f *FilterChain) ProcessFilter(request *Request, response *Response) { ...@@ -24,3 +24,12 @@ func (f *FilterChain) ProcessFilter(request *Request, response *Response) {
// FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction // FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction
type FilterFunction func(*Request, *Response, *FilterChain) type FilterFunction func(*Request, *Response, *FilterChain)
// NoBrowserCacheFilter is a filter function to set HTTP headers that disable browser caching
// See examples/restful-no-cache-filter.go for usage
func NoBrowserCacheFilter(req *Request, resp *Response, chain *FilterChain) {
resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1.
resp.Header().Set("Pragma", "no-cache") // HTTP 1.0.
resp.Header().Set("Expires", "0") // Proxies.
chain.ProcessFilter(req, resp)
}
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
var defaultRequestContentType string var defaultRequestContentType string
var doCacheReadEntityBytes = true var doCacheReadEntityBytes = false
// Request is a wrapper for a http Request that provides convenience methods // Request is a wrapper for a http Request that provides convenience methods
type Request struct { type Request struct {
...@@ -107,10 +107,15 @@ func (r *Request) ReadEntity(entityPointer interface{}) (err error) { ...@@ -107,10 +107,15 @@ func (r *Request) ReadEntity(entityPointer interface{}) (err error) {
r.Request.Body = zlibReader r.Request.Body = zlibReader
} }
// lookup the EntityReader // lookup the EntityReader, use defaultRequestContentType if needed and provided
entityReader, ok := entityAccessRegistry.accessorAt(contentType) entityReader, ok := entityAccessRegistry.accessorAt(contentType)
if !ok { if !ok {
return NewError(http.StatusBadRequest, "Unable to unmarshal content of type:"+contentType) if len(defaultRequestContentType) != 0 {
entityReader, ok = entityAccessRegistry.accessorAt(defaultRequestContentType)
}
if !ok {
return NewError(http.StatusBadRequest, "Unable to unmarshal content of type:"+contentType)
}
} }
return entityReader.Read(r, entityPointer) return entityReader.Read(r, entityPointer)
} }
......
...@@ -2,6 +2,7 @@ package swagger ...@@ -2,6 +2,7 @@ package swagger
import ( import (
"net/http" "net/http"
"reflect"
"github.com/emicklei/go-restful" "github.com/emicklei/go-restful"
) )
...@@ -9,8 +10,13 @@ import ( ...@@ -9,8 +10,13 @@ import (
// PostBuildDeclarationMapFunc can be used to modify the api declaration map. // PostBuildDeclarationMapFunc can be used to modify the api declaration map.
type PostBuildDeclarationMapFunc func(apiDeclarationMap *ApiDeclarationList) type PostBuildDeclarationMapFunc func(apiDeclarationMap *ApiDeclarationList)
// MapSchemaFormatFunc can be used to modify typeName at definition time.
type MapSchemaFormatFunc func(typeName string) string type MapSchemaFormatFunc func(typeName string) string
// MapModelTypeNameFunc can be used to return the desired typeName for a given
// type. It will return false if the default name should be used.
type MapModelTypeNameFunc func(t reflect.Type) (string, bool)
type Config struct { type Config struct {
// url where the services are available, e.g. http://localhost:8080 // url where the services are available, e.g. http://localhost:8080
// if left empty then the basePath of Swagger is taken from the actual request // if left empty then the basePath of Swagger is taken from the actual request
...@@ -33,6 +39,8 @@ type Config struct { ...@@ -33,6 +39,8 @@ type Config struct {
PostBuildHandler PostBuildDeclarationMapFunc PostBuildHandler PostBuildDeclarationMapFunc
// Swagger global info struct // Swagger global info struct
Info Info Info Info
// [optional] If set, model builder should call this handler to get addition typename-to-swagger-format-field convertion. // [optional] If set, model builder should call this handler to get addition typename-to-swagger-format-field conversion.
SchemaFormatHandler MapSchemaFormatFunc SchemaFormatHandler MapSchemaFormatFunc
// [optional] If set, model builder should call this handler to retrieve the name for a given type.
ModelTypeNameHandler MapModelTypeNameFunc
} }
...@@ -43,6 +43,12 @@ func (b modelBuilder) addModelFrom(sample interface{}) { ...@@ -43,6 +43,12 @@ func (b modelBuilder) addModelFrom(sample interface{}) {
} }
func (b modelBuilder) addModel(st reflect.Type, nameOverride string) *Model { func (b modelBuilder) addModel(st reflect.Type, nameOverride string) *Model {
// Turn pointers into simpler types so further checks are
// correct.
if st.Kind() == reflect.Ptr {
st = st.Elem()
}
modelName := b.keyFrom(st) modelName := b.keyFrom(st)
if nameOverride != "" { if nameOverride != "" {
modelName = nameOverride modelName = nameOverride
...@@ -137,6 +143,11 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod ...@@ -137,6 +143,11 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod
return "", "", prop return "", "", prop
} }
if field.Name == "XMLName" && field.Type.String() == "xml.Name" {
// property is metadata for the xml.Name attribute, can be skipped
return "", "", prop
}
if tag := field.Tag.Get("modelDescription"); tag != "" { if tag := field.Tag.Get("modelDescription"); tag != "" {
modelDescription = tag modelDescription = tag
} }
...@@ -155,7 +166,7 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod ...@@ -155,7 +166,7 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod
prop.Type = &pType prop.Type = &pType
} }
if prop.Format == "" { if prop.Format == "" {
prop.Format = b.jsonSchemaFormat(fieldType.String()) prop.Format = b.jsonSchemaFormat(b.keyFrom(fieldType))
} }
return jsonName, modelDescription, prop return jsonName, modelDescription, prop
} }
...@@ -192,13 +203,14 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod ...@@ -192,13 +203,14 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod
return jsonName, modelDescription, prop return jsonName, modelDescription, prop
} }
if b.isPrimitiveType(fieldType.String()) { fieldTypeName := b.keyFrom(fieldType)
mapped := b.jsonSchemaType(fieldType.String()) if b.isPrimitiveType(fieldTypeName) {
mapped := b.jsonSchemaType(fieldTypeName)
prop.Type = &mapped prop.Type = &mapped
prop.Format = b.jsonSchemaFormat(fieldType.String()) prop.Format = b.jsonSchemaFormat(fieldTypeName)
return jsonName, modelDescription, prop return jsonName, modelDescription, prop
} }
modelType := fieldType.String() modelType := b.keyFrom(fieldType)
prop.Ref = &modelType prop.Ref = &modelType
if fieldType.Name() == "" { // override type of anonymous structs if fieldType.Name() == "" { // override type of anonymous structs
...@@ -272,7 +284,7 @@ func (b modelBuilder) buildStructTypeProperty(field reflect.StructField, jsonNam ...@@ -272,7 +284,7 @@ func (b modelBuilder) buildStructTypeProperty(field reflect.StructField, jsonNam
} }
// simple struct // simple struct
b.addModel(fieldType, "") b.addModel(fieldType, "")
var pType = fieldType.String() var pType = b.keyFrom(fieldType)
prop.Ref = &pType prop.Ref = &pType
return jsonName, prop return jsonName, prop
} }
...@@ -336,10 +348,11 @@ func (b modelBuilder) buildPointerTypeProperty(field reflect.StructField, jsonNa ...@@ -336,10 +348,11 @@ func (b modelBuilder) buildPointerTypeProperty(field reflect.StructField, jsonNa
} }
} else { } else {
// non-array, pointer type // non-array, pointer type
var pType = b.jsonSchemaType(fieldType.String()[1:]) // no star, include pkg path fieldTypeName := b.keyFrom(fieldType.Elem())
if b.isPrimitiveType(fieldType.String()[1:]) { var pType = b.jsonSchemaType(fieldTypeName) // no star, include pkg path
if b.isPrimitiveType(fieldTypeName) {
prop.Type = &pType prop.Type = &pType
prop.Format = b.jsonSchemaFormat(fieldType.String()[1:]) prop.Format = b.jsonSchemaFormat(fieldTypeName)
return jsonName, prop return jsonName, prop
} }
prop.Ref = &pType prop.Ref = &pType
...@@ -355,7 +368,7 @@ func (b modelBuilder) buildPointerTypeProperty(field reflect.StructField, jsonNa ...@@ -355,7 +368,7 @@ func (b modelBuilder) buildPointerTypeProperty(field reflect.StructField, jsonNa
func (b modelBuilder) getElementTypeName(modelName, jsonName string, t reflect.Type) string { func (b modelBuilder) getElementTypeName(modelName, jsonName string, t reflect.Type) string {
if t.Kind() == reflect.Ptr { if t.Kind() == reflect.Ptr {
return t.String()[1:] t = t.Elem()
} }
if t.Name() == "" { if t.Name() == "" {
return modelName + "." + jsonName return modelName + "." + jsonName
...@@ -365,6 +378,11 @@ func (b modelBuilder) getElementTypeName(modelName, jsonName string, t reflect.T ...@@ -365,6 +378,11 @@ func (b modelBuilder) getElementTypeName(modelName, jsonName string, t reflect.T
func (b modelBuilder) keyFrom(st reflect.Type) string { func (b modelBuilder) keyFrom(st reflect.Type) string {
key := st.String() key := st.String()
if b.Config != nil && b.Config.ModelTypeNameHandler != nil {
if name, ok := b.Config.ModelTypeNameHandler(st); ok {
key = name
}
}
if len(st.Name()) == 0 { // unnamed type if len(st.Name()) == 0 { // unnamed type
// Swagger UI has special meaning for [ // Swagger UI has special meaning for [
key = strings.Replace(key, "[]", "||", -1) key = strings.Replace(key, "[]", "||", -1)
......
...@@ -33,6 +33,21 @@ func (prop *ModelProperty) setMaximum(field reflect.StructField) { ...@@ -33,6 +33,21 @@ func (prop *ModelProperty) setMaximum(field reflect.StructField) {
func (prop *ModelProperty) setType(field reflect.StructField) { func (prop *ModelProperty) setType(field reflect.StructField) {
if tag := field.Tag.Get("type"); tag != "" { if tag := field.Tag.Get("type"); tag != "" {
// Check if the first two characters of the type tag are
// intended to emulate slice/array behaviour.
//
// If type is intended to be a slice/array then add the
// overriden type to the array item instead of the main property
if len(tag) > 2 && tag[0:2] == "[]" {
pType := "array"
prop.Type = &pType
prop.Items = new(Item)
iType := tag[2:]
prop.Items.Type = &iType
return
}
prop.Type = &tag prop.Type = &tag
} }
} }
......
...@@ -277,7 +277,7 @@ func composeResponseMessages(route restful.Route, decl *ApiDeclaration, config * ...@@ -277,7 +277,7 @@ func composeResponseMessages(route restful.Route, decl *ApiDeclaration, config *
} }
// sort by code // sort by code
codes := sort.IntSlice{} codes := sort.IntSlice{}
for code, _ := range route.ResponseErrors { for code := range route.ResponseErrors {
codes = append(codes, code) codes = append(codes, code)
} }
codes.Sort() codes.Sort()
......
...@@ -14,21 +14,21 @@ This is useful for testing: ...@@ -14,21 +14,21 @@ This is useful for testing:
Import with ```import "github.com/google/gofuzz"``` Import with ```import "github.com/google/gofuzz"```
You can use it on single variables: You can use it on single variables:
``` ```go
f := fuzz.New() f := fuzz.New()
var myInt int var myInt int
f.Fuzz(&myInt) // myInt gets a random value. f.Fuzz(&myInt) // myInt gets a random value.
``` ```
You can use it on maps: You can use it on maps:
``` ```go
f := fuzz.New().NilChance(0).NumElements(1, 1) f := fuzz.New().NilChance(0).NumElements(1, 1)
var myMap map[ComplexKeyType]string var myMap map[ComplexKeyType]string
f.Fuzz(&myMap) // myMap will have exactly one element. f.Fuzz(&myMap) // myMap will have exactly one element.
``` ```
Customize the chance of getting a nil pointer: Customize the chance of getting a nil pointer:
``` ```go
f := fuzz.New().NilChance(.5) f := fuzz.New().NilChance(.5)
var fancyStruct struct { var fancyStruct struct {
A, B, C, D *string A, B, C, D *string
...@@ -37,7 +37,7 @@ f.Fuzz(&fancyStruct) // About half the pointers should be set. ...@@ -37,7 +37,7 @@ f.Fuzz(&fancyStruct) // About half the pointers should be set.
``` ```
You can even customize the randomization completely if needed: You can even customize the randomization completely if needed:
``` ```go
type MyEnum string type MyEnum string
const ( const (
A MyEnum = "A" A MyEnum = "A"
......
...@@ -129,7 +129,7 @@ func (f *Fuzzer) genElementCount() int { ...@@ -129,7 +129,7 @@ func (f *Fuzzer) genElementCount() int {
if f.minElements == f.maxElements { if f.minElements == f.maxElements {
return f.minElements return f.minElements
} }
return f.minElements + f.r.Intn(f.maxElements-f.minElements) return f.minElements + f.r.Intn(f.maxElements-f.minElements+1)
} }
func (f *Fuzzer) genShouldFill() bool { func (f *Fuzzer) genShouldFill() bool {
...@@ -229,12 +229,19 @@ func (f *Fuzzer) doFuzz(v reflect.Value, flags uint64) { ...@@ -229,12 +229,19 @@ func (f *Fuzzer) doFuzz(v reflect.Value, flags uint64) {
return return
} }
v.Set(reflect.Zero(v.Type())) v.Set(reflect.Zero(v.Type()))
case reflect.Array:
if f.genShouldFill() {
n := v.Len()
for i := 0; i < n; i++ {
f.doFuzz(v.Index(i), 0)
}
return
}
v.Set(reflect.Zero(v.Type()))
case reflect.Struct: case reflect.Struct:
for i := 0; i < v.NumField(); i++ { for i := 0; i < v.NumField(); i++ {
f.doFuzz(v.Field(i), 0) f.doFuzz(v.Field(i), 0)
} }
case reflect.Array:
fallthrough
case reflect.Chan: case reflect.Chan:
fallthrough fallthrough
case reflect.Func: case reflect.Func:
......
...@@ -299,102 +299,102 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { ...@@ -299,102 +299,102 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
} }
var clientset Clientset var cs Clientset
var err error var err error
clientset.CoreV1Client, err = v1core.NewForConfig(&configShallowCopy) cs.CoreV1Client, err = v1core.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.AppsV1beta1Client, err = v1beta1apps.NewForConfig(&configShallowCopy) cs.AppsV1beta1Client, err = v1beta1apps.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.AuthenticationV1beta1Client, err = v1beta1authentication.NewForConfig(&configShallowCopy) cs.AuthenticationV1beta1Client, err = v1beta1authentication.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.AuthorizationV1beta1Client, err = v1beta1authorization.NewForConfig(&configShallowCopy) cs.AuthorizationV1beta1Client, err = v1beta1authorization.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.AutoscalingV1Client, err = v1autoscaling.NewForConfig(&configShallowCopy) cs.AutoscalingV1Client, err = v1autoscaling.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.BatchV1Client, err = v1batch.NewForConfig(&configShallowCopy) cs.BatchV1Client, err = v1batch.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.BatchV2alpha1Client, err = v2alpha1batch.NewForConfig(&configShallowCopy) cs.BatchV2alpha1Client, err = v2alpha1batch.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.CertificatesV1alpha1Client, err = v1alpha1certificates.NewForConfig(&configShallowCopy) cs.CertificatesV1alpha1Client, err = v1alpha1certificates.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.ExtensionsV1beta1Client, err = v1beta1extensions.NewForConfig(&configShallowCopy) cs.ExtensionsV1beta1Client, err = v1beta1extensions.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.PolicyV1beta1Client, err = v1beta1policy.NewForConfig(&configShallowCopy) cs.PolicyV1beta1Client, err = v1beta1policy.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.RbacV1alpha1Client, err = v1alpha1rbac.NewForConfig(&configShallowCopy) cs.RbacV1alpha1Client, err = v1alpha1rbac.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.StorageV1beta1Client, err = v1beta1storage.NewForConfig(&configShallowCopy) cs.StorageV1beta1Client, err = v1beta1storage.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil { if err != nil {
glog.Errorf("failed to create the DiscoveryClient: %v", err) glog.Errorf("failed to create the DiscoveryClient: %v", err)
return nil, err return nil, err
} }
return &clientset, nil return &cs, nil
} }
// NewForConfigOrDie creates a new Clientset for the given config and // NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config. // panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset { func NewForConfigOrDie(c *rest.Config) *Clientset {
var clientset Clientset var cs Clientset
clientset.CoreV1Client = v1core.NewForConfigOrDie(c) cs.CoreV1Client = v1core.NewForConfigOrDie(c)
clientset.AppsV1beta1Client = v1beta1apps.NewForConfigOrDie(c) cs.AppsV1beta1Client = v1beta1apps.NewForConfigOrDie(c)
clientset.AuthenticationV1beta1Client = v1beta1authentication.NewForConfigOrDie(c) cs.AuthenticationV1beta1Client = v1beta1authentication.NewForConfigOrDie(c)
clientset.AuthorizationV1beta1Client = v1beta1authorization.NewForConfigOrDie(c) cs.AuthorizationV1beta1Client = v1beta1authorization.NewForConfigOrDie(c)
clientset.AutoscalingV1Client = v1autoscaling.NewForConfigOrDie(c) cs.AutoscalingV1Client = v1autoscaling.NewForConfigOrDie(c)
clientset.BatchV1Client = v1batch.NewForConfigOrDie(c) cs.BatchV1Client = v1batch.NewForConfigOrDie(c)
clientset.BatchV2alpha1Client = v2alpha1batch.NewForConfigOrDie(c) cs.BatchV2alpha1Client = v2alpha1batch.NewForConfigOrDie(c)
clientset.CertificatesV1alpha1Client = v1alpha1certificates.NewForConfigOrDie(c) cs.CertificatesV1alpha1Client = v1alpha1certificates.NewForConfigOrDie(c)
clientset.ExtensionsV1beta1Client = v1beta1extensions.NewForConfigOrDie(c) cs.ExtensionsV1beta1Client = v1beta1extensions.NewForConfigOrDie(c)
clientset.PolicyV1beta1Client = v1beta1policy.NewForConfigOrDie(c) cs.PolicyV1beta1Client = v1beta1policy.NewForConfigOrDie(c)
clientset.RbacV1alpha1Client = v1alpha1rbac.NewForConfigOrDie(c) cs.RbacV1alpha1Client = v1alpha1rbac.NewForConfigOrDie(c)
clientset.StorageV1beta1Client = v1beta1storage.NewForConfigOrDie(c) cs.StorageV1beta1Client = v1beta1storage.NewForConfigOrDie(c)
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &clientset return &cs
} }
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset { func New(c rest.Interface) *Clientset {
var clientset Clientset var cs Clientset
clientset.CoreV1Client = v1core.New(c) cs.CoreV1Client = v1core.New(c)
clientset.AppsV1beta1Client = v1beta1apps.New(c) cs.AppsV1beta1Client = v1beta1apps.New(c)
clientset.AuthenticationV1beta1Client = v1beta1authentication.New(c) cs.AuthenticationV1beta1Client = v1beta1authentication.New(c)
clientset.AuthorizationV1beta1Client = v1beta1authorization.New(c) cs.AuthorizationV1beta1Client = v1beta1authorization.New(c)
clientset.AutoscalingV1Client = v1autoscaling.New(c) cs.AutoscalingV1Client = v1autoscaling.New(c)
clientset.BatchV1Client = v1batch.New(c) cs.BatchV1Client = v1batch.New(c)
clientset.BatchV2alpha1Client = v2alpha1batch.New(c) cs.BatchV2alpha1Client = v2alpha1batch.New(c)
clientset.CertificatesV1alpha1Client = v1alpha1certificates.New(c) cs.CertificatesV1alpha1Client = v1alpha1certificates.New(c)
clientset.ExtensionsV1beta1Client = v1beta1extensions.New(c) cs.ExtensionsV1beta1Client = v1beta1extensions.New(c)
clientset.PolicyV1beta1Client = v1beta1policy.New(c) cs.PolicyV1beta1Client = v1beta1policy.New(c)
clientset.RbacV1alpha1Client = v1alpha1rbac.New(c) cs.RbacV1alpha1Client = v1alpha1rbac.New(c)
clientset.StorageV1beta1Client = v1beta1storage.New(c) cs.StorageV1beta1Client = v1beta1storage.New(c)
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &clientset return &cs
} }
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated clientset. // This package has the automatically generated clientset.
package kubernetes package kubernetes
...@@ -19,7 +19,7 @@ package fake ...@@ -19,7 +19,7 @@ package fake
import ( import (
"k8s.io/client-go/discovery" "k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake" fakediscovery "k8s.io/client-go/discovery/fake"
clientset "k8s.io/client-go/kubernetes" kubernetes "k8s.io/client-go/kubernetes"
v1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1" v1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
fakev1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake" fakev1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake"
v1beta1authentication "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" v1beta1authentication "k8s.io/client-go/kubernetes/typed/authentication/v1beta1"
...@@ -71,7 +71,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { ...@@ -71,7 +71,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
return &Clientset{fakePtr} return &Clientset{fakePtr}
} }
// Clientset implements clientset.Interface. Meant to be embedded into a // Clientset implements kubernetes.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method // struct to get a default implementation. This makes faking out just the method
// you want to test easier. // you want to test easier.
type Clientset struct { type Clientset struct {
...@@ -82,7 +82,7 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { ...@@ -82,7 +82,7 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return &fakediscovery.FakeDiscovery{Fake: &c.Fake} return &fakediscovery.FakeDiscovery{Fake: &c.Fake}
} }
var _ clientset.Interface = &Clientset{} var _ kubernetes.Interface = &Clientset{}
// CoreV1 retrieves the CoreV1Client // CoreV1 retrieves the CoreV1Client
func (c *Clientset) CoreV1() v1core.CoreV1Interface { func (c *Clientset) CoreV1() v1core.CoreV1Interface {
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated fake clientset. // This package has the automatically generated fake clientset.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1beta1 package v1beta1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1beta1 package v1beta1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1beta1 package v1beta1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1 package v1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1 package v1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v2alpha1 package v2alpha1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1alpha1 package v1alpha1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1 package v1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1beta1 package v1beta1
...@@ -30,7 +30,6 @@ type ExtensionsV1beta1Interface interface { ...@@ -30,7 +30,6 @@ type ExtensionsV1beta1Interface interface {
DaemonSetsGetter DaemonSetsGetter
DeploymentsGetter DeploymentsGetter
IngressesGetter IngressesGetter
JobsGetter
PodSecurityPoliciesGetter PodSecurityPoliciesGetter
ReplicaSetsGetter ReplicaSetsGetter
ScalesGetter ScalesGetter
...@@ -54,10 +53,6 @@ func (c *ExtensionsV1beta1Client) Ingresses(namespace string) IngressInterface { ...@@ -54,10 +53,6 @@ func (c *ExtensionsV1beta1Client) Ingresses(namespace string) IngressInterface {
return newIngresses(c, namespace) return newIngresses(c, namespace)
} }
func (c *ExtensionsV1beta1Client) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}
func (c *ExtensionsV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface { func (c *ExtensionsV1beta1Client) PodSecurityPolicies() PodSecurityPolicyInterface {
return newPodSecurityPolicies(c) return newPodSecurityPolicies(c)
} }
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -38,10 +38,6 @@ func (c *FakeExtensionsV1beta1) Ingresses(namespace string) v1beta1.IngressInter ...@@ -38,10 +38,6 @@ func (c *FakeExtensionsV1beta1) Ingresses(namespace string) v1beta1.IngressInter
return &FakeIngresses{c, namespace} return &FakeIngresses{c, namespace}
} }
func (c *FakeExtensionsV1beta1) Jobs(namespace string) v1beta1.JobInterface {
return &FakeJobs{c, namespace}
}
func (c *FakeExtensionsV1beta1) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface { func (c *FakeExtensionsV1beta1) PodSecurityPolicies() v1beta1.PodSecurityPolicyInterface {
return &FakePodSecurityPolicies{c} return &FakePodSecurityPolicies{c}
} }
......
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1"
meta_v1 "k8s.io/client-go/pkg/apis/meta/v1"
labels "k8s.io/client-go/pkg/labels"
schema "k8s.io/client-go/pkg/runtime/schema"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeJobs implements JobInterface
type FakeJobs struct {
Fake *FakeExtensionsV1beta1
ns string
}
var jobsResource = schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "jobs"}
func (c *FakeJobs) Create(job *v1beta1.Job) (result *v1beta1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1beta1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Job), err
}
func (c *FakeJobs) Update(job *v1beta1.Job) (result *v1beta1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1beta1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Job), err
}
func (c *FakeJobs) UpdateStatus(job *v1beta1.Job) (*v1beta1.Job, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1beta1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Job), err
}
func (c *FakeJobs) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &v1beta1.Job{})
return err
}
func (c *FakeJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.JobList{})
return err
}
func (c *FakeJobs) Get(name string, options meta_v1.GetOptions) (result *v1beta1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1beta1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Job), err
}
func (c *FakeJobs) List(opts v1.ListOptions) (result *v1beta1.JobList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(jobsResource, c.ns, opts), &v1beta1.JobList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.JobList{}
for _, item := range obj.(*v1beta1.JobList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v1beta1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Job), err
}
...@@ -20,8 +20,6 @@ type DaemonSetExpansion interface{} ...@@ -20,8 +20,6 @@ type DaemonSetExpansion interface{}
type IngressExpansion interface{} type IngressExpansion interface{}
type JobExpansion interface{}
type PodSecurityPolicyExpansion interface{} type PodSecurityPolicyExpansion interface{}
type ReplicaSetExpansion interface{} type ReplicaSetExpansion interface{}
......
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1"
meta_v1 "k8s.io/client-go/pkg/apis/meta/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// JobsGetter has a method to return a JobInterface.
// A group's client should implement this interface.
type JobsGetter interface {
Jobs(namespace string) JobInterface
}
// JobInterface has methods to work with Job resources.
type JobInterface interface {
Create(*v1beta1.Job) (*v1beta1.Job, error)
Update(*v1beta1.Job) (*v1beta1.Job, error)
UpdateStatus(*v1beta1.Job) (*v1beta1.Job, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1beta1.Job, error)
List(opts v1.ListOptions) (*v1beta1.JobList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Job, err error)
JobExpansion
}
// jobs implements JobInterface
type jobs struct {
client rest.Interface
ns string
}
// newJobs returns a Jobs
func newJobs(c *ExtensionsV1beta1Client, namespace string) *jobs {
return &jobs{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Create(job *v1beta1.Job) (result *v1beta1.Job, err error) {
result = &v1beta1.Job{}
err = c.client.Post().
Namespace(c.ns).
Resource("jobs").
Body(job).
Do().
Into(result)
return
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Update(job *v1beta1.Job) (result *v1beta1.Job, err error) {
result = &v1beta1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
Body(job).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus().
func (c *jobs) UpdateStatus(job *v1beta1.Job) (result *v1beta1.Job, err error) {
result = &v1beta1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
SubResource("status").
Body(job).
Do().
Into(result)
return
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&listOptions, api.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *jobs) Get(name string, options meta_v1.GetOptions) (result *v1beta1.Job, err error) {
result = &v1beta1.Job{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
Name(name).
VersionedParams(&options, api.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(opts v1.ListOptions) (result *v1beta1.JobList, err error) {
result = &v1beta1.JobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, api.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, api.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched job.
func (c *jobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Job, err error) {
result = &v1beta1.Job{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("jobs").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1beta1 package v1beta1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1alpha1 package v1alpha1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1beta1 package v1beta1
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1] // This package is generated by client-gen with arguments: --clientset-name=clientset --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients. // Package fake has the automatically generated clients.
package fake package fake
...@@ -308,7 +308,8 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr ...@@ -308,7 +308,8 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
message = "the server has asked for the client to provide credentials" message = "the server has asked for the client to provide credentials"
case http.StatusForbidden: case http.StatusForbidden:
reason = metav1.StatusReasonForbidden reason = metav1.StatusReasonForbidden
message = "the server does not allow access to the requested resource" // the server message has details about who is trying to perform what action. Keep its message.
message = serverMessage
case http.StatusMethodNotAllowed: case http.StatusMethodNotAllowed:
reason = metav1.StatusReasonMethodNotAllowed reason = metav1.StatusReasonMethodNotAllowed
message = "the server does not allow this method on the requested resource" message = "the server does not allow this method on the requested resource"
......
...@@ -163,9 +163,9 @@ func (m PriorityRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) ...@@ -163,9 +163,9 @@ func (m PriorityRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string)
if len(versions) > 0 { if len(versions) > 0 {
priorities = make([]schema.GroupVersionKind, 0, len(m.KindPriority)+len(versions)) priorities = make([]schema.GroupVersionKind, 0, len(m.KindPriority)+len(versions))
for _, version := range versions { for _, version := range versions {
gv, err := schema.ParseGroupVersion(version) gv := schema.GroupVersion{
if err != nil { Version: version,
return nil, err Group: gk.Group,
} }
priorities = append(priorities, gv.WithKind(AnyKind)) priorities = append(priorities, gv.WithKind(AnyKind))
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2517,6 +2517,10 @@ message PodSpec { ...@@ -2517,6 +2517,10 @@ message PodSpec {
// If not specified, the pod will not have a domainname at all. // If not specified, the pod will not have a domainname at all.
// +optional // +optional
optional string subdomain = 17; optional string subdomain = 17;
// If specified, the pod's scheduling constraints
// +optional
optional Affinity affinity = 18;
} }
// PodStatus represents information about the status of a pod. Status may trail the actual // PodStatus represents information about the status of a pod. Status may trail the actual
...@@ -2560,6 +2564,12 @@ message PodStatus { ...@@ -2560,6 +2564,12 @@ message PodStatus {
// More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses // More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses
// +optional // +optional
repeated ContainerStatus containerStatuses = 8; repeated ContainerStatus containerStatuses = 8;
// The Quality of Service (QOS) classification assigned to the pod based on resource requirements
// See PodQOSClass type for available QOS classes
// More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md
// +optional
optional string qosClass = 9;
} }
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2108,6 +2108,7 @@ type PodSpec struct { ...@@ -2108,6 +2108,7 @@ type PodSpec struct {
// +optional // +optional
Subdomain string `json:"subdomain,omitempty" protobuf:"bytes,17,opt,name=subdomain"` Subdomain string `json:"subdomain,omitempty" protobuf:"bytes,17,opt,name=subdomain"`
// If specified, the pod's scheduling constraints // If specified, the pod's scheduling constraints
// +optional
Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"` Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"`
} }
...@@ -2155,6 +2156,18 @@ type PodSecurityContext struct { ...@@ -2155,6 +2156,18 @@ type PodSecurityContext struct {
FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"` FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"`
} }
// PodQOSClass defines the supported qos classes of Pods.
type PodQOSClass string
const (
// PodQOSGuaranteed is the Guaranteed qos class.
PodQOSGuaranteed PodQOSClass = "Guaranteed"
// PodQOSBurstable is the Burstable qos class.
PodQOSBurstable PodQOSClass = "Burstable"
// PodQOSBestEffort is the BestEffort qos class.
PodQOSBestEffort PodQOSClass = "BestEffort"
)
// PodStatus represents information about the status of a pod. Status may trail the actual // PodStatus represents information about the status of a pod. Status may trail the actual
// state of a system. // state of a system.
type PodStatus struct { type PodStatus struct {
...@@ -2198,6 +2211,11 @@ type PodStatus struct { ...@@ -2198,6 +2211,11 @@ type PodStatus struct {
// More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses // More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses
// +optional // +optional
ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"` ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"`
// The Quality of Service (QOS) classification assigned to the pod based on resource requirements
// See PodQOSClass type for available QOS classes
// More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md
// +optional
QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"`
} }
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
...@@ -3105,6 +3123,7 @@ type NodeList struct { ...@@ -3105,6 +3123,7 @@ type NodeList struct {
Items []Node `json:"items" protobuf:"bytes,2,rep,name=items"` Items []Node `json:"items" protobuf:"bytes,2,rep,name=items"`
} }
// FinalizerName is the name identifying a finalizer during namespace lifecycle.
type FinalizerName string type FinalizerName string
// These are internal finalizer values to Kubernetes, must be qualified name unless defined here // These are internal finalizer values to Kubernetes, must be qualified name unless defined here
......
...@@ -1274,6 +1274,7 @@ var map_PodSpec = map[string]string{ ...@@ -1274,6 +1274,7 @@ var map_PodSpec = map[string]string{
"imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod", "imagePullSecrets": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod",
"hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", "hostname": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.",
"subdomain": "If specified, the fully qualified Pod hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the pod will not have a domainname at all.", "subdomain": "If specified, the fully qualified Pod hostname will be \"<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>\". If not specified, the pod will not have a domainname at all.",
"affinity": "If specified, the pod's scheduling constraints",
} }
func (PodSpec) SwaggerDoc() map[string]string { func (PodSpec) SwaggerDoc() map[string]string {
...@@ -1290,6 +1291,7 @@ var map_PodStatus = map[string]string{ ...@@ -1290,6 +1291,7 @@ var map_PodStatus = map[string]string{
"podIP": "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", "podIP": "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.",
"startTime": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", "startTime": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.",
"containerStatuses": "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses", "containerStatuses": "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses",
"qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md",
} }
func (PodStatus) SwaggerDoc() map[string]string { func (PodStatus) SwaggerDoc() map[string]string {
......
...@@ -3064,6 +3064,7 @@ func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conv ...@@ -3064,6 +3064,7 @@ func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conv
out.ImagePullSecrets = *(*[]api.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) out.ImagePullSecrets = *(*[]api.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
out.Hostname = in.Hostname out.Hostname = in.Hostname
out.Subdomain = in.Subdomain out.Subdomain = in.Subdomain
out.Affinity = (*api.Affinity)(unsafe.Pointer(in.Affinity))
return nil return nil
} }
...@@ -3100,6 +3101,7 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv ...@@ -3100,6 +3101,7 @@ func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conv
out.ImagePullSecrets = *(*[]LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) out.ImagePullSecrets = *(*[]LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
out.Hostname = in.Hostname out.Hostname = in.Hostname
out.Subdomain = in.Subdomain out.Subdomain = in.Subdomain
out.Affinity = (*Affinity)(unsafe.Pointer(in.Affinity))
return nil return nil
} }
...@@ -3113,6 +3115,7 @@ func autoConvert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus ...@@ -3113,6 +3115,7 @@ func autoConvert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus
out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime)) out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime))
out.InitContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses)) out.InitContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses))
out.ContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses)) out.ContainerStatuses = *(*[]api.ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses))
out.QOSClass = api.PodQOSClass(in.QOSClass)
return nil return nil
} }
...@@ -3128,6 +3131,7 @@ func autoConvert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus ...@@ -3128,6 +3131,7 @@ func autoConvert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus
out.HostIP = in.HostIP out.HostIP = in.HostIP
out.PodIP = in.PodIP out.PodIP = in.PodIP
out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime)) out.StartTime = (*meta_v1.Time)(unsafe.Pointer(in.StartTime))
out.QOSClass = PodQOSClass(in.QOSClass)
out.InitContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses)) out.InitContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses))
out.ContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses)) out.ContainerStatuses = *(*[]ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses))
return nil return nil
......
...@@ -2660,6 +2660,15 @@ func DeepCopy_v1_PodSpec(in interface{}, out interface{}, c *conversion.Cloner) ...@@ -2660,6 +2660,15 @@ func DeepCopy_v1_PodSpec(in interface{}, out interface{}, c *conversion.Cloner)
} }
out.Hostname = in.Hostname out.Hostname = in.Hostname
out.Subdomain = in.Subdomain out.Subdomain = in.Subdomain
if in.Affinity != nil {
in, out := &in.Affinity, &out.Affinity
*out = new(Affinity)
if err := DeepCopy_v1_Affinity(*in, *out, c); err != nil {
return err
}
} else {
out.Affinity = nil
}
return nil return nil
} }
} }
...@@ -2713,6 +2722,7 @@ func DeepCopy_v1_PodStatus(in interface{}, out interface{}, c *conversion.Cloner ...@@ -2713,6 +2722,7 @@ func DeepCopy_v1_PodStatus(in interface{}, out interface{}, c *conversion.Cloner
} else { } else {
out.ContainerStatuses = nil out.ContainerStatuses = nil
} }
out.QOSClass = in.QOSClass
return nil return nil
} }
} }
......
...@@ -35,25 +35,27 @@ func IsValidPathSegmentName(name string) []string { ...@@ -35,25 +35,27 @@ func IsValidPathSegmentName(name string) []string {
} }
} }
var errors []string
for _, illegalContent := range NameMayNotContain { for _, illegalContent := range NameMayNotContain {
if strings.Contains(name, illegalContent) { if strings.Contains(name, illegalContent) {
return []string{fmt.Sprintf(`may not contain '%s'`, illegalContent)} errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent))
} }
} }
return nil return errors
} }
// IsValidPathSegmentPrefix validates the name can be used as a prefix for a name which will be encoded as a path segment // IsValidPathSegmentPrefix validates the name can be used as a prefix for a name which will be encoded as a path segment
// It does not check for exact matches with disallowed names, since an arbitrary suffix might make the name valid // It does not check for exact matches with disallowed names, since an arbitrary suffix might make the name valid
func IsValidPathSegmentPrefix(name string) []string { func IsValidPathSegmentPrefix(name string) []string {
var errors []string
for _, illegalContent := range NameMayNotContain { for _, illegalContent := range NameMayNotContain {
if strings.Contains(name, illegalContent) { if strings.Contains(name, illegalContent) {
return []string{fmt.Sprintf(`may not contain '%s'`, illegalContent)} errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent))
} }
} }
return nil return errors
} }
// ValidatePathSegmentName validates the name can be safely encoded as a path segment // ValidatePathSegmentName validates the name can be safely encoded as a path segment
......
...@@ -2699,6 +2699,15 @@ func DeepCopy_api_PodSpec(in interface{}, out interface{}, c *conversion.Cloner) ...@@ -2699,6 +2699,15 @@ func DeepCopy_api_PodSpec(in interface{}, out interface{}, c *conversion.Cloner)
} }
out.Hostname = in.Hostname out.Hostname = in.Hostname
out.Subdomain = in.Subdomain out.Subdomain = in.Subdomain
if in.Affinity != nil {
in, out := &in.Affinity, &out.Affinity
*out = new(Affinity)
if err := DeepCopy_api_Affinity(*in, *out, c); err != nil {
return err
}
} else {
out.Affinity = nil
}
return nil return nil
} }
} }
...@@ -2730,6 +2739,7 @@ func DeepCopy_api_PodStatus(in interface{}, out interface{}, c *conversion.Clone ...@@ -2730,6 +2739,7 @@ func DeepCopy_api_PodStatus(in interface{}, out interface{}, c *conversion.Clone
} else { } else {
out.StartTime = nil out.StartTime = nil
} }
out.QOSClass = in.QOSClass
if in.InitContainerStatuses != nil { if in.InitContainerStatuses != nil {
in, out := &in.InitContainerStatuses, &out.InitContainerStatuses in, out := &in.InitContainerStatuses, &out.InitContainerStatuses
*out = make([]ContainerStatus, len(*in)) *out = make([]ContainerStatus, len(*in))
......
...@@ -32,12 +32,6 @@ type GroupMeta struct { ...@@ -32,12 +32,6 @@ type GroupMeta struct {
// GroupVersions is Group + all versions in that group. // GroupVersions is Group + all versions in that group.
GroupVersions []schema.GroupVersion GroupVersions []schema.GroupVersion
// Codec is the default codec for serializing output that should use
// the preferred version. Use this Codec when writing to
// disk, a data store that is not dynamically versioned, or in tests.
// This codec can decode any object that the schema is aware of.
Codec runtime.Codec
// SelfLinker can set or get the SelfLink field of all API types. // SelfLinker can set or get the SelfLink field of all API types.
// TODO: when versioning changes, make this part of each API definition. // TODO: when versioning changes, make this part of each API definition.
// TODO(lavalamp): Combine SelfLinker & ResourceVersioner interfaces, force all uses // TODO(lavalamp): Combine SelfLinker & ResourceVersioner interfaces, force all uses
......
...@@ -15,7 +15,5 @@ limitations under the License. ...@@ -15,7 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +groupName=apps.k8s.io
package apps package apps
...@@ -30,18 +30,18 @@ import ( ...@@ -30,18 +30,18 @@ import (
// The StatefulSet guarantees that a given network identity will always // The StatefulSet guarantees that a given network identity will always
// map to the same storage identity. // map to the same storage identity.
type StatefulSet struct { type StatefulSet struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec defines the desired identities of pods in this set. // Spec defines the desired identities of pods in this set.
// +optional // +optional
Spec StatefulSetSpec `json:"spec,omitempty"` Spec StatefulSetSpec
// Status is the current status of Pods in this StatefulSet. This data // Status is the current status of Pods in this StatefulSet. This data
// may be out of date by some window of time. // may be out of date by some window of time.
// +optional // +optional
Status StatefulSetStatus `json:"status,omitempty"` Status StatefulSetStatus
} }
// A StatefulSetSpec is the specification of a StatefulSet. // A StatefulSetSpec is the specification of a StatefulSet.
...@@ -52,19 +52,19 @@ type StatefulSetSpec struct { ...@@ -52,19 +52,19 @@ type StatefulSetSpec struct {
// If unspecified, defaults to 1. // If unspecified, defaults to 1.
// TODO: Consider a rename of this field. // TODO: Consider a rename of this field.
// +optional // +optional
Replicas int32 `json:"replicas,omitempty"` Replicas int32
// Selector is a label query over pods that should match the replica count. // Selector is a label query over pods that should match the replica count.
// If empty, defaulted to labels on the pod template. // If empty, defaulted to labels on the pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *metav1.LabelSelector `json:"selector,omitempty"` Selector *metav1.LabelSelector
// Template is the object that describes the pod that will be created if // Template is the object that describes the pod that will be created if
// insufficient replicas are detected. Each pod stamped out by the StatefulSet // insufficient replicas are detected. Each pod stamped out by the StatefulSet
// will fulfill this Template, but have a unique identity from the rest // will fulfill this Template, but have a unique identity from the rest
// of the StatefulSet. // of the StatefulSet.
Template api.PodTemplateSpec `json:"template"` Template api.PodTemplateSpec
// VolumeClaimTemplates is a list of claims that pods are allowed to reference. // VolumeClaimTemplates is a list of claims that pods are allowed to reference.
// The StatefulSet controller is responsible for mapping network identities to // The StatefulSet controller is responsible for mapping network identities to
...@@ -74,30 +74,30 @@ type StatefulSetSpec struct { ...@@ -74,30 +74,30 @@ type StatefulSetSpec struct {
// any volumes in the template, with the same name. // any volumes in the template, with the same name.
// TODO: Define the behavior if a claim already exists with the same name. // TODO: Define the behavior if a claim already exists with the same name.
// +optional // +optional
VolumeClaimTemplates []api.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` VolumeClaimTemplates []api.PersistentVolumeClaim
// ServiceName is the name of the service that governs this StatefulSet. // ServiceName is the name of the service that governs this StatefulSet.
// This service must exist before the StatefulSet, and is responsible for // This service must exist before the StatefulSet, and is responsible for
// the network identity of the set. Pods get DNS/hostnames that follow the // the network identity of the set. Pods get DNS/hostnames that follow the
// pattern: pod-specific-string.serviceName.default.svc.cluster.local // pattern: pod-specific-string.serviceName.default.svc.cluster.local
// where "pod-specific-string" is managed by the StatefulSet controller. // where "pod-specific-string" is managed by the StatefulSet controller.
ServiceName string `json:"serviceName"` ServiceName string
} }
// StatefulSetStatus represents the current state of a StatefulSet. // StatefulSetStatus represents the current state of a StatefulSet.
type StatefulSetStatus struct { type StatefulSetStatus struct {
// most recent generation observed by this autoscaler. // most recent generation observed by this autoscaler.
// +optional // +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty"` ObservedGeneration *int64
// Replicas is the number of actual replicas. // Replicas is the number of actual replicas.
Replicas int32 `json:"replicas"` Replicas int32
} }
// StatefulSetList is a collection of StatefulSets. // StatefulSetList is a collection of StatefulSets.
type StatefulSetList struct { type StatefulSetList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
Items []StatefulSet `json:"items"` Items []StatefulSet
} }
...@@ -18,6 +18,5 @@ limitations under the License. ...@@ -18,6 +18,5 @@ limitations under the License.
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps
// +k8s:openapi-gen=true // +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta
// +groupName=apps.k8s.io
package v1beta1 package v1beta1
...@@ -1577,7 +1577,7 @@ func (x codecSelfer1234) decSliceStatefulSet(v *[]StatefulSet, d *codec1978.Deco ...@@ -1577,7 +1577,7 @@ func (x codecSelfer1234) decSliceStatefulSet(v *[]StatefulSet, d *codec1978.Deco
yyrg131 := len(yyv131) > 0 yyrg131 := len(yyv131) > 0
yyv2131 := yyv131 yyv2131 := yyv131
yyrl131, yyrt131 = z.DecInferLen(yyl131, z.DecBasicHandle().MaxInitLen, 800) yyrl131, yyrt131 = z.DecInferLen(yyl131, z.DecBasicHandle().MaxInitLen, 808)
if yyrt131 { if yyrt131 {
if yyrl131 <= cap(yyv131) { if yyrl131 <= cap(yyv131) {
yyv131 = yyv131[:yyrl131] yyv131 = yyv131[:yyrl131]
......
...@@ -16,5 +16,4 @@ limitations under the License. ...@@ -16,5 +16,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +groupName=authentication.k8s.io // +groupName=authentication.k8s.io
// +k8s:openapi-gen=true
package authentication package authentication
...@@ -15,7 +15,5 @@ limitations under the License. ...@@ -15,7 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +groupName=authorization.k8s.io // +groupName=authorization.k8s.io
package authorization package authorization
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,6 +15,5 @@ limitations under the License. ...@@ -15,6 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
package autoscaling package autoscaling
...@@ -23,113 +23,113 @@ import ( ...@@ -23,113 +23,113 @@ import (
// Scale represents a scaling request for a resource. // Scale represents a scaling request for a resource.
type Scale struct { type Scale struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata. // Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. // defines the behavior of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional // +optional
Spec ScaleSpec `json:"spec,omitempty"` Spec ScaleSpec
// current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only. // current status of the scale. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. Read-only.
// +optional // +optional
Status ScaleStatus `json:"status,omitempty"` Status ScaleStatus
} }
// ScaleSpec describes the attributes of a scale subresource. // ScaleSpec describes the attributes of a scale subresource.
type ScaleSpec struct { type ScaleSpec struct {
// desired number of instances for the scaled object. // desired number of instances for the scaled object.
// +optional // +optional
Replicas int32 `json:"replicas,omitempty"` Replicas int32
} }
// ScaleStatus represents the current status of a scale subresource. // ScaleStatus represents the current status of a scale subresource.
type ScaleStatus struct { type ScaleStatus struct {
// actual number of observed instances of the scaled object. // actual number of observed instances of the scaled object.
Replicas int32 `json:"replicas"` Replicas int32
// label query over pods that should match the replicas count. This is same // label query over pods that should match the replicas count. This is same
// as the label selector but in the string format to avoid introspection // as the label selector but in the string format to avoid introspection
// by clients. The string will be in the same format as the query-param syntax. // by clients. The string will be in the same format as the query-param syntax.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector string `json:"selector,omitempty"` Selector string
} }
// CrossVersionObjectReference contains enough information to let you identify the referred resource. // CrossVersionObjectReference contains enough information to let you identify the referred resource.
type CrossVersionObjectReference struct { type CrossVersionObjectReference struct {
// Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" // Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` Kind string
// Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
Name string `json:"name" protobuf:"bytes,2,opt,name=name"` Name string
// API version of the referent // API version of the referent
// +optional // +optional
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` APIVersion string
} }
// specification of a horizontal pod autoscaler. // specification of a horizontal pod autoscaler.
type HorizontalPodAutoscalerSpec struct { type HorizontalPodAutoscalerSpec struct {
// reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
// and will set the desired number of pods by using its Scale subresource. // and will set the desired number of pods by using its Scale subresource.
ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef"` ScaleTargetRef CrossVersionObjectReference
// lower limit for the number of pods that can be set by the autoscaler, default 1. // lower limit for the number of pods that can be set by the autoscaler, default 1.
// +optional // +optional
MinReplicas *int32 `json:"minReplicas,omitempty"` MinReplicas *int32
// upper limit for the number of pods that can be set by the autoscaler. It cannot be smaller than MinReplicas. // upper limit for the number of pods that can be set by the autoscaler. It cannot be smaller than MinReplicas.
MaxReplicas int32 `json:"maxReplicas"` MaxReplicas int32
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods; // target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified the default autoscaling policy will be used. // if not specified the default autoscaling policy will be used.
// +optional // +optional
TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"` TargetCPUUtilizationPercentage *int32
} }
// current status of a horizontal pod autoscaler // current status of a horizontal pod autoscaler
type HorizontalPodAutoscalerStatus struct { type HorizontalPodAutoscalerStatus struct {
// most recent generation observed by this autoscaler. // most recent generation observed by this autoscaler.
// +optional // +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty"` ObservedGeneration *int64
// last time the HorizontalPodAutoscaler scaled the number of pods; // last time the HorizontalPodAutoscaler scaled the number of pods;
// used by the autoscaler to control how often the number of pods is changed. // used by the autoscaler to control how often the number of pods is changed.
// +optional // +optional
LastScaleTime *metav1.Time `json:"lastScaleTime,omitempty"` LastScaleTime *metav1.Time
// current number of replicas of pods managed by this autoscaler. // current number of replicas of pods managed by this autoscaler.
CurrentReplicas int32 `json:"currentReplicas"` CurrentReplicas int32
// desired number of replicas of pods managed by this autoscaler. // desired number of replicas of pods managed by this autoscaler.
DesiredReplicas int32 `json:"desiredReplicas"` DesiredReplicas int32
// current average CPU utilization over all pods, represented as a percentage of requested CPU, // current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU. // e.g. 70 means that an average pod is using now 70% of its requested CPU.
// +optional // +optional
CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"` CurrentCPUUtilizationPercentage *int32
} }
// +genclient=true // +genclient=true
// configuration of a horizontal pod autoscaler. // configuration of a horizontal pod autoscaler.
type HorizontalPodAutoscaler struct { type HorizontalPodAutoscaler struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status. // behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.
// +optional // +optional
Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty"` Spec HorizontalPodAutoscalerSpec
// current information about the autoscaler. // current information about the autoscaler.
// +optional // +optional
Status HorizontalPodAutoscalerStatus `json:"status,omitempty"` Status HorizontalPodAutoscalerStatus
} }
// list of horizontal pod autoscaler objects. // list of horizontal pod autoscaler objects.
type HorizontalPodAutoscalerList struct { type HorizontalPodAutoscalerList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// list of horizontal pod autoscaler objects. // list of horizontal pod autoscaler objects.
Items []HorizontalPodAutoscaler `json:"items"` Items []HorizontalPodAutoscaler
} }
...@@ -15,6 +15,5 @@ limitations under the License. ...@@ -15,6 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
package batch package batch
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -25,47 +25,47 @@ import ( ...@@ -25,47 +25,47 @@ import (
// Job represents the configuration of a single job. // Job represents the configuration of a single job.
type Job struct { type Job struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec is a structure defining the expected behavior of a job. // Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Spec JobSpec `json:"spec,omitempty"` Spec JobSpec
// Status is a structure describing current status of a job. // Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Status JobStatus `json:"status,omitempty"` Status JobStatus
} }
// JobList is a collection of jobs. // JobList is a collection of jobs.
type JobList struct { type JobList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// Items is the list of Job. // Items is the list of Job.
Items []Job `json:"items"` Items []Job
} }
// JobTemplate describes a template for creating copies of a predefined pod. // JobTemplate describes a template for creating copies of a predefined pod.
type JobTemplate struct { type JobTemplate struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Template defines jobs that will be created from this template // Template defines jobs that will be created from this template
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Template JobTemplateSpec `json:"template,omitempty"` Template JobTemplateSpec
} }
// JobTemplateSpec describes the data a Job should have when created from a template // JobTemplateSpec describes the data a Job should have when created from a template
...@@ -73,12 +73,12 @@ type JobTemplateSpec struct { ...@@ -73,12 +73,12 @@ type JobTemplateSpec struct {
// Standard object's metadata of the jobs created from this template. // Standard object's metadata of the jobs created from this template.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Specification of the desired behavior of the job. // Specification of the desired behavior of the job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Spec JobSpec `json:"spec,omitempty"` Spec JobSpec
} }
// JobSpec describes how the job execution will look like. // JobSpec describes how the job execution will look like.
...@@ -89,7 +89,7 @@ type JobSpec struct { ...@@ -89,7 +89,7 @@ type JobSpec struct {
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), // be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism. // i.e. when the work left to do is less than max parallelism.
// +optional // +optional
Parallelism *int32 `json:"parallelism,omitempty"` Parallelism *int32
// Completions specifies the desired number of successfully finished pods the // Completions specifies the desired number of successfully finished pods the
// job should be run with. Setting to nil means that the success of any // job should be run with. Setting to nil means that the success of any
...@@ -97,17 +97,17 @@ type JobSpec struct { ...@@ -97,17 +97,17 @@ type JobSpec struct {
// value. Setting to 1 means that parallelism is limited to 1 and the success of that // value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job. // pod signals the success of the job.
// +optional // +optional
Completions *int32 `json:"completions,omitempty"` Completions *int32
// Optional duration in seconds relative to the startTime that the job may be active // Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer // before the system tries to terminate it; value must be positive integer
// +optional // +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` ActiveDeadlineSeconds *int64
// Selector is a label query over pods that should match the pod count. // Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// +optional // +optional
Selector *metav1.LabelSelector `json:"selector,omitempty"` Selector *metav1.LabelSelector
// ManualSelector controls generation of pod labels and pod selectors. // ManualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing. // Leave `manualSelector` unset unless you are certain what you are doing.
...@@ -119,11 +119,11 @@ type JobSpec struct { ...@@ -119,11 +119,11 @@ type JobSpec struct {
// `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
// API. // API.
// +optional // +optional
ManualSelector *bool `json:"manualSelector,omitempty"` ManualSelector *bool
// Template is the object that describes the pod that will be created when // Template is the object that describes the pod that will be created when
// executing a job. // executing a job.
Template api.PodTemplateSpec `json:"template"` Template api.PodTemplateSpec
} }
// JobStatus represents the current state of a Job. // JobStatus represents the current state of a Job.
...@@ -131,31 +131,31 @@ type JobStatus struct { ...@@ -131,31 +131,31 @@ type JobStatus struct {
// Conditions represent the latest available observations of an object's current state. // Conditions represent the latest available observations of an object's current state.
// +optional // +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` Conditions []JobCondition
// StartTime represents time when the job was acknowledged by the Job Manager. // StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations. // It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC. // It is represented in RFC3339 form and is in UTC.
// +optional // +optional
StartTime *metav1.Time `json:"startTime,omitempty"` StartTime *metav1.Time
// CompletionTime represents time when the job was completed. It is not guaranteed to // CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations. // be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC. // It is represented in RFC3339 form and is in UTC.
// +optional // +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"` CompletionTime *metav1.Time
// Active is the number of actively running pods. // Active is the number of actively running pods.
// +optional // +optional
Active int32 `json:"active,omitempty"` Active int32
// Succeeded is the number of pods which reached Phase Succeeded. // Succeeded is the number of pods which reached Phase Succeeded.
// +optional // +optional
Succeeded int32 `json:"succeeded,omitempty"` Succeeded int32
// Failed is the number of pods which reached Phase Failed. // Failed is the number of pods which reached Phase Failed.
// +optional // +optional
Failed int32 `json:"failed,omitempty"` Failed int32
} }
type JobConditionType string type JobConditionType string
...@@ -171,79 +171,79 @@ const ( ...@@ -171,79 +171,79 @@ const (
// JobCondition describes current state of a job. // JobCondition describes current state of a job.
type JobCondition struct { type JobCondition struct {
// Type of job condition, Complete or Failed. // Type of job condition, Complete or Failed.
Type JobConditionType `json:"type"` Type JobConditionType
// Status of the condition, one of True, False, Unknown. // Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus `json:"status"` Status api.ConditionStatus
// Last time the condition was checked. // Last time the condition was checked.
// +optional // +optional
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` LastProbeTime metav1.Time
// Last time the condition transit from one status to another. // Last time the condition transit from one status to another.
// +optional // +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` LastTransitionTime metav1.Time
// (brief) reason for the condition's last transition. // (brief) reason for the condition's last transition.
// +optional // +optional
Reason string `json:"reason,omitempty"` Reason string
// Human readable message indicating details about last transition. // Human readable message indicating details about last transition.
// +optional // +optional
Message string `json:"message,omitempty"` Message string
} }
// +genclient=true // +genclient=true
// CronJob represents the configuration of a single cron job. // CronJob represents the configuration of a single cron job.
type CronJob struct { type CronJob struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// Spec is a structure defining the expected behavior of a job, including the schedule. // Spec is a structure defining the expected behavior of a job, including the schedule.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Spec CronJobSpec `json:"spec,omitempty"` Spec CronJobSpec
// Status is a structure describing current status of a job. // Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional // +optional
Status CronJobStatus `json:"status,omitempty"` Status CronJobStatus
} }
// CronJobList is a collection of cron jobs. // CronJobList is a collection of cron jobs.
type CronJobList struct { type CronJobList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// Items is the list of CronJob. // Items is the list of CronJob.
Items []CronJob `json:"items"` Items []CronJob
} }
// CronJobSpec describes how the job execution will look like and when it will actually run. // CronJobSpec describes how the job execution will look like and when it will actually run.
type CronJobSpec struct { type CronJobSpec struct {
// Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. // Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
Schedule string `json:"schedule"` Schedule string
// Optional deadline in seconds for starting the job if it misses scheduled // Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones. // time for any reason. Missed jobs executions will be counted as failed ones.
// +optional // +optional
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"` StartingDeadlineSeconds *int64
// ConcurrencyPolicy specifies how to treat concurrent executions of a Job. // ConcurrencyPolicy specifies how to treat concurrent executions of a Job.
// +optional // +optional
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"` ConcurrencyPolicy ConcurrencyPolicy
// Suspend flag tells the controller to suspend subsequent executions, it does // Suspend flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions. Defaults to false. // not apply to already started executions. Defaults to false.
// +optional // +optional
Suspend *bool `json:"suspend,omitempty"` Suspend *bool
// JobTemplate is the object that describes the job that will be created when // JobTemplate is the object that describes the job that will be created when
// executing a CronJob. // executing a CronJob.
JobTemplate JobTemplateSpec `json:"jobTemplate"` JobTemplate JobTemplateSpec
} }
// ConcurrencyPolicy describes how the job will be handled. // ConcurrencyPolicy describes how the job will be handled.
...@@ -268,9 +268,9 @@ const ( ...@@ -268,9 +268,9 @@ const (
type CronJobStatus struct { type CronJobStatus struct {
// Active holds pointers to currently running jobs. // Active holds pointers to currently running jobs.
// +optional // +optional
Active []api.ObjectReference `json:"active,omitempty"` Active []api.ObjectReference
// LastScheduleTime keeps information of when was the last time the job was successfully scheduled. // LastScheduleTime keeps information of when was the last time the job was successfully scheduled.
// +optional // +optional
LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` LastScheduleTime *metav1.Time
} }
...@@ -2352,7 +2352,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { ...@@ -2352,7 +2352,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg206 := len(yyv206) > 0 yyrg206 := len(yyv206) > 0
yyv2206 := yyv206 yyv2206 := yyv206
yyrl206, yyrt206 = z.DecInferLen(yyl206, z.DecBasicHandle().MaxInitLen, 824) yyrl206, yyrt206 = z.DecInferLen(yyl206, z.DecBasicHandle().MaxInitLen, 832)
if yyrt206 { if yyrt206 {
if yyrl206 <= cap(yyv206) { if yyrl206 <= cap(yyv206) {
yyv206 = yyv206[:yyrl206] yyv206 = yyv206[:yyrl206]
......
...@@ -4247,7 +4247,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) { ...@@ -4247,7 +4247,7 @@ func (x codecSelfer1234) decSliceJob(v *[]Job, d *codec1978.Decoder) {
yyrg370 := len(yyv370) > 0 yyrg370 := len(yyv370) > 0
yyv2370 := yyv370 yyv2370 := yyv370
yyrl370, yyrt370 = z.DecInferLen(yyl370, z.DecBasicHandle().MaxInitLen, 824) yyrl370, yyrt370 = z.DecInferLen(yyl370, z.DecBasicHandle().MaxInitLen, 832)
if yyrt370 { if yyrt370 {
if yyrl370 <= cap(yyv370) { if yyrl370 <= cap(yyv370) {
yyv370 = yyv370[:yyrl370] yyv370 = yyv370[:yyrl370]
...@@ -4479,7 +4479,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) { ...@@ -4479,7 +4479,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) {
yyrg382 := len(yyv382) > 0 yyrg382 := len(yyv382) > 0
yyv2382 := yyv382 yyv2382 := yyv382
yyrl382, yyrt382 = z.DecInferLen(yyl382, z.DecBasicHandle().MaxInitLen, 1072) yyrl382, yyrt382 = z.DecInferLen(yyl382, z.DecBasicHandle().MaxInitLen, 1080)
if yyrt382 { if yyrt382 {
if yyrl382 <= cap(yyv382) { if yyrl382 <= cap(yyv382) {
yyv382 = yyv382[:yyrl382] yyv382 = yyv382[:yyrl382]
......
...@@ -15,7 +15,5 @@ limitations under the License. ...@@ -15,7 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +groupName=certificates.k8s.io // +groupName=certificates.k8s.io
package certificates package certificates
...@@ -26,17 +26,17 @@ import ( ...@@ -26,17 +26,17 @@ import (
// Describes a certificate signing request // Describes a certificate signing request
type CertificateSigningRequest struct { type CertificateSigningRequest struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
api.ObjectMeta `json:"metadata,omitempty"` api.ObjectMeta
// The certificate request itself and any additional information. // The certificate request itself and any additional information.
// +optional // +optional
Spec CertificateSigningRequestSpec `json:"spec,omitempty"` Spec CertificateSigningRequestSpec
// Derived information about the request. // Derived information about the request.
// +optional // +optional
Status CertificateSigningRequestStatus `json:"status,omitempty"` Status CertificateSigningRequestStatus
} }
// This information is immutable after the request is created. Only the Request // This information is immutable after the request is created. Only the Request
...@@ -44,26 +44,26 @@ type CertificateSigningRequest struct { ...@@ -44,26 +44,26 @@ type CertificateSigningRequest struct {
// Kubernetes and cannot be modified by users. // Kubernetes and cannot be modified by users.
type CertificateSigningRequestSpec struct { type CertificateSigningRequestSpec struct {
// Base64-encoded PKCS#10 CSR data // Base64-encoded PKCS#10 CSR data
Request []byte `json:"request"` Request []byte
// Information about the requesting user (if relevant) // Information about the requesting user (if relevant)
// See user.Info interface for details // See user.Info interface for details
// +optional // +optional
Username string `json:"username,omitempty"` Username string
// +optional // +optional
UID string `json:"uid,omitempty"` UID string
// +optional // +optional
Groups []string `json:"groups,omitempty"` Groups []string
} }
type CertificateSigningRequestStatus struct { type CertificateSigningRequestStatus struct {
// Conditions applied to the request, such as approval or denial. // Conditions applied to the request, such as approval or denial.
// +optional // +optional
Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty"` Conditions []CertificateSigningRequestCondition
// If request was approved, the controller will place the issued certificate here. // If request was approved, the controller will place the issued certificate here.
// +optional // +optional
Certificate []byte `json:"certificate,omitempty"` Certificate []byte
} }
type RequestConditionType string type RequestConditionType string
...@@ -76,23 +76,23 @@ const ( ...@@ -76,23 +76,23 @@ const (
type CertificateSigningRequestCondition struct { type CertificateSigningRequestCondition struct {
// request approval state, currently Approved or Denied. // request approval state, currently Approved or Denied.
Type RequestConditionType `json:"type"` Type RequestConditionType
// brief reason for the request state // brief reason for the request state
// +optional // +optional
Reason string `json:"reason,omitempty"` Reason string
// human readable message with details about the request state // human readable message with details about the request state
// +optional // +optional
Message string `json:"message,omitempty"` Message string
// timestamp for the last update to this condition // timestamp for the last update to this condition
// +optional // +optional
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` LastUpdateTime metav1.Time
} }
type CertificateSigningRequestList struct { type CertificateSigningRequestList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta
// +optional // +optional
Items []CertificateSigningRequest `json:"items,omitempty"` Items []CertificateSigningRequest
} }
...@@ -15,6 +15,5 @@ limitations under the License. ...@@ -15,6 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
package componentconfig package componentconfig
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,6 +15,5 @@ limitations under the License. ...@@ -15,6 +15,5 @@ limitations under the License.
*/ */
// +k8s:deepcopy-gen=package,register // +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
package extensions package extensions
...@@ -19,7 +19,6 @@ package extensions ...@@ -19,7 +19,6 @@ package extensions
import ( import (
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/apis/autoscaling" "k8s.io/client-go/pkg/apis/autoscaling"
"k8s.io/client-go/pkg/apis/batch"
metav1 "k8s.io/client-go/pkg/apis/meta/v1" metav1 "k8s.io/client-go/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/runtime" "k8s.io/client-go/pkg/runtime"
"k8s.io/client-go/pkg/runtime/schema" "k8s.io/client-go/pkg/runtime/schema"
...@@ -55,9 +54,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { ...@@ -55,9 +54,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&DeploymentRollback{}, &DeploymentRollback{},
&autoscaling.HorizontalPodAutoscaler{}, &autoscaling.HorizontalPodAutoscaler{},
&autoscaling.HorizontalPodAutoscalerList{}, &autoscaling.HorizontalPodAutoscalerList{},
&batch.Job{},
&batch.JobList{},
&batch.JobTemplate{},
&ReplicationControllerDummy{}, &ReplicationControllerDummy{},
&Scale{}, &Scale{},
&ThirdPartyResource{}, &ThirdPartyResource{},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -22,7 +22,6 @@ import ( ...@@ -22,7 +22,6 @@ import (
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1" v1 "k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/apis/autoscaling" "k8s.io/client-go/pkg/apis/autoscaling"
"k8s.io/client-go/pkg/apis/batch"
"k8s.io/client-go/pkg/apis/extensions" "k8s.io/client-go/pkg/apis/extensions"
metav1 "k8s.io/client-go/pkg/apis/meta/v1" metav1 "k8s.io/client-go/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/conversion" "k8s.io/client-go/pkg/conversion"
...@@ -48,9 +47,6 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -48,9 +47,6 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
Convert_v1beta1_SubresourceReference_To_autoscaling_CrossVersionObjectReference, Convert_v1beta1_SubresourceReference_To_autoscaling_CrossVersionObjectReference,
Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1beta1_HorizontalPodAutoscalerSpec, Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1beta1_HorizontalPodAutoscalerSpec,
Convert_v1beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec, Convert_v1beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec,
// batch
Convert_batch_JobSpec_To_v1beta1_JobSpec,
Convert_v1beta1_JobSpec_To_batch_JobSpec,
) )
if err != nil { if err != nil {
return err return err
...@@ -74,16 +70,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -74,16 +70,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
} }
} }
return api.Scheme.AddFieldLabelConversionFunc("extensions/v1beta1", "Job", return nil
func(label, value string) (string, string, error) {
switch label {
case "metadata.name", "metadata.namespace", "status.successful":
return label, value, nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
},
)
} }
func Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus(in *extensions.ScaleStatus, out *ScaleStatus, s conversion.Scope) error { func Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus(in *extensions.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
...@@ -262,56 +249,6 @@ func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *ReplicaSetS ...@@ -262,56 +249,6 @@ func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *ReplicaSetS
return nil return nil
} }
func Convert_batch_JobSpec_To_v1beta1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error {
out.Parallelism = in.Parallelism
out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
out.Selector = in.Selector
// BEGIN non-standard conversion
// autoSelector has opposite meaning as manualSelector.
// in both cases, unset means false, and unset is always preferred to false.
// unset vs set-false distinction is not preserved.
manualSelector := in.ManualSelector != nil && *in.ManualSelector
autoSelector := !manualSelector
if autoSelector {
out.AutoSelector = new(bool)
*out.AutoSelector = true
} else {
out.AutoSelector = nil
}
// END non-standard conversion
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func Convert_v1beta1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error {
out.Parallelism = in.Parallelism
out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
out.Selector = in.Selector
// BEGIN non-standard conversion
// autoSelector has opposite meaning as manualSelector.
// in both cases, unset means false, and unset is always preferred to false.
// unset vs set-false distinction is not preserved.
autoSelector := bool(in.AutoSelector != nil && *in.AutoSelector)
manualSelector := !autoSelector
if manualSelector {
out.ManualSelector = new(bool)
*out.ManualSelector = true
} else {
out.ManualSelector = nil
}
// END non-standard conversion
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func Convert_autoscaling_CrossVersionObjectReference_To_v1beta1_SubresourceReference(in *autoscaling.CrossVersionObjectReference, out *SubresourceReference, s conversion.Scope) error { func Convert_autoscaling_CrossVersionObjectReference_To_v1beta1_SubresourceReference(in *autoscaling.CrossVersionObjectReference, out *SubresourceReference, s conversion.Scope) error {
out.Kind = in.Kind out.Kind = in.Kind
out.Name = in.Name out.Name = in.Name
......
...@@ -28,7 +28,6 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error { ...@@ -28,7 +28,6 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
return scheme.AddDefaultingFuncs( return scheme.AddDefaultingFuncs(
SetDefaults_DaemonSet, SetDefaults_DaemonSet,
SetDefaults_Deployment, SetDefaults_Deployment,
SetDefaults_Job,
SetDefaults_HorizontalPodAutoscaler, SetDefaults_HorizontalPodAutoscaler,
SetDefaults_ReplicaSet, SetDefaults_ReplicaSet,
SetDefaults_NetworkPolicy, SetDefaults_NetworkPolicy,
...@@ -91,40 +90,6 @@ func SetDefaults_Deployment(obj *Deployment) { ...@@ -91,40 +90,6 @@ func SetDefaults_Deployment(obj *Deployment) {
} }
} }
func SetDefaults_Job(obj *Job) {
labels := obj.Spec.Template.Labels
// TODO: support templates defined elsewhere when we support them in the API
if labels != nil {
// if an autoselector is requested, we'll build the selector later with controller-uid and job-name
autoSelector := bool(obj.Spec.AutoSelector != nil && *obj.Spec.AutoSelector)
// otherwise, we are using a manual selector
manualSelector := !autoSelector
// and default behavior for an unspecified manual selector is to use the pod template labels
if manualSelector && obj.Spec.Selector == nil {
obj.Spec.Selector = &metav1.LabelSelector{
MatchLabels: labels,
}
}
if len(obj.Labels) == 0 {
obj.Labels = labels
}
}
// For a non-parallel job, you can leave both `.spec.completions` and
// `.spec.parallelism` unset. When both are unset, both are defaulted to 1.
if obj.Spec.Completions == nil && obj.Spec.Parallelism == nil {
obj.Spec.Completions = new(int32)
*obj.Spec.Completions = 1
obj.Spec.Parallelism = new(int32)
*obj.Spec.Parallelism = 1
}
if obj.Spec.Parallelism == nil {
obj.Spec.Parallelism = new(int32)
*obj.Spec.Parallelism = 1
}
}
func SetDefaults_HorizontalPodAutoscaler(obj *HorizontalPodAutoscaler) { func SetDefaults_HorizontalPodAutoscaler(obj *HorizontalPodAutoscaler) {
if obj.Spec.MinReplicas == nil { if obj.Spec.MinReplicas == nil {
minReplicas := int32(1) minReplicas := int32(1)
......
...@@ -541,138 +541,6 @@ message IngressTLS { ...@@ -541,138 +541,6 @@ message IngressTLS {
optional string secretName = 2; optional string secretName = 2;
} }
// Job represents the configuration of a single job.
// DEPRECATED: extensions/v1beta1.Job is deprecated, use batch/v1.Job instead.
message Job {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobSpec spec = 2;
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
optional JobStatus status = 3;
}
// JobCondition describes current state of a job.
message JobCondition {
// Type of job condition, Complete or Failed.
optional string type = 1;
// Status of the condition, one of True, False, Unknown.
optional string status = 2;
// Last time the condition was checked.
// +optional
optional k8s.io.kubernetes.pkg.apis.meta.v1.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
// +optional
optional k8s.io.kubernetes.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
// +optional
optional string reason = 5;
// Human readable message indicating details about last transition.
// +optional
optional string message = 6;
}
// JobList is a collection of jobs.
// DEPRECATED: extensions/v1beta1.JobList is deprecated, use batch/v1.JobList instead.
message JobList {
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of Job.
repeated Job items = 2;
}
// JobSpec describes how the job execution will look like.
message JobSpec {
// Parallelism specifies the maximum desired number of pods the job should
// run at any given time. The actual number of pods running in steady state will
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 parallelism = 1;
// Completions specifies the desired number of successfully finished pods the
// job should be run with. Setting to nil means that the success of any
// pod signals the success of all pods, and allows parallelism to have any positive
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
optional int32 completions = 2;
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
optional int64 activeDeadlineSeconds = 3;
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
optional k8s.io.kubernetes.pkg.apis.meta.v1.LabelSelector selector = 4;
// AutoSelector controls generation of pod labels and pod selectors.
// It was not present in the original extensions/v1beta1 Job definition, but exists
// to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite
// meaning as, ManualSelector.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
optional bool autoSelector = 5;
// Template is the object that describes the pod that will be created when
// executing a job.
// More info: http://kubernetes.io/docs/user-guide/jobs
optional k8s.io.kubernetes.pkg.api.v1.PodTemplateSpec template = 6;
}
// JobStatus represents the current state of a Job.
message JobStatus {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
repeated JobCondition conditions = 1;
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.apis.meta.v1.Time startTime = 2;
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
optional k8s.io.kubernetes.pkg.apis.meta.v1.Time completionTime = 3;
// Active is the number of actively running pods.
// +optional
optional int32 active = 4;
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
optional int32 succeeded = 5;
// Failed is the number of pods which reached Phase Failed.
// +optional
optional int32 failed = 6;
}
message NetworkPolicy { message NetworkPolicy {
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
......
...@@ -48,8 +48,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { ...@@ -48,8 +48,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&DeploymentRollback{}, &DeploymentRollback{},
&HorizontalPodAutoscaler{}, &HorizontalPodAutoscaler{},
&HorizontalPodAutoscalerList{}, &HorizontalPodAutoscalerList{},
&Job{},
&JobList{},
&ReplicationControllerDummy{}, &ReplicationControllerDummy{},
&Scale{}, &Scale{},
&ThirdPartyResource{}, &ThirdPartyResource{},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -616,149 +616,6 @@ type ThirdPartyResourceDataList struct { ...@@ -616,149 +616,6 @@ type ThirdPartyResourceDataList struct {
// +genclient=true // +genclient=true
// Job represents the configuration of a single job.
// DEPRECATED: extensions/v1beta1.Job is deprecated, use batch/v1.Job instead.
type Job struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec is a structure defining the expected behavior of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Spec JobSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status is a structure describing current status of a job.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
// +optional
Status JobStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// JobList is a collection of jobs.
// DEPRECATED: extensions/v1beta1.JobList is deprecated, use batch/v1.JobList instead.
type JobList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of Job.
Items []Job `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// JobSpec describes how the job execution will look like.
type JobSpec struct {
// Parallelism specifies the maximum desired number of pods the job should
// run at any given time. The actual number of pods running in steady state will
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Parallelism *int32 `json:"parallelism,omitempty" protobuf:"varint,1,opt,name=parallelism"`
// Completions specifies the desired number of successfully finished pods the
// job should be run with. Setting to nil means that the success of any
// pod signals the success of all pods, and allows parallelism to have any positive
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Completions *int32 `json:"completions,omitempty" protobuf:"varint,2,opt,name=completions"`
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,3,opt,name=activeDeadlineSeconds"`
// Selector is a label query over pods that should match the pod count.
// Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional
Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// AutoSelector controls generation of pod labels and pod selectors.
// It was not present in the original extensions/v1beta1 Job definition, but exists
// to allow conversion from batch/v1 Jobs, where it corresponds to, but has the opposite
// meaning as, ManualSelector.
// More info: http://releases.k8s.io/HEAD/docs/design/selector-generation.md
// +optional
AutoSelector *bool `json:"autoSelector,omitempty" protobuf:"varint,5,opt,name=autoSelector"`
// Template is the object that describes the pod that will be created when
// executing a job.
// More info: http://kubernetes.io/docs/user-guide/jobs
Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,6,opt,name=template"`
}
// JobStatus represents the current state of a Job.
type JobStatus struct {
// Conditions represent the latest available observations of an object's current state.
// More info: http://kubernetes.io/docs/user-guide/jobs
// +optional
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
// StartTime represents time when the job was acknowledged by the Job Manager.
// It is not guaranteed to be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty" protobuf:"bytes,2,opt,name=startTime"`
// CompletionTime represents time when the job was completed. It is not guaranteed to
// be set in happens-before order across separate operations.
// It is represented in RFC3339 form and is in UTC.
// +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty" protobuf:"bytes,3,opt,name=completionTime"`
// Active is the number of actively running pods.
// +optional
Active int32 `json:"active,omitempty" protobuf:"varint,4,opt,name=active"`
// Succeeded is the number of pods which reached Phase Succeeded.
// +optional
Succeeded int32 `json:"succeeded,omitempty" protobuf:"varint,5,opt,name=succeeded"`
// Failed is the number of pods which reached Phase Failed.
// +optional
Failed int32 `json:"failed,omitempty" protobuf:"varint,6,opt,name=failed"`
}
type JobConditionType string
// These are valid conditions of a job.
const (
// JobComplete means the job has completed its execution.
JobComplete JobConditionType = "Complete"
// JobFailed means the job has failed its execution.
JobFailed JobConditionType = "Failed"
)
// JobCondition describes current state of a job.
type JobCondition struct {
// Type of job condition, Complete or Failed.
Type JobConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=JobConditionType"`
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
// Last time the condition was checked.
// +optional
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
// Last time the condition transit from one status to another.
// +optional
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
// (brief) reason for the condition's last transition.
// +optional
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}
// +genclient=true
// Ingress is a collection of rules that allow inbound connections to reach the // Ingress is a collection of rules that allow inbound connections to reach the
// endpoints defined by a backend. An Ingress can be configured to give services // endpoints defined by a backend. An Ingress can be configured to give services
// externally-reachable urls, load balance traffic, terminate SSL, offer name // externally-reachable urls, load balance traffic, terminate SSL, offer name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment