extending factory to enable getting a watcher

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

@ -51,6 +51,7 @@ import (
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"

@ -616,12 +616,17 @@ func TestPerform(t *testing.T) {
}
}
// Likely it is not possible to get this test to work with kstatus given that it seems
// kstatus is not making constant get checks on the resources and is instead waiting for events
// Potentially the test could be reworked to make the pods after five seconds
// would need this ->
func TestWait(t *testing.T) {
podList := newPodList("starfish", "otter", "squid")
var created *time.Time
c := newTestClient(t)
c.Factory.(*cmdtesting.TestFactory).ClientConfigVal = cmdtesting.DefaultClientConfig()
c.Factory.(*cmdtesting.TestFactory).Client = &fake.RESTClient{
NegotiatedSerializer: unstructuredSerializer,
Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {

@ -17,6 +17,7 @@ limitations under the License.
package kube // import "helm.sh/helm/v4/pkg/kube"
import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
@ -46,6 +47,9 @@ type Factory interface {
// KubernetesClientSet gives you back an external clientset
KubernetesClientSet() (*kubernetes.Clientset, error)
// Returns a RESTClient for accessing Kubernetes resources or an error.
RESTClient() (*restclient.RESTClient, error)
// NewBuilder returns an object that assists in loading objects from both disk and the server
// and which implements the common patterns for CLI interactions with generic resources.
NewBuilder() *resource.Builder

Loading…
Cancel
Save