MCPcopy
hub / github.com/kubernetes/kubectl / encodeToJSON

Function encodeToJSON

pkg/cmd/util/editor/editoptions.go:608–618  ·  view source on GitHub ↗
(obj runtime.Unstructured)

Source from the content-addressed store, hash-verified

606}
607
608func encodeToJSON(obj runtime.Unstructured) ([]byte, error) {
609 serialization, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj)
610 if err != nil {
611 return nil, err
612 }
613 js, err := yaml.ToJSON(serialization)
614 if err != nil {
615 return nil, err
616 }
617 return js, nil
618}
619
620func (o *EditOptions) visitToPatch(originalInfos []*resource.Info, patchVisitor resource.Visitor, results *editResults) error {
621 err := patchVisitor.Visit(func(info *resource.Info, incomingErr error) error {

Callers 3

visitToApplyEditPatchMethod · 0.85
GetApplyPatchFunction · 0.85
visitToPatchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…