github.com/grahambrereton-form3/tilt@v0.10.18/internal/k8s/exploding_client.go (about)

     1  package k8s
     2  
     3  import (
     4  	"context"
     5  	"io"
     6  	"time"
     7  
     8  	"github.com/docker/distribution/reference"
     9  	"github.com/pkg/errors"
    10  	v1 "k8s.io/api/core/v1"
    11  	"k8s.io/apimachinery/pkg/labels"
    12  	"k8s.io/apimachinery/pkg/watch"
    13  
    14  	"github.com/windmilleng/tilt/internal/container"
    15  	"github.com/windmilleng/tilt/pkg/model"
    16  )
    17  
    18  var _ Client = &explodingClient{}
    19  
    20  type explodingClient struct {
    21  	err error
    22  }
    23  
    24  func (ec *explodingClient) Upsert(ctx context.Context, entities []K8sEntity) ([]K8sEntity, error) {
    25  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    26  }
    27  
    28  func (ec *explodingClient) Delete(ctx context.Context, entities []K8sEntity) error {
    29  	return errors.Wrap(ec.err, "could not set up k8s client")
    30  }
    31  
    32  func (ec *explodingClient) GetByReference(ctx context.Context, ref v1.ObjectReference) (K8sEntity, error) {
    33  	return K8sEntity{}, errors.Wrap(ec.err, "could not set up k8s client")
    34  }
    35  
    36  func (ec *explodingClient) PodsWithImage(ctx context.Context, image reference.NamedTagged, n Namespace, lp []model.LabelPair) ([]v1.Pod, error) {
    37  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    38  }
    39  
    40  func (ec *explodingClient) PollForPodsWithImage(ctx context.Context, image reference.NamedTagged, n Namespace, lp []model.LabelPair, timeout time.Duration) ([]v1.Pod, error) {
    41  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    42  }
    43  
    44  func (ec *explodingClient) PodByID(ctx context.Context, podID PodID, n Namespace) (*v1.Pod, error) {
    45  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    46  }
    47  
    48  func (ec *explodingClient) WatchPod(ctx context.Context, pod *v1.Pod) (watch.Interface, error) {
    49  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    50  }
    51  
    52  func (ec *explodingClient) ContainerLogs(ctx context.Context, podID PodID, cName container.Name, n Namespace, startTime time.Time) (io.ReadCloser, error) {
    53  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    54  }
    55  
    56  func (ec *explodingClient) CreatePortForwarder(ctx context.Context, namespace Namespace, podID PodID, optionalLocalPort, remotePort int, host string) (PortForwarder, error) {
    57  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    58  }
    59  
    60  func (ec *explodingClient) WatchPods(ctx context.Context, lps labels.Selector) (<-chan *v1.Pod, error) {
    61  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    62  }
    63  
    64  func (ec *explodingClient) WatchServices(ctx context.Context, lps labels.Selector) (<-chan *v1.Service, error) {
    65  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    66  }
    67  
    68  func (ec *explodingClient) WatchEvents(ctx context.Context) (<-chan *v1.Event, error) {
    69  	return nil, errors.Wrap(ec.err, "could not set up k8s client")
    70  }
    71  
    72  func (ec *explodingClient) ConnectedToCluster(ctx context.Context) error {
    73  	return errors.Wrap(ec.err, "could not set up k8s client")
    74  }
    75  
    76  func (ec *explodingClient) ContainerRuntime(ctx context.Context) container.Runtime {
    77  	return container.RuntimeUnknown
    78  }
    79  
    80  func (ec *explodingClient) PrivateRegistry(ctx context.Context) container.Registry {
    81  	return ""
    82  }
    83  
    84  func (ec *explodingClient) Exec(ctx context.Context, podID PodID, cName container.Name, n Namespace, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {
    85  	return errors.Wrap(ec.err, "could not set up k8s client")
    86  }