go.mod: bump client-go and api machinerie
I had to run `make generate`. Some API functions got additional parameters `Options` and `Context`. I used empty options and `context.TODO()` for now. Signed-off-by: leonnicolas <leonloechner@gmx.de>
This commit is contained in:
53
vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go
generated
vendored
Normal file
53
vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"k8s.io/gengo/types"
|
||||
)
|
||||
|
||||
const ListTypeIDLTag = "listType"
|
||||
|
||||
// ListTypeMissing implements APIRule interface.
|
||||
// A list type is required for inlined list.
|
||||
type ListTypeMissing struct{}
|
||||
|
||||
// Name returns the name of APIRule
|
||||
func (l *ListTypeMissing) Name() string {
|
||||
return "list_type_missing"
|
||||
}
|
||||
|
||||
// Validate evaluates API rule on type t and returns a list of field names in
|
||||
// the type that violate the rule. Empty field name [""] implies the entire
|
||||
// type violates the rule.
|
||||
func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) {
|
||||
fields := make([]string, 0)
|
||||
|
||||
switch t.Kind {
|
||||
case types.Struct:
|
||||
for _, m := range t.Members {
|
||||
hasListType := types.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] != nil
|
||||
|
||||
if m.Name == "Items" && m.Type.Kind == types.Slice && hasNamedMember(t, "ListMeta") {
|
||||
if hasListType {
|
||||
fields = append(fields, m.Name)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Type.Kind == types.Slice && !hasListType {
|
||||
fields = append(fields, m.Name)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fields, nil
|
||||
}
|
||||
|
||||
func hasNamedMember(t *types.Type, name string) bool {
|
||||
for _, m := range t.Members {
|
||||
if m.Name == name {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
2
vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go
generated
vendored
2
vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go
generated
vendored
@@ -155,7 +155,7 @@ func namesMatch(goName, jsonName string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// isCaptical returns true if one character is capital
|
||||
// isCapital returns true if one character is capital
|
||||
func isCapital(b byte) bool {
|
||||
return b >= 'A' && b <= 'Z'
|
||||
}
|
||||
|
Reference in New Issue
Block a user