Skip to content

Commit

Permalink
Update Kubernetes v1.18.9 dependencies (#1552)
Browse files Browse the repository at this point in the history
Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm committed Oct 14, 2020
1 parent 3d1c72d commit 93e691e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -63,7 +63,7 @@ require (
k8s.io/client-go v0.18.9
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6
k8s.io/utils v0.0.0-20200414100711-2df71ebbae66
kmodules.xyz/client-go v0.0.0-20201008164401-74d81f261ec5
kmodules.xyz/client-go v0.0.0-20201013083546-b17c1e15f1a3
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4
kmodules.xyz/monitoring-agent-api v0.0.0-20201007104803-408a1ff2de8d
kmodules.xyz/webhook-runtime v0.0.0-20200922211931-8337935590de
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -1474,8 +1474,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
kmodules.xyz/client-go v0.0.0-20200922200830-63d86b6e5b63 h1:luKlEul8LMhyyftoZN34+vboL9MWAeQpSAUZxaLZBGg=
kmodules.xyz/client-go v0.0.0-20200922200830-63d86b6e5b63/go.mod h1:JZN34jqk6ZlR+QOnBPpnUVBab4rmfamqxfSvLaulBMY=
kmodules.xyz/client-go v0.0.0-20201007024140-3223988adf40/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
kmodules.xyz/client-go v0.0.0-20201008164401-74d81f261ec5 h1:mGySTT2dC8u2FQDUFbDLcOt7GM+IkXqlH2xzATyddKg=
kmodules.xyz/client-go v0.0.0-20201008164401-74d81f261ec5/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
kmodules.xyz/client-go v0.0.0-20201013083546-b17c1e15f1a3 h1:vP8h3s+JdqXQHhhmvoTgKZOtpraF4X1NxA/y4OFTn+I=
kmodules.xyz/client-go v0.0.0-20201013083546-b17c1e15f1a3/go.mod h1:pnRh7gtJ6ErPJQBkQeRlpD95KRtxhD4eGrYagZEU8RM=
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4 h1:NWWv+Qju8xzHZT9hIk1+BbgQtIytNOoCU4g4vqUmh3M=
kmodules.xyz/crd-schema-fuzz v0.0.0-20200922204806-c1426cd7fcf4/go.mod h1:WrO3fryNyFCgqqyWnwI89lnzWA7kN072Ehya7ELGfzE=
kmodules.xyz/monitoring-agent-api v0.0.0-20201007104803-408a1ff2de8d h1:HFdWHhAkJZpoyMkp0kayKPf896IEkI7fWIpeJK4sY1o=
Expand Down
37 changes: 18 additions & 19 deletions vendor/kmodules.xyz/client-go/meta/hash.go
Expand Up @@ -23,7 +23,6 @@ import (
"reflect"
"strconv"

"github.com/appscode/go/encoding/json/types"
"github.com/davecgh/go-spew/spew"
"github.com/fatih/structs"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -106,7 +105,7 @@ func MustAlreadyReconciled(o interface{}) bool {
}

func AlreadyReconciled(o interface{}) (bool, error) {
var generation, observedGeneration *types.IntHash
var generation, observedGeneration int64
var err error

switch obj := o.(type) {
Expand All @@ -120,36 +119,36 @@ func AlreadyReconciled(o interface{}) (bool, error) {
if err != nil {
return false, err
}
return observedGeneration.MatchGeneration(generation), nil
return observedGeneration == generation, nil
}

func extractGenerationFromUnstructured(obj *unstructured.Unstructured) (*types.IntHash, *types.IntHash, error) {
generation := types.IntHashForGeneration(obj.GetGeneration())

func extractGenerationFromUnstructured(obj *unstructured.Unstructured) (int64, int64, error) {
val, found, err := unstructured.NestedFieldNoCopy(obj.Object, "status", "observedGeneration")
if err != nil {
return nil, nil, err
return -1, -1, err
} else if !found {
return nil, nil, fmt.Errorf("status.observedGeneration is missing")
return obj.GetGeneration(), -1, nil
}
observedGeneration, err := types.ParseIntHash(val)

return generation, observedGeneration, err
observedGeneration, ok := val.(int64)
if !ok {
return -1, -1, fmt.Errorf("%s %s/%s status.observedGeneration %+v is not int64", obj.GroupVersionKind(), obj.GetNamespace(), obj.GetName(), val)
}
return obj.GetGeneration(), observedGeneration, nil
}

func extractGenerationFromObject(obj metav1.Object) (*types.IntHash, *types.IntHash, error) {
generation := types.IntHashForGeneration(obj.GetGeneration())

func extractGenerationFromObject(obj metav1.Object) (int64, int64, error) {
st := structs.New(obj)
fieldStatus, found := st.FieldOk("Status")
if !found {
return nil, nil, fmt.Errorf("status is missing")
return obj.GetGeneration(), -1, nil
}
fieldObsGen, found := fieldStatus.FieldOk("ObservedGeneration")
if !found {
return nil, nil, fmt.Errorf("status.observedGeneration is missing")
return obj.GetGeneration(), -1, nil
}
observedGeneration, err := types.ParseIntHash(fieldObsGen.Value())

return generation, observedGeneration, err
observedGeneration, ok := fieldObsGen.Value().(int64)
if !ok {
return -1, -1, fmt.Errorf("%s %s/%s status.observedGeneration %+v is not int64", reflect.TypeOf(obj).String(), obj.GetNamespace(), obj.GetName(), fieldObsGen.Value())
}
return obj.GetGeneration(), observedGeneration, nil
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Expand Up @@ -1205,7 +1205,7 @@ k8s.io/utils/net
k8s.io/utils/path
k8s.io/utils/pointer
k8s.io/utils/trace
# kmodules.xyz/client-go v0.0.0-20201008164401-74d81f261ec5
# kmodules.xyz/client-go v0.0.0-20201013083546-b17c1e15f1a3
kmodules.xyz/client-go
kmodules.xyz/client-go/admissionregistration/v1beta1
kmodules.xyz/client-go/apiextensions
Expand Down

0 comments on commit 93e691e

Please sign in to comment.