change structure of client

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
pull/30616/head
Austin Abro 2 years ago committed by Andrea Tartaglia
parent 16c6df0c45
commit f3a8e56929
No known key found for this signature in database

@ -29,6 +29,11 @@ import (
// //
// A KubernetesClient must be concurrency safe. // A KubernetesClient must be concurrency safe.
type Interface interface { type Interface interface {
ResourceManager
Waiter
}
type ResourceManager interface {
// Create creates one or more resources. // Create creates one or more resources.
Create(resources ResourceList, options ...ClientCreateOption) (*Result, error) Create(resources ResourceList, options ...ClientCreateOption) (*Result, error)
@ -67,7 +72,6 @@ type Waiter interface {
// Update updates one or more resources or creates the resource // Update updates one or more resources or creates the resource
// if it doesn't exist. // if it doesn't exist.
Update(original, target ResourceList, force bool) (*Result, error) Update(original, target ResourceList, force bool) (*Result, error)
// WatchUntilReady watches the resources given and waits until it is ready. // WatchUntilReady watches the resources given and waits until it is ready.
// //
// This method is mainly for hook implementations. It watches for a resource to // This method is mainly for hook implementations. It watches for a resource to

@ -98,7 +98,7 @@ func TestRunHealthChecks(t *testing.T) {
err = fakeClient.Tracker().Create(podGVR, pod, pod.GetNamespace()) err = fakeClient.Tracker().Create(podGVR, pod, pod.GetNamespace())
require.NoError(t, err) require.NoError(t, err)
} }
c.waiter = &kstatusWaiter{ c.Waiter = &kstatusWaiter{
sw: statusWatcher, sw: statusWatcher,
log: c.Log, log: c.Log,
} }

Loading…
Cancel
Save