|
|
@ -128,11 +128,15 @@ type KubeClient interface {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// reader must contain a YAML stream (one or more YAML documents separated
|
|
|
|
// reader must contain a YAML stream (one or more YAML documents separated
|
|
|
|
// by "\n---\n").
|
|
|
|
// by "\n---\n").
|
|
|
|
//
|
|
|
|
|
|
|
|
// config is optional. If nil, the client will use its existing configuration.
|
|
|
|
|
|
|
|
// If set, the client will override its default configuration with the
|
|
|
|
|
|
|
|
// passed in one.
|
|
|
|
|
|
|
|
Create(namespace string, reader io.Reader) error
|
|
|
|
Create(namespace string, reader io.Reader) error
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete destroys one or more resources.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// namespace must contain a valid existing namespace.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// reader must contain a YAML stream (one or more YAML documents separated
|
|
|
|
|
|
|
|
// by "\n---\n").
|
|
|
|
|
|
|
|
Delete(namespace string, reader io.Reader) error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// PrintingKubeClient implements KubeClient, but simply prints the reader to
|
|
|
|
// PrintingKubeClient implements KubeClient, but simply prints the reader to
|
|
|
@ -146,6 +150,10 @@ func (p *PrintingKubeClient) Create(ns string, r io.Reader) error {
|
|
|
|
_, err := io.Copy(p.Out, r)
|
|
|
|
_, err := io.Copy(p.Out, r)
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PrintingKubeClient) Delete(ns string, r io.Reader) error {
|
|
|
|
|
|
|
|
_, err := io.Copy(p.Out, r)
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Environment provides the context for executing a client request.
|
|
|
|
// Environment provides the context for executing a client request.
|
|
|
|
//
|
|
|
|
//
|
|
|
|