nocalhost

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDevModeAction = base.DevModeAction{
		ScalePatches: []base.PatchItem{{
			Patch: `[{"op":"replace","path":"/spec/replicas","value":1}]`,
			Type:  "json",
		}},
		PodTemplatePath: "/spec/template",
	}

	PodDevModeAction = base.DevModeAction{}

	DaemonSetDevModeAction = base.DevModeAction{
		ScalePatches: []base.PatchItem{{
			Patch: `[{"op":"replace","path": "/spec/template/spec/nodeName", "value": "nocalhost.unreachable"}]`,
			Type:  "json",
		}},
		PodTemplatePath: "/spec/template",
		Create:          true,
	}

	JobDevModeAction = base.DevModeAction{
		PodTemplatePath: "/spec/template",
		Create:          true,
	}

	CronJobDevModeAction = base.DevModeAction{
		ScalePatches: []base.PatchItem{{
			Patch: `{"spec":{"suspend": true}}`,
			Type:  "strategic",
		}},
		PodTemplatePath: "/spec/jobTemplate/spec/template",
		Create:          true,
	}

	KruiseCronJobDevModeAction = base.DevModeAction{
		ScalePatches: []base.PatchItem{{
			Patch: `[{"op":"replace","path": "/spec/suspend", "value": true}]`,
			Type:  "json",
		}},
		PodTemplatePath: "/spec/template/broadcastJobTemplate/spec/template",
		Create:          true,
	}
)
View Source
var (
	CreatePvcFailed = errors.New("create PVC failed")
)
View Source
var ProfileNotFound = errors.New("Profile Not Found")

Functions

func CheckIfResourceTypeIsSupported

func CheckIfResourceTypeIsSupported(svcType base.SvcType) bool

func CleanupAppFilesUnderNs

func CleanupAppFilesUnderNs(namespace, nid string) error

func CompactApplicationDb

func CompactApplicationDb(ns, appName, nid, key string) error

func GetAllKubeconfig

func GetAllKubeconfig() ([]string, error)

func GetApplicationDbSize

func GetApplicationDbSize(ns, appName, nid string) (int, error)

func GetApplicationMeta

func GetApplicationMeta(appName, namespace, kubeConfig string) (*appmeta.ApplicationMeta, error)

func GetApplicationMetas

func GetApplicationMetas(namespace, kubeConfig string) (appmeta.ApplicationMetas, error)

func GetDevModeActionBySvcType

func GetDevModeActionBySvcType(svcType base.SvcType) (*base.DevModeAction, error)

func GetKubeConfigFromProfile

func GetKubeConfigFromProfile(ns, app, nid string) (string, error)

func GetLogDir

func GetLogDir() string

func GetProfileV2

func GetProfileV2(ns, app, nid string) (*profile.AppProfileV2, error)

func GetSyncThingBinDir

func GetSyncThingBinDir() string

func Init

func Init() error

func IsBuildInGvk

func IsBuildInGvk(gvk *schema.GroupVersionKind) bool

func IsNocalhostAppDir

func IsNocalhostAppDir(dir string) bool

IsNocalhostAppDir Check if a dir is a nocalhost dir

func IsPortForwarding

func IsPortForwarding(dir string) bool

func ListAllFromApplicationDb

func ListAllFromApplicationDb(ns, appName, nid string) (map[string]string, error)

func MigrateNsDirToSupportNidIfNeeded

func MigrateNsDirToSupportNidIfNeeded(app, ns, nid string) error

func MoveAppFromNsToNid

func MoveAppFromNsToNid() error

MoveAppFromNsToNid For compatibility

func SvcTypeOfMutate

func SvcTypeOfMutate(svcType string) (base.SvcType, error)

func UnmarshalProfileUnStrict

func UnmarshalProfileUnStrict(p []byte) (*profile.AppProfileV2, error)

func UpdateKey

func UpdateKey(ns, app, nid string, key string, value string) error

func UpdateProfileV2

func UpdateProfileV2(ns, app, nid string, profileV2 *profile.AppProfileV2) error

Types

type AppInfo

type AppInfo struct {
	Name      string
	Namespace string
	Nid       string
}

func GetNsAndApplicationInfo

func GetNsAndApplicationInfo(portForwardFilter, nidMigrate bool) ([]AppInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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