KubectlDiffSettings Class

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
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
NullableContextAttribute
NullableAttribute
CompilerGeneratedAttribute

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<bool>
--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<bool>
--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<bool>
-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<bool>
--server-side If true, apply runs in the server instead of the client.
ShowManagedFields Nullable<bool>
--show-managed-fields If true, include managed fields in the diff.

Extension Methods

Name Value Summary
Dump<KubectlDiffSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<KubectlDiffSettings>(KubectlDiffSettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<KubectlDiffSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<KubectlDiffSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<KubectlDiffSettings>(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<KubectlDiffSettings>(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
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin