|
|
@ -147,8 +147,20 @@ type KubeClient interface {
|
|
|
|
UpdateWithOptions(namespace string, originalReader, modifiedReader io.Reader, opts kube.UpdateOptions) error
|
|
|
|
UpdateWithOptions(namespace string, originalReader, modifiedReader io.Reader, opts kube.UpdateOptions) error
|
|
|
|
|
|
|
|
|
|
|
|
Build(namespace string, reader io.Reader) (kube.Result, error)
|
|
|
|
Build(namespace string, reader io.Reader) (kube.Result, error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BuildUnstructured reads a stream of manifests from a reader and turns them into
|
|
|
|
|
|
|
|
// info objects. Manifests are not validated against the schema, but it will fail if
|
|
|
|
|
|
|
|
// any resoures types are not known by the apiserver.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// reader must contain a YAML stream (one or more YAML documents separated by "\n---\n").
|
|
|
|
BuildUnstructured(namespace string, reader io.Reader) (kube.Result, error)
|
|
|
|
BuildUnstructured(namespace string, reader io.Reader) (kube.Result, error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Validate reads a stream of manifests from a reader and validates them against
|
|
|
|
|
|
|
|
// the schema from the apiserver. It returns an error if any of the manifests does not validate.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// reader must contain a YAML stream (one or more YAML documents separated by "\n---\n").
|
|
|
|
|
|
|
|
Validate(namespace string, reader io.Reader) error
|
|
|
|
|
|
|
|
|
|
|
|
// WaitAndGetCompletedPodPhase waits up to a timeout until a pod enters a completed phase
|
|
|
|
// WaitAndGetCompletedPodPhase waits up to a timeout until a pod enters a completed phase
|
|
|
|
// and returns said phase (PodSucceeded or PodFailed qualify).
|
|
|
|
// and returns said phase (PodSucceeded or PodFailed qualify).
|
|
|
|
WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (v1.PodPhase, error)
|
|
|
|
WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (v1.PodPhase, error)
|
|
|
@ -214,6 +226,11 @@ func (p *PrintingKubeClient) BuildUnstructured(ns string, reader io.Reader) (kub
|
|
|
|
return []*resource.Info{}, nil
|
|
|
|
return []*resource.Info{}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Validate implements KubeClient Validate
|
|
|
|
|
|
|
|
func (p *PrintingKubeClient) Validate(ns string, reader io.Reader) error {
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase.
|
|
|
|
// WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase.
|
|
|
|
func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (v1.PodPhase, error) {
|
|
|
|
func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (v1.PodPhase, error) {
|
|
|
|
_, err := io.Copy(p.Out, reader)
|
|
|
|
_, err := io.Copy(p.Out, reader)
|
|
|
|