import "k8s.io/kubernetes/staging/src/k8s.io/kubectl/pkg/cmd/diff"
type DiffOptions struct { FilenameOptions resource.FilenameOptions ServerSideApply bool FieldManager string ForceConflicts bool Selector string OpenAPISchema openapi.Resources DiscoveryClient discovery.DiscoveryInterface DynamicClient dynamic.Interface DryRunVerifier *resource.DryRunVerifier CmdNamespace string EnforceNamespace bool Builder *resource.Builder Diff *DiffProgram }
func NewDiffOptions(ioStreams genericclioptions.IOStreams) *DiffOptions
func (o *DiffOptions) Run() error
RunDiff uses the factory to parse file arguments, find the version to diff, and find each Info object for each files, and runs against the differ.
type DiffProgram struct { Exec exec.Interface genericclioptions.IOStreams }
DiffProgram finds and run the diff program. The value of KUBECTL_EXTERNAL_DIFF environment variable will be used a diff program. By default, `diff(1)` will be used.
func (d *DiffProgram) Run(from, to string) error
Run runs the detected diff program. `from` and `to` are the directory to diff.
DiffVersion gets the proper version of objects, and aggregate them into a directory.
func NewDiffVersion(name string) (*DiffVersion, error)
NewDiffVersion creates a new DiffVersion with the named version.
func (v *DiffVersion) Print(obj Object, printer Printer) error
Print prints the object using the printer into a new file in the directory.
type Differ struct { From *DiffVersion To *DiffVersion }
Differ creates two DiffVersion and diffs them.
Diff diffs to versions of a specific object, and print both versions to directories.
func (d *Differ) Run(diff *DiffProgram) error
Run runs the diff program against both directories.
TearDown removes both temporary directories recursively.
Directory creates a new temp directory, and allows to easily create new files.
CreateDirectory does create the actual disk directory, and return a new representation of it.
Delete removes the directory recursively.
NewFile creates a new file in the directory.
type InfoObject struct { LocalObj runtime.Object Info *resource.Info Encoder runtime.Encoder OpenAPI openapi.Resources Force bool ServerSideApply bool FieldManager string ForceConflicts bool genericclioptions.IOStreams }
InfoObject is an implementation of the Object interface. It gets all the information from the Info object.
func (obj InfoObject) Live() runtime.Object
Returns the live version of the object
func (obj InfoObject) Merged() (runtime.Object, error)
Returns the "merged" object, as it would look like if applied or created.
func (obj InfoObject) Name() string
Object is an interface that let's you retrieve multiple version of it.
type Printer struct{}
Printer is used to print an object.
Print the object inside the writer w.
Package diff imports 29 packages (graph). Updated 2020-12-10. Refresh now. Tools for package owners.