Skip to content

Commit

Permalink
UPSTREAM: <carry>: Export internal code from k8s.io/apimachinery/pkg/…
Browse files Browse the repository at this point in the history
…util/managedfields

Some of the code we use in openshift-tests was recently made internal
in kubernetes#115065. This patch
exposes the code we need there.
  • Loading branch information
bertinatto committed Mar 6, 2024
1 parent 5127a9b commit c713d1f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions staging/src/k8s.io/apimachinery/pkg/util/managedfields/patch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package managedfields

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/managedfields/internal"
)

// ManagedInterface groups a fieldpath.ManagedFields together with the timestamps associated with each operation.
type ManagedInterface = internal.ManagedInterface

// DecodeManagedFields converts ManagedFields from the wire format (api format)
// to the format used by sigs.k8s.io/structured-merge-diff
func DecodeManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) (ManagedInterface, error) {
return internal.DecodeManagedFields(encodedManagedFields)
}

0 comments on commit c713d1f

Please sign in to comment.