func ObjectKeyForVirtualNodeReference(obj metav1.Object, vnRef appmesh.VirtualNodeReference) types.NamespacedName {
	namespace := obj.GetNamespace()
	if vnRef.Namespace != nil && len(*vnRef.Namespace) != 0 {
		namespace = *vnRef.Namespace
	}
	return types.NamespacedName{Namespace: namespace, Name: vnRef.Name}
}
ObjectKeyForVirtualNodeReference returns the key of referenced VirtualNode CR.
package references
import (
	appmesh "github.com/aws/aws-app-mesh-controller-for-k8s/apis/appmesh/v1beta2"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"
)
func ObjectKeyForVirtualGatewayReference(obj metav1.Object, vgRef appmesh.VirtualGatewayReference) types.NamespacedName {
	namespace := obj.GetNamespace()
	if vgRef.Namespace != nil && len(*vgRef.Namespace) != 0 {
		namespace = *vgRef.Namespace
	}
	return types.NamespacedName{Namespace: namespace, Name: vgRef.Name}
}