mirror of
https://github.com/rancher/rke.git
synced 2025-06-27 07:50:30 +00:00
vendor update
This commit is contained in:
parent
e8685c8b96
commit
aaa673d45c
@ -24,5 +24,5 @@ github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869d
|
|||||||
github.com/Microsoft/go-winio ab35fc04b6365e8fcb18e6e9e41ea4a02b10b175
|
github.com/Microsoft/go-winio ab35fc04b6365e8fcb18e6e9e41ea4a02b10b175
|
||||||
github.com/go-ini/ini 06f5f3d67269ccec1fe5fe4134ba6e982984f7f5
|
github.com/go-ini/ini 06f5f3d67269ccec1fe5fe4134ba6e982984f7f5
|
||||||
|
|
||||||
github.com/rancher/norman 57e8282a33f04091e30df7700bd328f3205c1189
|
github.com/rancher/norman c032c4611f2eec1652ef37d254f0e8ccf90c80aa
|
||||||
github.com/rancher/types 83409a3bca6ffba833cbb8c4da5c9cabe3af64ae
|
github.com/rancher/types 01217d321d6b73f122b851a39c87ccf8925f8708
|
||||||
|
4
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
4
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
@ -124,14 +124,14 @@ func (g *genericController) sync(ctx context.Context) error {
|
|||||||
DeleteFunc: g.queueObject,
|
DeleteFunc: g.queueObject,
|
||||||
})
|
})
|
||||||
|
|
||||||
logrus.Infof("Syncing %s Controller", g.name)
|
logrus.Debugf("Syncing %s Controller", g.name)
|
||||||
|
|
||||||
go g.informer.Run(ctx.Done())
|
go g.informer.Run(ctx.Done())
|
||||||
|
|
||||||
if !cache.WaitForCacheSync(ctx.Done(), g.informer.HasSynced) {
|
if !cache.WaitForCacheSync(ctx.Done(), g.informer.HasSynced) {
|
||||||
return fmt.Errorf("failed to sync controller %s", g.name)
|
return fmt.Errorf("failed to sync controller %s", g.name)
|
||||||
}
|
}
|
||||||
logrus.Infof("Syncing %s Controller Done", g.name)
|
logrus.Debugf("Syncing %s Controller Done", g.name)
|
||||||
|
|
||||||
g.synced = true
|
g.synced = true
|
||||||
return nil
|
return nil
|
||||||
|
1
vendor/github.com/rancher/norman/httperror/error.go
generated
vendored
1
vendor/github.com/rancher/norman/httperror/error.go
generated
vendored
@ -9,6 +9,7 @@ var (
|
|||||||
PermissionDenied = ErrorCode{"PermissionDenied", 403}
|
PermissionDenied = ErrorCode{"PermissionDenied", 403}
|
||||||
NotFound = ErrorCode{"NotFound", 404}
|
NotFound = ErrorCode{"NotFound", 404}
|
||||||
MethodNotAllowed = ErrorCode{"MethodNotAllow", 405}
|
MethodNotAllowed = ErrorCode{"MethodNotAllow", 405}
|
||||||
|
Conflict = ErrorCode{"Conflict", 409}
|
||||||
|
|
||||||
InvalidDateFormat = ErrorCode{"InvalidDateFormat", 422}
|
InvalidDateFormat = ErrorCode{"InvalidDateFormat", 422}
|
||||||
InvalidFormat = ErrorCode{"InvalidFormat", 422}
|
InvalidFormat = ErrorCode{"InvalidFormat", 422}
|
||||||
|
39
vendor/github.com/rancher/norman/types/convert/convert.go
generated
vendored
39
vendor/github.com/rancher/norman/types/convert/convert.go
generated
vendored
@ -133,7 +133,7 @@ func LowerTitle(input string) string {
|
|||||||
return string(runes)
|
return string(runes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsEmpty(v interface{}) bool {
|
func IsAPIObjectEmpty(v interface{}) bool {
|
||||||
if v == nil || v == "" || v == 0 || v == false {
|
if v == nil || v == "" || v == 0 || v == false {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -211,3 +211,40 @@ func EncodeToMap(obj interface{}) (map[string]interface{}, error) {
|
|||||||
dec.UseNumber()
|
dec.UseNumber()
|
||||||
return result, dec.Decode(&result)
|
return result, dec.Decode(&result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ToJSONKey(str string) string {
|
||||||
|
parts := strings.Split(str, "_")
|
||||||
|
for i := 1; i < len(parts); i++ {
|
||||||
|
parts[i] = strings.Title(parts[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.Join(parts, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToYAMLKey(str string) string {
|
||||||
|
var result []rune
|
||||||
|
cap := false
|
||||||
|
|
||||||
|
for i, r := range []rune(str) {
|
||||||
|
if i == 0 {
|
||||||
|
if unicode.IsUpper(r) {
|
||||||
|
cap = true
|
||||||
|
}
|
||||||
|
result = append(result, unicode.ToLower(r))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if unicode.IsUpper(r) {
|
||||||
|
if cap {
|
||||||
|
result = append(result, unicode.ToLower(r))
|
||||||
|
} else {
|
||||||
|
result = append(result, '_', unicode.ToLower(r))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cap = false
|
||||||
|
result = append(result, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(result)
|
||||||
|
}
|
||||||
|
7
vendor/github.com/rancher/norman/types/encoder.go
generated
vendored
7
vendor/github.com/rancher/norman/types/encoder.go
generated
vendored
@ -3,10 +3,15 @@ package types
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"github.com/ghodss/yaml"
|
"github.com/ghodss/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
commenter = regexp.MustCompile("(?m)^( *)zzz#\\((.*)\\)\\((.*)\\)([a-z]+.*):(.*)")
|
||||||
|
)
|
||||||
|
|
||||||
func JSONEncoder(writer io.Writer, v interface{}) error {
|
func JSONEncoder(writer io.Writer, v interface{}) error {
|
||||||
return json.NewEncoder(writer).Encode(v)
|
return json.NewEncoder(writer).Encode(v)
|
||||||
}
|
}
|
||||||
@ -20,6 +25,8 @@ func YAMLEncoder(writer io.Writer, v interface{}) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
//buf = commenter.ReplaceAll(buf, []byte("${1}# ${2}type: ${3}\n${1}# ${4}:${5}"))
|
||||||
|
buf = commenter.ReplaceAll(buf, []byte("${1}# ${4}:${5}"))
|
||||||
_, err = writer.Write(buf)
|
_, err = writer.Write(buf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
56
vendor/github.com/rancher/norman/types/mapper.go
generated
vendored
56
vendor/github.com/rancher/norman/types/mapper.go
generated
vendored
@ -5,11 +5,12 @@ import (
|
|||||||
|
|
||||||
"github.com/rancher/norman/types/convert"
|
"github.com/rancher/norman/types/convert"
|
||||||
"github.com/rancher/norman/types/definition"
|
"github.com/rancher/norman/types/definition"
|
||||||
|
"github.com/rancher/norman/types/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mapper interface {
|
type Mapper interface {
|
||||||
FromInternal(data map[string]interface{})
|
FromInternal(data map[string]interface{})
|
||||||
ToInternal(data map[string]interface{})
|
ToInternal(data map[string]interface{}) error
|
||||||
ModifySchema(schema *Schema, schemas *Schemas) error
|
ModifySchema(schema *Schema, schemas *Schemas) error
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,10 +22,12 @@ func (m Mappers) FromInternal(data map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Mappers) ToInternal(data map[string]interface{}) {
|
func (m Mappers) ToInternal(data map[string]interface{}) error {
|
||||||
|
var errors []error
|
||||||
for i := len(m) - 1; i >= 0; i-- {
|
for i := len(m) - 1; i >= 0; i-- {
|
||||||
m[i].ToInternal(data)
|
errors = append(errors, m[i].ToInternal(data))
|
||||||
}
|
}
|
||||||
|
return NewErrors(errors...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Mappers) ModifySchema(schema *Schema, schemas *Schemas) error {
|
func (m Mappers) ModifySchema(schema *Schema, schemas *Schemas) error {
|
||||||
@ -42,9 +45,13 @@ type typeMapper struct {
|
|||||||
typeName string
|
typeName string
|
||||||
subSchemas map[string]*Schema
|
subSchemas map[string]*Schema
|
||||||
subArraySchemas map[string]*Schema
|
subArraySchemas map[string]*Schema
|
||||||
|
subMapSchemas map[string]*Schema
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
||||||
|
name, _ := values.GetValueN(data, "metadata", "name").(string)
|
||||||
|
namespace, _ := values.GetValueN(data, "metadata", "namespace").(string)
|
||||||
|
|
||||||
for fieldName, schema := range t.subSchemas {
|
for fieldName, schema := range t.subSchemas {
|
||||||
if schema.Mapper == nil {
|
if schema.Mapper == nil {
|
||||||
continue
|
continue
|
||||||
@ -53,6 +60,17 @@ func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
|||||||
schema.Mapper.FromInternal(fieldData)
|
schema.Mapper.FromInternal(fieldData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for fieldName, schema := range t.subMapSchemas {
|
||||||
|
if schema.Mapper == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
datas, _ := data[fieldName].(map[string]interface{})
|
||||||
|
for _, fieldData := range datas {
|
||||||
|
mapFieldData, _ := fieldData.(map[string]interface{})
|
||||||
|
schema.Mapper.FromInternal(mapFieldData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for fieldName, schema := range t.subArraySchemas {
|
for fieldName, schema := range t.subArraySchemas {
|
||||||
if schema.Mapper == nil {
|
if schema.Mapper == nil {
|
||||||
continue
|
continue
|
||||||
@ -64,16 +82,13 @@ func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Mappers(t.Mappers).FromInternal(data)
|
|
||||||
|
|
||||||
if _, ok := data["type"]; !ok && data != nil {
|
if _, ok := data["type"]; !ok && data != nil {
|
||||||
data["type"] = t.typeName
|
data["type"] = t.typeName
|
||||||
}
|
}
|
||||||
|
|
||||||
if data != nil && t.root {
|
Mappers(t.Mappers).FromInternal(data)
|
||||||
name, _ := data["name"].(string)
|
|
||||||
namespace, _ := data["namespaceId"].(string)
|
|
||||||
|
|
||||||
|
if data != nil && t.root {
|
||||||
if _, ok := data["id"]; ok {
|
if _, ok := data["id"]; ok {
|
||||||
if namespace != "" {
|
if namespace != "" {
|
||||||
id, _ := data["id"].(string)
|
id, _ := data["id"].(string)
|
||||||
@ -91,8 +106,9 @@ func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *typeMapper) ToInternal(data map[string]interface{}) {
|
func (t *typeMapper) ToInternal(data map[string]interface{}) error {
|
||||||
Mappers(t.Mappers).ToInternal(data)
|
errors := Errors{}
|
||||||
|
errors.Add(Mappers(t.Mappers).ToInternal(data))
|
||||||
|
|
||||||
for fieldName, schema := range t.subArraySchemas {
|
for fieldName, schema := range t.subArraySchemas {
|
||||||
if schema.Mapper == nil {
|
if schema.Mapper == nil {
|
||||||
@ -100,7 +116,17 @@ func (t *typeMapper) ToInternal(data map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
datas, _ := data[fieldName].([]interface{})
|
datas, _ := data[fieldName].([]interface{})
|
||||||
for _, fieldData := range datas {
|
for _, fieldData := range datas {
|
||||||
schema.Mapper.ToInternal(convert.ToMapInterface(fieldData))
|
errors.Add(schema.Mapper.ToInternal(convert.ToMapInterface(fieldData)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for fieldName, schema := range t.subMapSchemas {
|
||||||
|
if schema.Mapper == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
datas, _ := data[fieldName].(map[string]interface{})
|
||||||
|
for _, fieldData := range datas {
|
||||||
|
errors.Add(schema.Mapper.ToInternal(convert.ToMapInterface(fieldData)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,13 +135,16 @@ func (t *typeMapper) ToInternal(data map[string]interface{}) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fieldData, _ := data[fieldName].(map[string]interface{})
|
fieldData, _ := data[fieldName].(map[string]interface{})
|
||||||
schema.Mapper.ToInternal(fieldData)
|
errors.Add(schema.Mapper.ToInternal(fieldData))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return errors.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *typeMapper) ModifySchema(schema *Schema, schemas *Schemas) error {
|
func (t *typeMapper) ModifySchema(schema *Schema, schemas *Schemas) error {
|
||||||
t.subSchemas = map[string]*Schema{}
|
t.subSchemas = map[string]*Schema{}
|
||||||
t.subArraySchemas = map[string]*Schema{}
|
t.subArraySchemas = map[string]*Schema{}
|
||||||
|
t.subMapSchemas = map[string]*Schema{}
|
||||||
t.typeName = fmt.Sprintf("%s/schemas/%s", schema.Version.Path, schema.ID)
|
t.typeName = fmt.Sprintf("%s/schemas/%s", schema.Version.Path, schema.ID)
|
||||||
|
|
||||||
mapperSchema := schema
|
mapperSchema := schema
|
||||||
@ -128,6 +157,9 @@ func (t *typeMapper) ModifySchema(schema *Schema, schemas *Schemas) error {
|
|||||||
if definition.IsArrayType(fieldType) {
|
if definition.IsArrayType(fieldType) {
|
||||||
fieldType = definition.SubType(fieldType)
|
fieldType = definition.SubType(fieldType)
|
||||||
targetMap = t.subArraySchemas
|
targetMap = t.subArraySchemas
|
||||||
|
} else if definition.IsMapType(fieldType) {
|
||||||
|
fieldType = definition.SubType(fieldType)
|
||||||
|
targetMap = t.subMapSchemas
|
||||||
}
|
}
|
||||||
|
|
||||||
schema := schemas.Schema(&schema.Version, fieldType)
|
schema := schemas.Schema(&schema.Version, fieldType)
|
||||||
|
2
vendor/github.com/rancher/norman/types/reflection.go
generated
vendored
2
vendor/github.com/rancher/norman/types/reflection.go
generated
vendored
@ -99,6 +99,8 @@ func (s *Schemas) setupFilters(schema *Schema) {
|
|||||||
switch field.Type {
|
switch field.Type {
|
||||||
case "enum":
|
case "enum":
|
||||||
mods = []ModifierType{ModifierEQ, ModifierNE, ModifierIn, ModifierNotIn}
|
mods = []ModifierType{ModifierEQ, ModifierNE, ModifierIn, ModifierNotIn}
|
||||||
|
case "date":
|
||||||
|
fallthrough
|
||||||
case "dnsLabel":
|
case "dnsLabel":
|
||||||
fallthrough
|
fallthrough
|
||||||
case "hostname":
|
case "hostname":
|
||||||
|
23
vendor/github.com/rancher/norman/types/schemas.go
generated
vendored
23
vendor/github.com/rancher/norman/types/schemas.go
generated
vendored
@ -343,7 +343,28 @@ type MultiErrors struct {
|
|||||||
Errors []error
|
Errors []error
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewErrors(errors ...error) error {
|
type Errors struct {
|
||||||
|
errors []error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *Errors) Add(err error) {
|
||||||
|
if err != nil {
|
||||||
|
e.errors = append(e.errors, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *Errors) Err() error {
|
||||||
|
return NewErrors(e.errors...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewErrors(inErrors ...error) error {
|
||||||
|
var errors []error
|
||||||
|
for _, err := range inErrors {
|
||||||
|
if err != nil {
|
||||||
|
errors = append(errors, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(errors) == 0 {
|
if len(errors) == 0 {
|
||||||
return nil
|
return nil
|
||||||
} else if len(errors) == 1 {
|
} else if len(errors) == 1 {
|
||||||
|
34
vendor/github.com/rancher/norman/types/server_types.go
generated
vendored
34
vendor/github.com/rancher/norman/types/server_types.go
generated
vendored
@ -15,10 +15,11 @@ type RawResource struct {
|
|||||||
ID string `json:"id,omitempty" yaml:"id,omitempty"`
|
ID string `json:"id,omitempty" yaml:"id,omitempty"`
|
||||||
Type string `json:"type,omitempty" yaml:"type,omitempty"`
|
Type string `json:"type,omitempty" yaml:"type,omitempty"`
|
||||||
Schema *Schema `json:"-" yaml:"-"`
|
Schema *Schema `json:"-" yaml:"-"`
|
||||||
Links map[string]string `json:"links" yaml:"links"`
|
Links map[string]string `json:"links,omitempty" yaml:"links,omitempty"`
|
||||||
Actions map[string]string `json:"actions" yaml:"actions"`
|
Actions map[string]string `json:"actions,omitempty" yaml:"actions,omitempty"`
|
||||||
Values map[string]interface{} `json:",inline"`
|
Values map[string]interface{} `json:",inline" yaml:",inline"`
|
||||||
ActionLinks bool `json:"-"`
|
ActionLinks bool `json:"-" yaml:"-"`
|
||||||
|
DropReadOnly bool `json:"-" yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RawResource) AddAction(apiContext *APIContext, name string) {
|
func (r *RawResource) AddAction(apiContext *APIContext, name string) {
|
||||||
@ -26,23 +27,38 @@ func (r *RawResource) AddAction(apiContext *APIContext, name string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *RawResource) MarshalJSON() ([]byte, error) {
|
func (r *RawResource) MarshalJSON() ([]byte, error) {
|
||||||
|
return json.Marshal(r.ToMap())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RawResource) ToMap() map[string]interface{} {
|
||||||
data := map[string]interface{}{}
|
data := map[string]interface{}{}
|
||||||
for k, v := range r.Values {
|
for k, v := range r.Values {
|
||||||
data[k] = v
|
data[k] = v
|
||||||
}
|
}
|
||||||
if r.ID != "" {
|
|
||||||
|
if r.ID != "" && !r.DropReadOnly {
|
||||||
data["id"] = r.ID
|
data["id"] = r.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.Type != "" && !r.DropReadOnly {
|
||||||
data["type"] = r.Type
|
data["type"] = r.Type
|
||||||
|
}
|
||||||
|
if r.Schema.BaseType != "" && !r.DropReadOnly {
|
||||||
data["baseType"] = r.Schema.BaseType
|
data["baseType"] = r.Schema.BaseType
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(r.Links) > 0 && !r.DropReadOnly {
|
||||||
data["links"] = r.Links
|
data["links"] = r.Links
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(r.Actions) > 0 && !r.DropReadOnly {
|
||||||
if r.ActionLinks {
|
if r.ActionLinks {
|
||||||
data["actionLinks"] = r.Actions
|
data["actionLinks"] = r.Actions
|
||||||
} else {
|
} else {
|
||||||
data["actions"] = r.Actions
|
data["actions"] = r.Actions
|
||||||
}
|
}
|
||||||
return json.Marshal(data)
|
}
|
||||||
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionHandler func(actionName string, action *Action, request *APIContext) error
|
type ActionHandler func(actionName string, action *Action, request *APIContext) error
|
||||||
@ -53,6 +69,8 @@ type QueryFilter func(opts *QueryOptions, schema *Schema, data []map[string]inte
|
|||||||
|
|
||||||
type Validator func(request *APIContext, schema *Schema, data map[string]interface{}) error
|
type Validator func(request *APIContext, schema *Schema, data map[string]interface{}) error
|
||||||
|
|
||||||
|
type InputFormatter func(request *APIContext, schema *Schema, data map[string]interface{}, create bool) error
|
||||||
|
|
||||||
type Formatter func(request *APIContext, resource *RawResource)
|
type Formatter func(request *APIContext, resource *RawResource)
|
||||||
|
|
||||||
type CollectionFormatter func(request *APIContext, collection *GenericCollection)
|
type CollectionFormatter func(request *APIContext, collection *GenericCollection)
|
||||||
@ -124,6 +142,10 @@ func GetAPIContext(ctx context.Context) *APIContext {
|
|||||||
return apiContext
|
return apiContext
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *APIContext) Option(key string) string {
|
||||||
|
return r.Query.Get("_" + key)
|
||||||
|
}
|
||||||
|
|
||||||
func (r *APIContext) WriteResponse(code int, obj interface{}) {
|
func (r *APIContext) WriteResponse(code int, obj interface{}) {
|
||||||
r.ResponseWriter.Write(r, code, obj)
|
r.ResponseWriter.Write(r, code, obj)
|
||||||
}
|
}
|
||||||
|
12
vendor/github.com/rancher/norman/types/slice/contains.go
generated
vendored
12
vendor/github.com/rancher/norman/types/slice/contains.go
generated
vendored
@ -8,3 +8,15 @@ func ContainsString(slice []string, item string) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func StringsEqual(left, right []string) bool {
|
||||||
|
if len(left) != len(right) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for i := 0; i < len(left); i++ {
|
||||||
|
if left[i] != right[i] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
1
vendor/github.com/rancher/norman/types/types.go
generated
vendored
1
vendor/github.com/rancher/norman/types/types.go
generated
vendored
@ -111,6 +111,7 @@ type Schema struct {
|
|||||||
CreateHandler RequestHandler `json:"-"`
|
CreateHandler RequestHandler `json:"-"`
|
||||||
DeleteHandler RequestHandler `json:"-"`
|
DeleteHandler RequestHandler `json:"-"`
|
||||||
UpdateHandler RequestHandler `json:"-"`
|
UpdateHandler RequestHandler `json:"-"`
|
||||||
|
InputFormatter InputFormatter `json:"-"`
|
||||||
Formatter Formatter `json:"-"`
|
Formatter Formatter `json:"-"`
|
||||||
CollectionFormatter CollectionFormatter `json:"-"`
|
CollectionFormatter CollectionFormatter `json:"-"`
|
||||||
ErrorHandler ErrorHandler `json:"-"`
|
ErrorHandler ErrorHandler `json:"-"`
|
||||||
|
111
vendor/github.com/rancher/norman/types/values/values.go
generated
vendored
Normal file
111
vendor/github.com/rancher/norman/types/values/values.go
generated
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
package values
|
||||||
|
|
||||||
|
import "github.com/rancher/norman/types/convert"
|
||||||
|
|
||||||
|
func RemoveValue(data map[string]interface{}, keys ...string) (interface{}, bool) {
|
||||||
|
for i, key := range keys {
|
||||||
|
if i == len(keys)-1 {
|
||||||
|
val, ok := data[key]
|
||||||
|
delete(data, key)
|
||||||
|
return val, ok
|
||||||
|
}
|
||||||
|
data, _ = data[key].(map[string]interface{})
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetStringSlice(data map[string]interface{}, keys ...string) ([]string, bool) {
|
||||||
|
val, ok := GetValue(data, keys...)
|
||||||
|
if !ok {
|
||||||
|
return nil, ok
|
||||||
|
}
|
||||||
|
|
||||||
|
slice, typeOk := val.([]string)
|
||||||
|
if typeOk {
|
||||||
|
return slice, typeOk
|
||||||
|
}
|
||||||
|
|
||||||
|
sliceNext, typeOk := val.([]interface{})
|
||||||
|
if !typeOk {
|
||||||
|
return nil, typeOk
|
||||||
|
}
|
||||||
|
|
||||||
|
var result []string
|
||||||
|
for _, item := range sliceNext {
|
||||||
|
result = append(result, convert.ToString(item))
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetSlice(data map[string]interface{}, keys ...string) ([]map[string]interface{}, bool) {
|
||||||
|
val, ok := GetValue(data, keys...)
|
||||||
|
if !ok {
|
||||||
|
return nil, ok
|
||||||
|
}
|
||||||
|
|
||||||
|
slice, typeOk := val.([]map[string]interface{})
|
||||||
|
if typeOk {
|
||||||
|
return slice, typeOk
|
||||||
|
}
|
||||||
|
|
||||||
|
sliceNext, typeOk := val.([]interface{})
|
||||||
|
if !typeOk {
|
||||||
|
return nil, typeOk
|
||||||
|
}
|
||||||
|
|
||||||
|
result := []map[string]interface{}{}
|
||||||
|
for _, val := range sliceNext {
|
||||||
|
if v, ok := val.(map[string]interface{}); ok {
|
||||||
|
result = append(result, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetValueN(data map[string]interface{}, keys ...string) interface{} {
|
||||||
|
val, _ := GetValue(data, keys...)
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetValue(data map[string]interface{}, keys ...string) (interface{}, bool) {
|
||||||
|
for i, key := range keys {
|
||||||
|
if i == len(keys)-1 {
|
||||||
|
val, ok := data[key]
|
||||||
|
return val, ok
|
||||||
|
}
|
||||||
|
data, _ = data[key].(map[string]interface{})
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
func PutValue(data map[string]interface{}, val interface{}, keys ...string) {
|
||||||
|
if data == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is so ugly
|
||||||
|
for i, key := range keys {
|
||||||
|
if i == len(keys)-1 {
|
||||||
|
data[key] = val
|
||||||
|
} else {
|
||||||
|
newData, ok := data[key]
|
||||||
|
if ok {
|
||||||
|
newMap, ok := newData.(map[string]interface{})
|
||||||
|
if ok {
|
||||||
|
data = newMap
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
newMap := map[string]interface{}{}
|
||||||
|
data[key] = newMap
|
||||||
|
data = newMap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go
generated
vendored
14
vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go
generated
vendored
@ -24,8 +24,10 @@ const (
|
|||||||
ClusterConditionNoDiskPressure condition.Cond = "NoDiskPressure"
|
ClusterConditionNoDiskPressure condition.Cond = "NoDiskPressure"
|
||||||
// ClusterConditionNoMemoryPressure true when all cluster nodes have sufficient memory
|
// ClusterConditionNoMemoryPressure true when all cluster nodes have sufficient memory
|
||||||
ClusterConditionNoMemoryPressure condition.Cond = "NoMemoryPressure"
|
ClusterConditionNoMemoryPressure condition.Cond = "NoMemoryPressure"
|
||||||
// ClusterConditionconditionDefautlProjectCreated true when default project has been created
|
// ClusterConditionconditionDefaultProjectCreated true when default project has been created
|
||||||
ClusterConditionconditionDefautlProjectCreated condition.Cond = "DefaultProjectCreated"
|
ClusterConditionconditionDefaultProjectCreated condition.Cond = "DefaultProjectCreated"
|
||||||
|
// ClusterConditionconditionSystemProjectCreated true when system project has been created
|
||||||
|
ClusterConditionconditionSystemProjectCreated condition.Cond = "SystemProjectCreated"
|
||||||
// ClusterConditionDefaultNamespaceAssigned true when cluster's default namespace has been initially assigned
|
// ClusterConditionDefaultNamespaceAssigned true when cluster's default namespace has been initially assigned
|
||||||
ClusterConditionDefaultNamespaceAssigned condition.Cond = "DefaultNamespaceAssigned"
|
ClusterConditionDefaultNamespaceAssigned condition.Cond = "DefaultNamespaceAssigned"
|
||||||
// ClusterConditionSystemNamespacesAssigned true when cluster's system namespaces has been initially assigned to
|
// ClusterConditionSystemNamespacesAssigned true when cluster's system namespaces has been initially assigned to
|
||||||
@ -159,6 +161,10 @@ type GoogleKubernetesEngineConfig struct {
|
|||||||
SubNetwork string `json:"subNetwork,omitempty"`
|
SubNetwork string `json:"subNetwork,omitempty"`
|
||||||
// Configuration for LegacyAbac
|
// Configuration for LegacyAbac
|
||||||
EnableLegacyAbac bool `json:"enableLegacyAbac,omitempty"`
|
EnableLegacyAbac bool `json:"enableLegacyAbac,omitempty"`
|
||||||
|
NoStackdriverLogging bool `json:"noStackdriverLogging"`
|
||||||
|
NoStackdriverMonitoring bool `json:"noStackdriverMonitoring"`
|
||||||
|
NoNetworkPolicy bool `json:"noNetworkPolicy"`
|
||||||
|
MaintenanceWindow string `json:"maintenanceWindow"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AzureKubernetesServiceConfig struct {
|
type AzureKubernetesServiceConfig struct {
|
||||||
@ -212,6 +218,10 @@ type AmazonElasticContainerServiceConfig struct {
|
|||||||
InstanceType string `json:"instanceType"`
|
InstanceType string `json:"instanceType"`
|
||||||
MinimumNodes int `json:"minimumNodes"`
|
MinimumNodes int `json:"minimumNodes"`
|
||||||
MaximumNodes int `json:"maximumNodes"`
|
MaximumNodes int `json:"maximumNodes"`
|
||||||
|
VirtualNetwork string `json:"virtualNetwork,omitempty"`
|
||||||
|
Subnets []string `json:"subnets,omitempty"`
|
||||||
|
SecurityGroups []string `json:"securityGroups,omitempty"`
|
||||||
|
ServiceRole string `json:"serviceRole,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClusterEvent struct {
|
type ClusterEvent struct {
|
||||||
|
199
vendor/github.com/rancher/types/apis/management.cattle.io/v3/k8s_defaults.go
generated
vendored
199
vendor/github.com/rancher/types/apis/management.cattle.io/v3/k8s_defaults.go
generated
vendored
@ -11,84 +11,6 @@ var (
|
|||||||
|
|
||||||
// K8sVersionToRKESystemImages - images map for 2.0
|
// K8sVersionToRKESystemImages - images map for 2.0
|
||||||
K8sVersionToRKESystemImages = map[string]RKESystemImages{
|
K8sVersionToRKESystemImages = map[string]RKESystemImages{
|
||||||
"v1.8.10-rancher1-1": {
|
|
||||||
Etcd: m("quay.io/coreos/etcd:v3.0.17"),
|
|
||||||
Kubernetes: m("rancher/hyperkube:v1.8.10-rancher2"),
|
|
||||||
Alpine: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
NginxProxy: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
CertDownloader: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5"),
|
|
||||||
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5"),
|
|
||||||
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5"),
|
|
||||||
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
|
||||||
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
|
||||||
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
|
||||||
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
|
||||||
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
|
||||||
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
|
||||||
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
|
||||||
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
|
||||||
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
|
||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
|
||||||
},
|
|
||||||
"v1.8.11-rancher1": {
|
|
||||||
Etcd: m("quay.io/coreos/etcd:v3.0.17"),
|
|
||||||
Kubernetes: m("rancher/hyperkube:v1.8.11-rancher2"),
|
|
||||||
Alpine: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
NginxProxy: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
CertDownloader: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.4"),
|
|
||||||
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5"),
|
|
||||||
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5"),
|
|
||||||
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5"),
|
|
||||||
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
|
||||||
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
|
||||||
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
|
||||||
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
|
||||||
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
|
||||||
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
|
||||||
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
|
||||||
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
|
||||||
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
|
||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
|
||||||
},
|
|
||||||
"v1.8.11-rancher2-1": {
|
|
||||||
Etcd: m("quay.io/coreos/etcd:v3.0.17"),
|
|
||||||
Kubernetes: m("rancher/hyperkube:v1.8.11-rancher2"),
|
|
||||||
Alpine: m("rancher/rke-tools:v0.1.8"),
|
|
||||||
NginxProxy: m("rancher/rke-tools:v0.1.8"),
|
|
||||||
CertDownloader: m("rancher/rke-tools:v0.1.8"),
|
|
||||||
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.8"),
|
|
||||||
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5"),
|
|
||||||
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5"),
|
|
||||||
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5"),
|
|
||||||
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
|
||||||
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
|
||||||
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
|
||||||
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
|
||||||
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
|
||||||
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
|
||||||
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
|
||||||
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
|
||||||
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
|
||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
|
||||||
},
|
|
||||||
"v1.9.5-rancher1-1": {
|
"v1.9.5-rancher1-1": {
|
||||||
Etcd: m("quay.io/coreos/etcd:v3.1.12"),
|
Etcd: m("quay.io/coreos/etcd:v3.1.12"),
|
||||||
Kubernetes: m("rancher/hyperkube:v1.9.5-rancher1"),
|
Kubernetes: m("rancher/hyperkube:v1.9.5-rancher1"),
|
||||||
@ -111,7 +33,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -137,7 +59,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -163,7 +85,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -189,7 +111,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -215,7 +137,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -241,7 +163,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -267,7 +189,7 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
},
|
},
|
||||||
@ -293,6 +215,32 @@ var (
|
|||||||
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
||||||
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
|
},
|
||||||
|
"v1.11.1-rancher1-1": {
|
||||||
|
Etcd: m("quay.io/coreos/etcd:v3.2.18"),
|
||||||
|
Kubernetes: m("rancher/hyperkube:v1.11.1-rancher1"),
|
||||||
|
Alpine: m("rancher/rke-tools:v0.1.10"),
|
||||||
|
NginxProxy: m("rancher/rke-tools:v0.1.10"),
|
||||||
|
CertDownloader: m("rancher/rke-tools:v0.1.10"),
|
||||||
|
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.10"),
|
||||||
|
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.10"),
|
||||||
|
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.10"),
|
||||||
|
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.10"),
|
||||||
|
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
||||||
|
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
||||||
|
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
||||||
|
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
|
||||||
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
|
||||||
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
MetricsServer: m("gcr.io/google_containers/metrics-server-amd64:v0.2.1"),
|
||||||
@ -342,4 +290,85 @@ var (
|
|||||||
Busybox: m("busybox"),
|
Busybox: m("busybox"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LegacyK8sVersionToRKESystemImages - legacy images map
|
||||||
|
// Get to keep non-supported version because they are being referenced in dynamic manner by rancher code;
|
||||||
|
// so kept them in the separate data structure. Can be removed only if we decide to persist them on a cluster object.
|
||||||
|
LegacyK8sVersionToRKESystemImages = map[string]RKESystemImages{
|
||||||
|
"v1.8.10-rancher1-1": {
|
||||||
|
Etcd: m("quay.io/coreos/etcd:v3.0.17"),
|
||||||
|
Kubernetes: m("rancher/hyperkube:v1.8.10-rancher2"),
|
||||||
|
Alpine: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
NginxProxy: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
CertDownloader: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5"),
|
||||||
|
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5"),
|
||||||
|
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5"),
|
||||||
|
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
||||||
|
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
||||||
|
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
||||||
|
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
||||||
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
|
},
|
||||||
|
"v1.8.11-rancher1": {
|
||||||
|
Etcd: m("quay.io/coreos/etcd:v3.0.17"),
|
||||||
|
Kubernetes: m("rancher/hyperkube:v1.8.11-rancher2"),
|
||||||
|
Alpine: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
NginxProxy: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
CertDownloader: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.4"),
|
||||||
|
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5"),
|
||||||
|
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5"),
|
||||||
|
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5"),
|
||||||
|
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
||||||
|
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
||||||
|
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
||||||
|
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
||||||
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
|
},
|
||||||
|
"v1.8.11-rancher2-1": {
|
||||||
|
Etcd: m("quay.io/coreos/etcd:v3.0.17"),
|
||||||
|
Kubernetes: m("rancher/hyperkube:v1.8.11-rancher2"),
|
||||||
|
Alpine: m("rancher/rke-tools:v0.1.8"),
|
||||||
|
NginxProxy: m("rancher/rke-tools:v0.1.8"),
|
||||||
|
CertDownloader: m("rancher/rke-tools:v0.1.8"),
|
||||||
|
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.8"),
|
||||||
|
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5"),
|
||||||
|
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5"),
|
||||||
|
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.5"),
|
||||||
|
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
|
||||||
|
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
|
||||||
|
CalicoNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
|
||||||
|
CanalNode: m("quay.io/calico/node:v3.1.1"),
|
||||||
|
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
|
||||||
|
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
|
||||||
|
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
|
||||||
|
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
|
||||||
|
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.0"),
|
||||||
|
Ingress: m("rancher/nginx-ingress-controller:0.16.2-rancher1"),
|
||||||
|
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
|
||||||
|
},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
18
vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go
generated
vendored
18
vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go
generated
vendored
@ -104,6 +104,7 @@ var (
|
|||||||
NodeConditionRemoved condition.Cond = "Removed"
|
NodeConditionRemoved condition.Cond = "Removed"
|
||||||
NodeConditionConfigSaved condition.Cond = "Saved"
|
NodeConditionConfigSaved condition.Cond = "Saved"
|
||||||
NodeConditionReady condition.Cond = "Ready"
|
NodeConditionReady condition.Cond = "Ready"
|
||||||
|
NodeConditionDrained condition.Cond = "Drained"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NodeCondition struct {
|
type NodeCondition struct {
|
||||||
@ -188,6 +189,7 @@ type NodeSpec struct {
|
|||||||
DesiredNodeLabels map[string]string `json:"desiredNodeLabels,omitempty"`
|
DesiredNodeLabels map[string]string `json:"desiredNodeLabels,omitempty"`
|
||||||
DesiredNodeAnnotations map[string]string `json:"desiredNodeAnnotations,omitempty"`
|
DesiredNodeAnnotations map[string]string `json:"desiredNodeAnnotations,omitempty"`
|
||||||
DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty"`
|
DesiredNodeUnschedulable string `json:"desiredNodeUnschedulable,omitempty"`
|
||||||
|
NodeDrainInput *NodeDrainInput `json:"nodeDrainInput,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeCommonParams struct {
|
type NodeCommonParams struct {
|
||||||
@ -272,3 +274,19 @@ type PublicEndpoint struct {
|
|||||||
// True when endpoint is exposed on every node
|
// True when endpoint is exposed on every node
|
||||||
AllNodes bool `json:"allNodes" norman:"nocreate,noupdate"`
|
AllNodes bool `json:"allNodes" norman:"nocreate,noupdate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NodeDrainInput struct {
|
||||||
|
// Drain node even if there are pods not managed by a ReplicationController, Job, or DaemonSet
|
||||||
|
// Drain will not proceed without Force set to true if there are such pods
|
||||||
|
Force bool `json:"force,omitempty"`
|
||||||
|
// If there are DaemonSet-managed pods, drain will not proceed without IgnoreDaemonSets set to true
|
||||||
|
// (even when set to true, kubectl won't delete pods - so setting default to true)
|
||||||
|
IgnoreDaemonSets bool `json:"ignoreDaemonSets,omitempty" norman:"default=true"`
|
||||||
|
// Continue even if there are pods using emptyDir
|
||||||
|
DeleteLocalData bool `json:"deleteLocalData,omitempty"`
|
||||||
|
//Period of time in seconds given to each pod to terminate gracefully.
|
||||||
|
// If negative, the default value specified in the pod will be used
|
||||||
|
GracePeriod int `json:"gracePeriod,omitempty" norman:"default=-1"`
|
||||||
|
// Time to wait (in seconds) before giving up for one try
|
||||||
|
Timeout int `json:"timeout" norman:"min=1,max=10800,default=60"`
|
||||||
|
}
|
||||||
|
37
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go
generated
vendored
37
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go
generated
vendored
@ -153,6 +153,16 @@ func (in *AlertSystemImages) DeepCopy() *AlertSystemImages {
|
|||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *AmazonElasticContainerServiceConfig) DeepCopyInto(out *AmazonElasticContainerServiceConfig) {
|
func (in *AmazonElasticContainerServiceConfig) DeepCopyInto(out *AmazonElasticContainerServiceConfig) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.Subnets != nil {
|
||||||
|
in, out := &in.Subnets, &out.Subnets
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
if in.SecurityGroups != nil {
|
||||||
|
in, out := &in.SecurityGroups, &out.SecurityGroups
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1383,7 +1393,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
|||||||
*out = nil
|
*out = nil
|
||||||
} else {
|
} else {
|
||||||
*out = new(AmazonElasticContainerServiceConfig)
|
*out = new(AmazonElasticContainerServiceConfig)
|
||||||
**out = **in
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -3168,6 +3178,22 @@ func (in *NodeCondition) DeepCopy() *NodeCondition {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *NodeDrainInput) DeepCopyInto(out *NodeDrainInput) {
|
||||||
|
*out = *in
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDrainInput.
|
||||||
|
func (in *NodeDrainInput) DeepCopy() *NodeDrainInput {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(NodeDrainInput)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *NodeDriver) DeepCopyInto(out *NodeDriver) {
|
func (in *NodeDriver) DeepCopyInto(out *NodeDriver) {
|
||||||
*out = *in
|
*out = *in
|
||||||
@ -3444,6 +3470,15 @@ func (in *NodeSpec) DeepCopyInto(out *NodeSpec) {
|
|||||||
(*out)[key] = val
|
(*out)[key] = val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.NodeDrainInput != nil {
|
||||||
|
in, out := &in.NodeDrainInput, &out.NodeDrainInput
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(NodeDrainInput)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
vendor/github.com/rancher/types/vendor.conf
generated
vendored
4
vendor/github.com/rancher/types/vendor.conf
generated
vendored
@ -5,6 +5,4 @@ k8s.io/kubernetes v1.10.5
|
|||||||
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
|
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
|
||||||
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
||||||
|
|
||||||
|
github.com/rancher/norman c032c4611f2eec1652ef37d254f0e8ccf90c80aa
|
||||||
|
|
||||||
github.com/rancher/norman 57e8282a33f04091e30df7700bd328f3205c1189
|
|
||||||
|
Loading…
Reference in New Issue
Block a user