func ConvertK8sResourceOneToOneAdapter(oneToOne ConvertK8sResourceToKVPair) ConvertK8sResourceToKVPairs {
	return func(r Resource) ([]*model.KVPair, error) {
		kvp, err := oneToOne(r)
		if err != nil {
			return nil, err
		} else if kvp != nil {
			return []*model.KVPair{kvp}, nil
		}
		return nil, nil
	}
}
ConvertK8sResourceOneToOneAdapter converts a ConvertK8sResourceToKVPair function to a ConvertK8sResourceToKVPairs function
package resources
import (
	"encoding/json"
	log "github.com/sirupsen/logrus"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"github.com/projectcalico/libcalico-go/lib/backend/model"
)
const (
	labelsAnnotation      = "projectcalico.org/labels"
	annotationsAnnotation = "projectcalico.org/annotations"
	metadataAnnotation    = "projectcalico.org/metadata"
)
type Resource interface {
	runtime.Object
	metav1.ObjectMetaAccessor
}
type ResourceList interface {
	runtime.Object
	metav1.ListMetaAccessor
}
type ConvertK8sResourceToKVPair func(Resource) (*model.KVPair, error)
type ConvertK8sResourceToKVPairs func(Resource) ([]*model.KVPair, error)