This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Kubectl.
Summary
Diff configurations specified by file name or stdin between the current online configuration, and the configuration as it would be if applied.
The output is always YAML.
KUBECTL_EXTERNAL_DIFF environment variable can be used to select your own diff command. Users can use external commands with params too, example: KUBECTL_EXTERNAL_DIFF="colordiff -N -u"
By default, the "diff" command available in your path will be run with the "-u" (unified diff) and "-N" (treat absent files as empty) options.
Exit status: 0 No differences were found. 1 Differences were found. >1 Kubectl or diff failed with an error.
Note: KUBECTL_EXTERNAL_DIFF, if used, is expected to follow that convention.
- Assembly
- Cake
.Kubectl .dll - Namespace
- Cake
.Kubectl - Base Types
-
- ToolSettings
- AutoToolSettings
graph BT
Type-->Base0["AutoToolSettings"]
click Base0 "/api/Cake.Kubectl/AutoToolSettings"
Base0-->Base1["ToolSettings"]
Type["KubectlDiffSettings"]
class Type type-node
Syntax
public sealed class KubectlDiffSettings : AutoToolSettings
Examples
# Diff resources included in pod.json
kubectl diff -f pod.json
# Diff file read from stdin
cat service.yaml | kubectl diff -f -
Attributes
Type | Description |
---|---|
Nullable |
|
NullableAttribute | |
Compiler |
Constructors
Name | Summary |
---|---|
KubectlDiffSettings |
Properties
Name | Value | Summary |
---|---|---|
FieldManager | string |
--field-manager
Name of the manager used to track field ownership.
|
Filename | string |
-f, --filename
Filename, directory, or URL to files contains the configuration to diff
|
ForceConflicts | Nullable |
--force-conflicts
If true, server-side apply will force the changes against conflicts.
|
Kustomize | string |
-k, --kustomize
Process the kustomization directory. This flag can't be used together with -f or -R.
|
Prune | Nullable |
--prune
Include resources that would be deleted by pruning. Can be used with -l and default shows all resources would be pruned
|
PruneAllowlist | string |
--prune-allowlist
Overwrite the default whitelist with <group/version/kind> for --prune
|
Recursive | Nullable |
-R, --recursive
Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
|
Selector | string |
-l, --selector
Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
|
ServerSide | Nullable |
--server-side
If true, apply runs in the server instead of the client.
|
ShowManagedFields | Nullable |
--show-managed-fields
If true, include managed fields in the diff.
|
Extension Methods
Name | Value | Summary |
---|---|---|
Dump |
string |
Get a basic string representation of specified object.
From LoggingExtensions
Requires the Cake.Incubator addin
|
IsIn |
bool |
Checks if the source is contained in a list
From EnumerableExtensions
Requires the Cake.Incubator addin
|
NotNull |
void |
From IssuesArgumentChecks
Requires the Cake.Issues addin
|
NotNull |
void |
Throws an exception if the specified parameter's value is null.
From Extensions
Requires the Cake.Ftp addin
|
ThrowIfNull |
T |
Throws a
System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
ThrowIfNull |
T |
Throws a
System.ArgumentNullException if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
ToDictionary |
IDictionary |
From ObjectHelpers
Requires the Cake.DeployParams addin
|
To |
string |
From StringExtensions
Requires the Cake.Issues addin
|