Documentation ¶
Overview ¶
Copyright © 2019 Hua Zhihao <ihuazhihao@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPodCompleted = fmt.Errorf("pod ran to completion")
ErrPodCompleted is returned by PodRunning or PodContainerRunning to indicate that the pod has already reached completed state.
Functions ¶
Types ¶
type DefaultRemoteExecutor ¶
type DefaultRemoteExecutor struct{}
DefaultRemoteExecutor is the standard implementation of remote command execution
func (*DefaultRemoteExecutor) Execute ¶
func (*DefaultRemoteExecutor) Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue remotecommand.TerminalSizeQueue) error
type RemoteExecutor ¶
type RemoteExecutor interface {
Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool, terminalSizeQueue remotecommand.TerminalSizeQueue) error
}
RemoteExecutor defines the interface accepted by the Spy command - provided for test stubbing
type SpyOptions ¶
type SpyOptions struct { exec.StreamOptions Resources []string ParentCommandName string EnableSuggestedCmdUsage bool Builder func() *resource.Builder ExecutablePodFn polymorphichelpers.AttachablePodForObjectFunc DynamicClient dynamic.Interface Pod *corev1.Pod Executor RemoteExecutor PodClient corev1client.PodsGetter GetPodTimeout time.Duration Config *restclient.Config // contains filtered or unexported fields }
SpyOptions declare the arguments accepted by the Spy command
func (*SpyOptions) Complete ¶
Complete verifies command line arguments and loads data from the command environment
func (*SpyOptions) Run1 ¶
func (o *SpyOptions) Run1() error
Run executes a validated remote execution against a pod.
func (*SpyOptions) Validate ¶
func (o *SpyOptions) Validate() error
Validate checks that the provided spy options are specified.