KubectlCpSettings Class

Summary

Copy files and directories to and from containers.
Assembly
Cake.Kubectl.dll
Namespace
Cake.Kubectl
Base Types
graph BT Type-->Base0["AutoToolSettings"] click Base0 "/api/Cake.Kubectl/AutoToolSettings" Base0-->Base1["ToolSettings"] Type["KubectlCpSettings"] class Type type-node

Syntax

public sealed class KubectlCpSettings : AutoToolSettings

Examples

# !!!Important Note!!! # Requires that the 'tar' binary is present in your container # image. If 'tar' is not present, 'kubectl cp' will fail. # # For advanced use cases, such as symlinks, wildcard expansion or # file mode preservation, consider using 'kubectl exec'. # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace> tar cf - /tmp/foo | kubectl exec -i -n <some-namespace> <some-pod> -- tar xf - -C /tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally kubectl exec -n <some-namespace> <some-pod> -- tar cf - /tmp/foo | tar xf - -C /tmp/bar # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container kubectl cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container> # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace> kubectl cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar

Attributes

Type Description
NullableContextAttribute
NullableAttribute
CompilerGeneratedAttribute

Constructors

Name Summary
KubectlCpSettings()

Properties

Name Value Summary
Container string
-c, --container Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen
NoPreserve Nullable<bool>
--no-preserve The copied file/directory's ownership and permissions will not be preserved in the container
Retries string
--retries Set number of retries to complete a copy operation from a container. Specify 0 to disable or any negative value for infinite retrying. The default is 0 (no retry).

Extension Methods

Name Value Summary
Dump<KubectlCpSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<KubectlCpSettings>(KubectlCpSettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<KubectlCpSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<KubectlCpSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
ThrowIfNull<KubectlCpSettings>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<KubectlCpSettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin