cmd

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Overview

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const (
	RulesetPath            = "/opt/rulesets"
	OpenRewriteRecipesPath = "/opt/openrewrite"
	InputPath              = "/opt/input"
	OutputPath             = "/opt/output"
	XMLRulePath            = "/opt/xmlrules"
	ShimOutputPath         = "/opt/shimoutput"
	CustomRulePath         = "/opt/input/rules"
)

analyzer container paths

View Source
const (
	JavaArchive       = ".jar"
	WebArchive        = ".war"
	EnterpriseArchive = ".ear"
	ClassFile         = ".class"
)

valid java file extensions

Variables

View Source
var (
	// TODO (pgaikwad): this assumes that the $USER in container is always root, it may not be the case in future
	M2Dir = path.Join("/", "root", ".m2")
	// application source path inside the container
	SourceMountPath = path.Join(InputPath, "source")
	// analyzer config files
	ConfigMountPath = path.Join(InputPath, "config")
	// user provided rules path
	RulesMountPath = path.Join(RulesetPath, "input")
	// paths to files in the container
	AnalysisOutputMountPath   = path.Join(OutputPath, "output.yaml")
	DepsOutputMountPath       = path.Join(OutputPath, "dependencies.yaml")
	ProviderSettingsMountPath = path.Join(ConfigMountPath, "settings.json")
	DotnetFrameworks          = map[string]bool{
		"v1.0":   false,
		"v1.1":   false,
		"v2.0":   false,
		"v3.0":   false,
		"v3.5":   false,
		"v4":     false,
		"v4.5":   true,
		"v4.5.1": true,
		"v4.5.2": true,
		"v4.6":   true,
		"v4.6.1": true,
		"v4.6.2": true,
		"v4.7":   true,
		"v4.7.1": true,
		"v4.7.2": true,
		"v4.8":   true,
		"v4.8.1": true,
	}
)
View Source
var (
	RootCommandName      = "kantra"
	JavaBundlesLocation  = "/jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar"
	JDTLSBinLocation     = "/jdtls/bin/jdtls"
	RulesetsLocation     = "rulesets"
	JavaProviderImage    = "quay.io/konveyor/java-external-provider"
	GenericProviderImage = "quay.io/konveyor/generic-external-provider"
	DotnetProviderImage  = "quay.io/konveyor/dotnet-external-provider"
)
View Source
var (
	BuildCommit = ""
	Version     = "latest"
	RunnerImage = "quay.io/konveyor/kantra"
)
View Source
var Settings = &Config{}

Functions

func CopyFileContents added in v0.6.1

func CopyFileContents(src string, dst string) (err error)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func IsXMLDirEmpty added in v0.6.0

func IsXMLDirEmpty(dir string) (bool, error)

func NewAnalyzeCmd

func NewAnalyzeCmd(log logr.Logger) *cobra.Command

analyzeCmd represents the analyze command

func NewOpenRewriteCommand

func NewOpenRewriteCommand(log logr.Logger) *cobra.Command

func NewTestCommand added in v0.4.0

func NewTestCommand(log logr.Logger) *cobra.Command

func NewTransformCommand

func NewTransformCommand(log logr.Logger) *cobra.Command

func NewVersionCommand added in v0.3.1

func NewVersionCommand() *cobra.Command

Use build flags to set correct Version and BuildCommit e.g.: --ldflags="-X 'github.com/konveyor-ecosystem/kantra/cmd.Version=1.2.3' -X 'github.com/konveyor-ecosystem/kantra/cmd.BuildCommit=$(git rev-parse HEAD)'"

func NewWindupShimCommand

func NewWindupShimCommand(log logr.Logger) *cobra.Command

Types

type Application added in v0.6.0

type Application struct {
	Id       string                  `yaml:"id" json:"id"`
	Name     string                  `yaml:"name" json:"name"`
	Rulesets []konveyor.RuleSet      `yaml:"rulesets" json:"rulesets"`
	DepItems []konveyor.DepsFlatItem `yaml:"depItems" json:"depItems"`
	// contains filtered or unexported fields
}

type Config

type Config struct {
	RootCommandName      string `env:"CMD_NAME" default:"kantra"`
	ContainerBinary      string `env:"CONTAINER_TOOL" default:"/usr/bin/podman"`
	RunnerImage          string `env:"RUNNER_IMG" default:"quay.io/konveyor/kantra"`
	RunLocal             bool   `env:"RUN_LOCAL"`
	JvmMaxMem            string `env:"JVM_MAX_MEM" default:""`
	JavaProviderImage    string `env:"JAVA_PROVIDER_IMG" default:"quay.io/konveyor/java-external-provider:latest"`
	GenericProviderImage string `env:"GENERIC_PROVIDER_IMG" default:"quay.io/konveyor/generic-external-provider:latest"`
	DotnetProviderImage  string `env:"DOTNET_PROVIDER_IMG" default:"quay.io/konveyor/dotnet-external-provider:latest"`
}

func (*Config) Load

func (c *Config) Load() error

type ProviderInit added in v0.5.0

type ProviderInit struct {
	// contains filtered or unexported fields
}

TODO add network and volume w/ interface

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL