mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-25 22:51:40 +00:00
Merge pull request #59828 from krousey/shared_informer_race
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix a race condition in SharedInformer **What this PR does / why we need it**: This fixes a race condition that can occur in the `sharedIndexInformer` **Which issue(s) this PR fixes**: Fixes #59822 **Release note**: ```release-note Fixed a race condition in k8s.io/client-go/tools/cache.SharedInformer that could violate the sequential delivery guarantee and cause panics on shutdown. ``` Kubernetes-commit: 6590ea6d5d50700d34255b1e037b2702ad26b7fc
This commit is contained in:
commit
a82b3b75b2
164
Godeps/Godeps.json
generated
164
Godeps/Godeps.json
generated
@ -284,331 +284,331 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1",
|
"ImportPath": "k8s.io/api/apps/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1beta1",
|
"ImportPath": "k8s.io/api/apps/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/apps/v1beta2",
|
"ImportPath": "k8s.io/api/apps/v1beta2",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authentication/v1",
|
"ImportPath": "k8s.io/api/authentication/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
"ImportPath": "k8s.io/api/authentication/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authorization/v1",
|
"ImportPath": "k8s.io/api/authorization/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
"ImportPath": "k8s.io/api/authorization/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v1",
|
"ImportPath": "k8s.io/api/autoscaling/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v1",
|
"ImportPath": "k8s.io/api/batch/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v1beta1",
|
"ImportPath": "k8s.io/api/batch/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
"ImportPath": "k8s.io/api/batch/v2alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
"ImportPath": "k8s.io/api/certificates/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/core/v1",
|
"ImportPath": "k8s.io/api/core/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/events/v1beta1",
|
"ImportPath": "k8s.io/api/events/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
"ImportPath": "k8s.io/api/extensions/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
|
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/networking/v1",
|
"ImportPath": "k8s.io/api/networking/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/policy/v1beta1",
|
"ImportPath": "k8s.io/api/policy/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1",
|
"ImportPath": "k8s.io/api/rbac/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
"ImportPath": "k8s.io/api/rbac/v1alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
"ImportPath": "k8s.io/api/rbac/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
"ImportPath": "k8s.io/api/settings/v1alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1",
|
"ImportPath": "k8s.io/api/storage/v1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
"ImportPath": "k8s.io/api/storage/v1alpha1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api/storage/v1beta1",
|
"ImportPath": "k8s.io/api/storage/v1beta1",
|
||||||
"Rev": "2694da5be9c4ab4f3fd826112d4c3f71b8bf4b23"
|
"Rev": "0d0b2f481328d8bae556061a08a02175054059f4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/testing",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/testing",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
|
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced",
|
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
|
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
||||||
"Rev": "616b23029fa3dc3e0ccefd47963f5651a6543d94"
|
"Rev": "da3b134bab57ebf23dedfec7e0004614dd4b5a24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",
|
||||||
|
17
tools/cache/shared_informer.go
vendored
17
tools/cache/shared_informer.go
vendored
@ -335,7 +335,7 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv
|
|||||||
s.blockDeltas.Lock()
|
s.blockDeltas.Lock()
|
||||||
defer s.blockDeltas.Unlock()
|
defer s.blockDeltas.Unlock()
|
||||||
|
|
||||||
s.processor.addAndStartListener(listener)
|
s.processor.addListener(listener)
|
||||||
for _, item := range s.indexer.List() {
|
for _, item := range s.indexer.List() {
|
||||||
listener.add(addNotification{newObj: item})
|
listener.add(addNotification{newObj: item})
|
||||||
}
|
}
|
||||||
@ -373,6 +373,7 @@ func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type sharedProcessor struct {
|
type sharedProcessor struct {
|
||||||
|
listenersStarted bool
|
||||||
listenersLock sync.RWMutex
|
listenersLock sync.RWMutex
|
||||||
listeners []*processorListener
|
listeners []*processorListener
|
||||||
syncingListeners []*processorListener
|
syncingListeners []*processorListener
|
||||||
@ -380,20 +381,15 @@ type sharedProcessor struct {
|
|||||||
wg wait.Group
|
wg wait.Group
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *sharedProcessor) addAndStartListener(listener *processorListener) {
|
|
||||||
p.listenersLock.Lock()
|
|
||||||
defer p.listenersLock.Unlock()
|
|
||||||
|
|
||||||
p.addListenerLocked(listener)
|
|
||||||
p.wg.Start(listener.run)
|
|
||||||
p.wg.Start(listener.pop)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *sharedProcessor) addListener(listener *processorListener) {
|
func (p *sharedProcessor) addListener(listener *processorListener) {
|
||||||
p.listenersLock.Lock()
|
p.listenersLock.Lock()
|
||||||
defer p.listenersLock.Unlock()
|
defer p.listenersLock.Unlock()
|
||||||
|
|
||||||
p.addListenerLocked(listener)
|
p.addListenerLocked(listener)
|
||||||
|
if p.listenersStarted {
|
||||||
|
p.wg.Start(listener.run)
|
||||||
|
p.wg.Start(listener.pop)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *sharedProcessor) addListenerLocked(listener *processorListener) {
|
func (p *sharedProcessor) addListenerLocked(listener *processorListener) {
|
||||||
@ -424,6 +420,7 @@ func (p *sharedProcessor) run(stopCh <-chan struct{}) {
|
|||||||
p.wg.Start(listener.run)
|
p.wg.Start(listener.run)
|
||||||
p.wg.Start(listener.pop)
|
p.wg.Start(listener.pop)
|
||||||
}
|
}
|
||||||
|
p.listenersStarted = true
|
||||||
}()
|
}()
|
||||||
<-stopCh
|
<-stopCh
|
||||||
p.listenersLock.RLock()
|
p.listenersLock.RLock()
|
||||||
|
12
tools/cache/shared_informer_test.go
vendored
12
tools/cache/shared_informer_test.go
vendored
@ -251,3 +251,15 @@ func TestResyncCheckPeriod(t *testing.T) {
|
|||||||
t.Errorf("expected %d, got %d", e, a)
|
t.Errorf("expected %d, got %d", e, a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// verify that https://github.com/kubernetes/kubernetes/issues/59822 is fixed
|
||||||
|
func TestSharedInformerInitializationRace(t *testing.T) {
|
||||||
|
source := fcache.NewFakeControllerSource()
|
||||||
|
informer := NewSharedInformer(source, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer)
|
||||||
|
listener := newTestListener("raceListener", 0)
|
||||||
|
|
||||||
|
stop := make(chan struct{})
|
||||||
|
go informer.AddEventHandlerWithResyncPeriod(listener, listener.resyncPeriod)
|
||||||
|
go informer.Run(stop)
|
||||||
|
close(stop)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user