mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-14 07:13:53 +01:00
refact(deps): bump k8s and client-go deps to version v0.20.2 (#294)
Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
This commit is contained in:
parent
533e17a9aa
commit
b1aa6ab51a
2196 changed files with 306727 additions and 251810 deletions
28
vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go
generated
vendored
28
vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go
generated
vendored
|
|
@ -132,7 +132,7 @@ func rewriteOptionalMethods(decl ast.Decl, isOptional OptionalFunc) {
|
|||
switch t.Name.Name {
|
||||
case "Unmarshal":
|
||||
ast.Walk(&optionalItemsVisitor{}, t.Body)
|
||||
case "MarshalTo", "Size", "String":
|
||||
case "MarshalTo", "Size", "String", "MarshalToSizedBuffer":
|
||||
ast.Walk(&optionalItemsVisitor{}, t.Body)
|
||||
fallthrough
|
||||
case "Marshal":
|
||||
|
|
@ -375,6 +375,21 @@ func RewriteTypesWithProtobufStructTags(name string, structTags map[string]map[s
|
|||
})
|
||||
}
|
||||
|
||||
func getFieldName(expr ast.Expr, structname string) (name string, err error) {
|
||||
for {
|
||||
switch t := expr.(type) {
|
||||
case *ast.Ident:
|
||||
return t.Name, nil
|
||||
case *ast.SelectorExpr:
|
||||
return t.Sel.Name, nil
|
||||
case *ast.StarExpr:
|
||||
expr = t.X
|
||||
default:
|
||||
return "", fmt.Errorf("unable to get name for tag from struct %q, field %#v", structname, t)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, toCopy []string) []error {
|
||||
var errs []error
|
||||
t, ok := decl.(*ast.GenDecl)
|
||||
|
|
@ -403,14 +418,11 @@ func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, to
|
|||
for i := range st.Fields.List {
|
||||
f := st.Fields.List[i]
|
||||
var name string
|
||||
var err error
|
||||
if len(f.Names) == 0 {
|
||||
switch t := f.Type.(type) {
|
||||
case *ast.Ident:
|
||||
name = t.Name
|
||||
case *ast.SelectorExpr:
|
||||
name = t.Sel.Name
|
||||
default:
|
||||
errs = append(errs, fmt.Errorf("unable to get name for tag from struct %q, field %#v", spec.Name.Name, t))
|
||||
name, err = getFieldName(f.Type, spec.Name.Name)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue