On Sunday, 2 May 2021 at 19:18:43 UTC+1 mmahmo...@gmail.com wrote: > > https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured#section-documentation > > I am looking for something like the following > func mergeObjects(obj1 *uns.Unstructured, obj2 *uns.Unstructured) > (*uns.Unstructred, error) { > > } > > This sounds like more of a kubernetes question than a go question. I think you first need to define exactly the semantics of this "merge" operation, because there are many possibilities for how it might work.
You could have a look at how kustomize handles this. Maybe a strategic merge patch is what you're looking for? https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#patchstrategicmerge https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/#customizing https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/ Or maybe this: https://kubernetes.io/docs/reference/using-api/server-side-apply/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/4f57c370-7502-400b-a295-5a9fe2bfd1ben%40googlegroups.com.