Merge pull request #70995 from stewart-yu/stewart-sample-controller-redurabce-import

remove duplicated import

Kubernetes-commit: 163b54dc4d615bc34bf14c74e9230b733d8b4565
This commit is contained in:
Kubernetes Publisher 2018-11-29 11:16:39 -08:00
commit 65d042cac5
2 changed files with 51 additions and 52 deletions

84
Godeps/Godeps.json generated
View File

@ -304,171 +304,171 @@
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "d4f83ca2e2604a4c3444295a8aca957c3a784f06"
"Rev": "4a9a8137c0a17bc4594f544987b3f0d48b2e3d3a"
},
{
"ImportPath": "k8s.io/client-go/discovery",

View File

@ -25,7 +25,6 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
appsinformers "k8s.io/client-go/informers/apps/v1"
@ -150,7 +149,7 @@ func NewController(
// is closed, at which point it will shutdown the workqueue and wait for
// workers to finish processing their current work items.
func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
defer runtime.HandleCrash()
defer utilruntime.HandleCrash()
defer c.workqueue.ShutDown()
// Start the informer factories to begin populating the informer caches
@ -213,7 +212,7 @@ func (c *Controller) processNextWorkItem() bool {
// Forget here else we'd go into a loop of attempting to
// process a work item that is invalid.
c.workqueue.Forget(obj)
runtime.HandleError(fmt.Errorf("expected string in workqueue but got %#v", obj))
utilruntime.HandleError(fmt.Errorf("expected string in workqueue but got %#v", obj))
return nil
}
// Run the syncHandler, passing it the namespace/name string of the
@ -231,7 +230,7 @@ func (c *Controller) processNextWorkItem() bool {
}(obj)
if err != nil {
runtime.HandleError(err)
utilruntime.HandleError(err)
return true
}
@ -245,7 +244,7 @@ func (c *Controller) syncHandler(key string) error {
// Convert the namespace/name string into a distinct namespace and name
namespace, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
runtime.HandleError(fmt.Errorf("invalid resource key: %s", key))
utilruntime.HandleError(fmt.Errorf("invalid resource key: %s", key))
return nil
}
@ -255,7 +254,7 @@ func (c *Controller) syncHandler(key string) error {
// The Foo resource may no longer exist, in which case we stop
// processing.
if errors.IsNotFound(err) {
runtime.HandleError(fmt.Errorf("foo '%s' in work queue no longer exists", key))
utilruntime.HandleError(fmt.Errorf("foo '%s' in work queue no longer exists", key))
return nil
}
@ -267,7 +266,7 @@ func (c *Controller) syncHandler(key string) error {
// We choose to absorb the error here as the worker would requeue the
// resource otherwise. Instead, the next time the resource is updated
// the resource will be queued again.
runtime.HandleError(fmt.Errorf("%s: deployment name must be specified", key))
utilruntime.HandleError(fmt.Errorf("%s: deployment name must be specified", key))
return nil
}
@ -340,7 +339,7 @@ func (c *Controller) enqueueFoo(obj interface{}) {
var key string
var err error
if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil {
runtime.HandleError(err)
utilruntime.HandleError(err)
return
}
c.workqueue.AddRateLimited(key)
@ -357,12 +356,12 @@ func (c *Controller) handleObject(obj interface{}) {
if object, ok = obj.(metav1.Object); !ok {
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
runtime.HandleError(fmt.Errorf("error decoding object, invalid type"))
utilruntime.HandleError(fmt.Errorf("error decoding object, invalid type"))
return
}
object, ok = tombstone.Obj.(metav1.Object)
if !ok {
runtime.HandleError(fmt.Errorf("error decoding object tombstone, invalid type"))
utilruntime.HandleError(fmt.Errorf("error decoding object tombstone, invalid type"))
return
}
klog.V(4).Infof("Recovered deleted object '%s' from tombstone", object.GetName())