update dependencies (#6267)

Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
hongming
2024-11-06 10:27:06 +08:00
committed by GitHub
parent faf255a084
commit cfebd96a1f
4263 changed files with 341374 additions and 132036 deletions

View File

@@ -1,7 +1,8 @@
package rules
import (
"k8s.io/gengo/types"
"k8s.io/gengo/v2"
"k8s.io/gengo/v2/types"
)
const ListTypeIDLTag = "listType"
@@ -24,7 +25,7 @@ func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) {
switch t.Kind {
case types.Struct:
for _, m := range t.Members {
hasListType := types.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] != nil
hasListType := gengo.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] != nil
if m.Name == "Items" && m.Type.Kind == types.Slice && hasNamedMember(t, "ListMeta") {
if hasListType {
@@ -33,7 +34,8 @@ func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) {
continue
}
if m.Type.Kind == types.Slice && !hasListType {
// All slice fields must have a list-type tag except []byte
if m.Type.Kind == types.Slice && m.Type.Elem != types.Byte && !hasListType {
fields = append(fields, m.Name)
continue
}

View File

@@ -22,7 +22,7 @@ import (
"k8s.io/kube-openapi/pkg/util/sets"
"k8s.io/gengo/types"
"k8s.io/gengo/v2/types"
)
var (
@@ -135,7 +135,7 @@ func namesMatch(goName, jsonName string) bool {
if !isAllowedName(goName) || !isAllowedName(jsonName) {
return false
}
if strings.ToLower(goName) != strings.ToLower(jsonName) {
if !strings.EqualFold(goName, jsonName) {
return false
}
// Go field names must be CamelCase. JSON field names must be camelCase.

View File

@@ -20,7 +20,7 @@ import (
"reflect"
"strings"
"k8s.io/gengo/types"
"k8s.io/gengo/v2/types"
)
// OmitEmptyMatchCase implements APIRule interface.