From b5dfa49e32324f595e9419e6ce7e3699aee49832 Mon Sep 17 00:00:00 2001 From: danielqsj Date: Thu, 21 Feb 2019 07:06:56 -0700 Subject: [PATCH] update k8s.io/utils to fix keymutex issues --- Godeps/Godeps.json | 26 +++++++++++++------------- vendor/k8s.io/utils/keymutex/hashed.go | 8 ++++---- vendor/k8s.io/utils/nsenter/OWNERS | 2 ++ vendor/k8s.io/utils/pointer/OWNERS | 1 + 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index eaa363d653..2a6bd248ba 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -4196,55 +4196,55 @@ }, { "ImportPath": "k8s.io/utils/buffer", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/clock", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/exec", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/exec/testing", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/integer", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/io", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/keymutex", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/net", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/nsenter", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/path", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/pointer", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/strings", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "k8s.io/utils/trace", - "Rev": "ed37f7428a91fc2a81070808937195dcd46d320e" + "Rev": "c2654d5206da6b7b6ace12841e8f359bb89b443c" }, { "ImportPath": "sigs.k8s.io/kustomize/pkg/commands/build", diff --git a/vendor/k8s.io/utils/keymutex/hashed.go b/vendor/k8s.io/utils/keymutex/hashed.go index 54e28b0090..4ddb00867f 100644 --- a/vendor/k8s.io/utils/keymutex/hashed.go +++ b/vendor/k8s.io/utils/keymutex/hashed.go @@ -42,17 +42,17 @@ type hashedKeyMutex struct { // Acquires a lock associated with the specified ID. func (km *hashedKeyMutex) LockKey(id string) { - km.mutexes[km.hash(id)%len(km.mutexes)].Lock() + km.mutexes[km.hash(id)%uint32(len(km.mutexes))].Lock() } // Releases the lock associated with the specified ID. func (km *hashedKeyMutex) UnlockKey(id string) error { - km.mutexes[km.hash(id)%len(km.mutexes)].Unlock() + km.mutexes[km.hash(id)%uint32(len(km.mutexes))].Unlock() return nil } -func (km *hashedKeyMutex) hash(id string) int { +func (km *hashedKeyMutex) hash(id string) uint32 { h := fnv.New32a() h.Write([]byte(id)) - return int(h.Sum32()) + return h.Sum32() } diff --git a/vendor/k8s.io/utils/nsenter/OWNERS b/vendor/k8s.io/utils/nsenter/OWNERS index c4f27cb438..46895cbda8 100644 --- a/vendor/k8s.io/utils/nsenter/OWNERS +++ b/vendor/k8s.io/utils/nsenter/OWNERS @@ -1,3 +1,5 @@ +# See the OWNERS docs at https://go.k8s.io/owners + reviewers: - jsafrane - msau42 diff --git a/vendor/k8s.io/utils/pointer/OWNERS b/vendor/k8s.io/utils/pointer/OWNERS index 2f328f4c90..0d6392752a 100644 --- a/vendor/k8s.io/utils/pointer/OWNERS +++ b/vendor/k8s.io/utils/pointer/OWNERS @@ -1,4 +1,5 @@ # See the OWNERS docs at https://go.k8s.io/owners + approvers: - apelisse - stewart-yu