func (t *CloudFoundry) BaseDirectoryDetect(dir string) (namedServices map[string]transformertypes.ServicePlan, unnamedServices []transformertypes.TransformerPlan, err error) {
	namedServices = map[string]transformertypes.ServicePlan{}
	filePaths, err := common.GetFilesByExt(dir, []string{".yml", ".yaml"})
	if err != nil {
		logrus.Warnf("Unable to fetch yaml files and recognize cf manifest yamls at path %q Error: %q", dir, err)
		return namedServices, nil, err
	}
	namedServices = map[string]transformertypes.ServicePlan{}
	cfInstanceApps := map[string][]collecttypes.CfApplication{}  
	for _, filePath := range filePaths {
		fileCfInstanceApps := collecttypes.CfInstanceApps{}
		if err := common.ReadMove2KubeYaml(filePath, &fileCfInstanceApps); err != nil {
			logrus.Debugf("Failed to read the yaml file at path %q Error: %q", filePath, err)
			continue
		}
		if fileCfInstanceApps.Kind != string(collecttypes.CfInstanceAppsMetadataKind) {
			logrus.Debugf("%q is not a valid apps file. Expected kind: %s Actual Kind: %s", filePath, string(collecttypes.CfInstanceAppsMetadataKind), fileCfInstanceApps.Kind)
			continue
		}
		cfInstanceApps[filePath] = append(cfInstanceApps[filePath], fileCfInstanceApps.Spec.CfApplications...)
	}
	logrus.Debugf("Cf Instances %+v", cfInstanceApps)
	for _, filePath := range filePaths {
		applications, _, err := t.readApplicationManifest(filePath, "")
		if err != nil {
			logrus.Debugf("Failed to parse the manifest file at path %q Error: %q", filePath, err)
			continue
		}
		for _, application := range applications {
			fullbuilddirectory := filepath.Dir(filePath)
			if application.Path != "" {
				fullappdirectory := filepath.Join(filepath.Dir(filePath), application.Path)
				if _, err := os.Stat(fullappdirectory); !os.IsNotExist(err) {
					fullbuilddirectory = fullappdirectory
				} else {
					logrus.Debugf("Path to app directory %s does not exist, assuming manifest directory as app path", fullappdirectory)
				}
			}
			applicationName := application.Name
			if applicationName == "" {
				basename := filepath.Base(filePath)
				applicationName = strings.TrimSuffix(basename, filepath.Ext(basename))
			}
			ct := transformertypes.TransformerPlan{
				Mode:              transformertypes.ModeContainer,
				ArtifactTypes:     []transformertypes.ArtifactType{irtypes.IRArtifactType},
				BaseArtifactTypes: []transformertypes.ArtifactType{irtypes.IRArtifactType},
				Configs: map[transformertypes.ConfigType]interface{}{
					artifacts.CloudFoundryConfigType: artifacts.CloudFoundryConfig{
						ServiceName: applicationName,
					}},
				Paths: map[transformertypes.PathType][]string{
					artifacts.CfManifestPathType:  {filePath},
					artifacts.ProjectPathPathType: {fullbuilddirectory},
				},
			}
			_, appinstance := getCfInstanceApp(cfInstanceApps, applicationName)
			if application.DockerImage != "" || appinstance.DockerImage != "" {
				dockerImageName := application.DockerImage
				if dockerImageName == "" {
					dockerImageName = appinstance.DockerImage
				}
				ct.ArtifactTypes = append(ct.ArtifactTypes, artifacts.ContainerBuildArtifactType)
				ct.BaseArtifactTypes = append(ct.ArtifactTypes, artifacts.ContainerBuildArtifactType)
				ctConfig := ct.Configs[artifacts.CloudFoundryConfigType].(artifacts.CloudFoundryConfig)
				ctConfig.ImageName = dockerImageName
				ct.Configs[artifacts.CloudFoundryConfigType] = ctConfig
				continue
			}
			namedServices[applicationName] = []transformertypes.TransformerPlan{ct}
		}
	}
	return namedServices, nil, nil
}
BaseDirectoryDetect runs detect in base directory
package cloudfoundry
import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"code.cloudfoundry.org/cli/util/manifest"
	"github.com/cloudfoundry/bosh-cli/director/template"
	"github.com/konveyor/move2kube/common"
	"github.com/konveyor/move2kube/environment"
	collecttypes "github.com/konveyor/move2kube/types/collection"
	irtypes "github.com/konveyor/move2kube/types/ir"
	transformertypes "github.com/konveyor/move2kube/types/transformer"
	"github.com/konveyor/move2kube/types/transformer/artifacts"
	"github.com/sirupsen/logrus"
	"github.com/spf13/cast"
	"gopkg.in/yaml.v3"
	core "k8s.io/kubernetes/pkg/apis/core"
	"k8s.io/kubernetes/pkg/apis/networking"
)
type CloudFoundry struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
}
func (t *CloudFoundry) Init(tc transformertypes.Transformer, env *environment.Environment) (err error) {
	t.Config = tc
	t.Env = env
	return nil
}
func (t *CloudFoundry) GetConfig() (transformertypes.Transformer, *environment.Environment) {
	return t.Config, t.Env
}