mirror of
https://github.com/kubernetes/client-go.git
synced 2026-05-17 04:52:18 +00:00
refactor: update in-tree FieldsV1 consumers to use format-specific accessors
Kubernetes-commit: e57b3a74f37754c9455a3debafd25c88d434e69d
This commit is contained in:
committed by
Kubernetes Publisher
parent
78536fe27c
commit
3e4de9e6b4
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package csaupgrade
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -323,12 +322,13 @@ func filter[T any](
|
||||
// Included from fieldmanager.internal to avoid dependency cycle
|
||||
// FieldsToSet creates a set paths from an input trie of fields
|
||||
func decodeManagedFieldsEntrySet(f metav1.ManagedFieldsEntry) (s fieldpath.Set, err error) {
|
||||
err = s.FromJSON(bytes.NewReader(f.FieldsV1.Raw))
|
||||
err = s.FromJSON(f.FieldsV1.GetRawReader())
|
||||
return s, err
|
||||
}
|
||||
|
||||
// SetToFields creates a trie of fields from an input set of paths
|
||||
func encodeManagedFieldsEntrySet(f *metav1.ManagedFieldsEntry, s fieldpath.Set) (err error) {
|
||||
f.FieldsV1.Raw, err = s.ToJSON()
|
||||
raw, err := s.ToJSON()
|
||||
f.FieldsV1.SetRawBytes(raw)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user