func (d *Service) createNewResources(ir irtypes.EnhancedIR, supportedKinds []string, targetCluster collecttypes.ClusterMetadata) []runtime.Object {
	objs := []runtime.Object{}
	ingressEnabled := false
	for _, service := range ir.Services {
		exposeobjectcreated := false
		if service.HasValidAnnotation(common.ExposeSelector) || service.OnlyIngress {
			if common.IsStringPresent(supportedKinds, routeKind) {
				routeObjs := d.createRoutes(service, ir, targetCluster.Spec)
				for _, routeObj := range routeObjs {
					objs = append(objs, routeObj)
				}
				exposeobjectcreated = true
			} else if common.IsStringPresent(supportedKinds, common.IngressKind) {
				exposeobjectcreated = true
				ingressEnabled = true
			}
		}
		if service.OnlyIngress {
			if !exposeobjectcreated {
				logrus.Errorf("Failed to create the ingress for service %q . Probable cause: The cluster doesn't support ingress resources.", service.Name)
			}
			continue
		}
		obj := d.createService(service)
		objs = append(objs, obj)
	}
	if ingressEnabled {
		obj := d.createIngress(ir, targetCluster.Spec)
		if obj != nil {
			objs = append(objs, obj)
		}
	}
	return objs
}
createNewResources converts IR to runtime objects
package apiresource
import (
	"fmt"
	"strings"
	"github.com/konveyor/move2kube/common"
	"github.com/konveyor/move2kube/k8sschema"
	"github.com/konveyor/move2kube/qaengine"
	collecttypes "github.com/konveyor/move2kube/types/collection"
	irtypes "github.com/konveyor/move2kube/types/ir"
	"github.com/konveyor/move2kube/types/qaengine/commonqa"
	okdroutev1 "github.com/openshift/api/route/v1"
	"github.com/sirupsen/logrus"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/intstr"
	core "k8s.io/kubernetes/pkg/apis/core"
	networking "k8s.io/kubernetes/pkg/apis/networking"
)
const (
	routeKind = "Route"
)
type Service struct {
}
func (d *Service) getSupportedKinds() []string {
	return []string{common.ServiceKind, common.IngressKind, routeKind}
}