model

package
v0.0.0-...-0a5baa5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//manager
	InitAgent    = "agent_init"
	RestartAgent = "restart_agent"
	AgentUpgrade = "agent_upgrade"
	ReSyncAgent  = "re_sync"
	// devOps-service暂无处理失败的逻辑
	InitAgentFailed  = "init_agent_failed"
	EnvCreateFailed  = "env_create_failed"
	EnvDeleteSucceed = "env_stop_succeed"
	EnvDelete        = "env_delete"
	EnvCreate        = "env_create"

	// Components
	CertManagerInstall   = "cert_manager_install"
	CertManagerStatus    = "cert_manager_status"
	CertManagerUninstall = "cert_manager_uninstall"
	//CertManagerUninstallStatus = "cert_manager_uninstall_status"
	// pod
	DeletePod = "delete_pod"

	// helm
	// HelmReleaseUpgrade 以前用于升级agent及重新部署实例,现仅用于升级agent
	// Deprecated: 将在0.20移除
	HelmReleaseUpgrade              = "helm_release_upgrade"
	HelmReleaseSyncedFailed         = "helm_release_sync_failed"
	HelmReleaseInstallFailed        = "helm_release_install_failed"
	HelmReleaseCrossUpgradeFailed   = "helm_release_cross_upgrade_failed"
	HelmInstallJobInfo              = "helm_install_job_info"
	HelmUpgradeJobInfo              = "helm_upgrade_job_info"
	HelmCrossUpgradeJobInfo         = "helm_cross_upgrade_job_info"
	HelmJobLog                      = "helm_job_log"
	HelmJobEvent                    = "helm_job_event"
	HelmReleaseRollback             = "helm_release_rollback"
	HelmReleaseRollbackFailed       = "helm_release_rollback_failed"
	HelmReleaseStart                = "helm_release_start"
	HelmReleaseStartFailed          = "helm_release_start_failed"
	HelmReleaseStop                 = "helm_release_stop"
	HelmReleaseStopFailed           = "helm_release_stop_failed"
	HelmReleaseDelete               = "helm_release_delete"
	HelmReleaseDeleteFailed         = "helm_release_delete_failed"
	HelmReleaseGetContent           = "helm_release_get_content"
	HelmReleaseGetContentFailed     = "helm_release_get_content_failed"
	ChartMuseumAuthentication       = "chart_museum_authentication"
	ChartMuseumAuthenticationFailed = "chart_museum_authentication_failed"

	HelmReleaseInstallResourceInfo = "helm_install_resource_info"
	HelmReleaseUpgradeResourceInfo = "helm_upgrade_resource_info"
	HelmPodEvent                   = "helm_pod_event"
	// automatic test
	TestExecute        = "test_execute"
	ExecuteTestSucceed = "execute_test_succeed"
	ExecuteTestFailed  = "execute_test_failed"
	TestJobLog         = "test_job_log"
	TestPodEvent       = "test_pod_event"
	TestPodUpdate      = "test_pod_update"
	TestStatusRequest  = "test_status"
	TestStatusResponse = "test_status_response"
	// network
	NetworkService             = "network_service"
	NetworkServiceFailed       = "network_service_failed"
	NetworkServiceUpdate       = "network_service_update"
	NetworkServiceDelete       = "network_service_delete"
	NetworkServiceDeleteFailed = "network_service_delete_failed"
	NetworkIngress             = "network_ingress"
	NetworkIngressFailed       = "network_ingress_failed"
	NetworkIngressDelete       = "network_ingress_delete"
	NetworkIngressDeleteFailed = "network_ingress_delete_failed"
	NetworkSync                = "network_sync"

	Cert_Issued = "cert_issued"
	Cert_Faild  = "cert_failed"
	// kubernetes resource
	ResourceUpdate = "resource_update"
	ConfigUpdate   = "config_update"
	NodeUpdate     = "node_update"
	NodeDelete     = "node_delete"

	ResourceDelete = "resource_delete"
	ResourceSync   = "resource_sync"
	NodeSync       = "node_sync"
	PodMetricsSync = "pod_metrics_sync"

	// kubernetes
	KubernetesGetLogs                    = "kubernetes_get_logs"
	KubernetesGetLogsFailed              = "kubernetes_get_logs_failed"
	KubernetesDownloadLogs               = "kubernetes_download_logs"
	KubernetesDownloadLogsFailed         = "kubernetes_download_logs_failed"
	KubernetesDownloadPreviousLogs       = "kubernetes_download_previous_logs"
	KubernetesDownloadPreviousLogsFailed = "kubernetes_download_previous_logs_failed"
	KubernetesExec                       = "kubernetes_exec"
	KubernetesExecFailed                 = "kubernetes_exec_failed"
	OperatePodCount                      = "operate_pod_count"
	OperatePodCountFailed                = "operate_pod_count_failed"
	OperatePodCountSuccess               = "operate_pod_count_succeed"
	OperateDockerRegistrySecret          = "operate_docker_registry_secret"
	OperateDockerRegistrySecretFailed    = "operate_docker_registry_secret_failed"
	DeletePersistentVolumeClaimByLabels  = "delete_persistent_volume_claim_by_labels"

	// git ops
	GitOpsSync       = "git_ops_sync"
	GitOpsSyncFailed = "git_ops_sync_failed"
	GitOpsSyncEvent  = "git_ops_sync_event"

	ResourceStatusSyncEvent = "resource_status_sync_event"
	ResourceStatusSync      = "resource_status_sync"
	ResourceDescribe        = "resource_describe"
	Upgrade                 = "upgrade"

	CertManagerInfo = "cert_manager_info"

	// polaris
	PolarisRequest = "polaris_scan_cluster"

	// clusterInfo
	ClusterGetInfo       = "cluster_info"
	ClusterGetInfoFailed = "cluster_info_failed"

	// workload pod event
	WorkloadPodEvent = "workload_pod_event"
)
View Source
const (
	INSTALL       = "INSTALL"
	UPGRADE       = "UPGRADE"
	CROSS_UPGRADE = "CROSS-UPGRADE"
)
View Source
const (
	ParentWorkloadNameLabel         = "choerodon.io/parent-workload-name"
	ParentWorkloadLabel             = "choerodon.io/parent-workload"
	WorkloadLabel                   = "choerodon.io/workload"
	HelmVersion                     = "choerodon.io/helm-version"
	MicroServiceConfig              = "choerodon.io/feature"
	ReleaseLabel                    = "choerodon.io/release"
	NetworkLabel                    = "choerodon.io/network"
	NetworkNoDelLabel               = "choerodon.io/no_delete"
	AgentVersionLabel               = "choerodon.io"
	CommitLabel                     = "choerodon.io/commit"
	TlsSecretLabel                  = "choerodon.io/tls-secret"
	C7NHelmReleaseClusterLabel      = "choerodon.io/C7NHelmRelease-cluster"
	C7NHelmReleaseOperateAnnotation = "choerodon.io/C7NHelmRelease-operate"
	TestLabel                       = "choerodon.io/test"
	EnvLabel                        = "choerodon.io/env"
	PvLabel                         = "choerodon.io/pv"
	NameLabel                       = "choerodon.io/name"
	PvcLabel                        = "choerodon.io/pvc"
	PvLabelValueFormat              = "pv-cluster-%s"
	PvcLabelValueFormat             = "pvc-cluster-%s"
)
View Source
const CertManagerClusterIssuer = `` /* 315-byte string literal not displayed */

Variables

View Source
var AgentNamespace string
View Source
var AgentVersion string
View Source
var CRD_YAMLS []string
View Source
var CertManagerVersion string
View Source
var ClusterId string
View Source
var GitRepoConcurrencySyncChan chan struct{}

git repo初始化的时候控制并发的chan

View Source
var GitRunning = false

gitops监听协程是否在运行中标志

View Source
var GitStopChanMap = make(map[string]chan struct{})

gitops监听协程退出通道

View Source
var InitLock = sync.Mutex{}

agent初始化锁,防止接收多个agent_init命令,导致重复初始化

View Source
var Initialized = false

agent是否已初始化的标志。 如果websocket连接断开,将此置为false。如果agent.InitAgent执行成功,将此置为true

View Source
var KubernetesVersion string
View Source
var MaxJobLogLength int
View Source
var MaxWebsocketMessageLength int
View Source
var ReconnectFlag = false

websocket重连标志

View Source
var RestrictedModel bool

agent是否处于限制模式

Functions

This section is empty.

Types

type AgentInitOptions

type AgentInitOptions struct {
	Envs                    []EnvParas `json:"envs,omitempty"`
	GitHost                 string     `json:"gitHost,omitempty"`
	AgentName               string     `json:"agentName,omitempty"`
	CertManagerVersion      string     `json:"certManagerVersion,omitempty"`
	RepoConcurrencySyncSize int        `json:"repoConcurrencySyncSize,omitempty"`
}

type AgentStatus

type AgentStatus struct {
	EnvStatuses            []EnvStatus
	HelmStatus             string
	HelmOpDuration         time.Duration
	KubeStatus             string
	LastControllerSyncTime string
}

type CertManagerStatusInfo

type CertManagerStatusInfo struct {
	Status       string `json:"status,omitempty"`
	ChartVersion string `json:"chartVersion,omitempty"`
	Namespace    string `json:"namespace,omitempty"`
	ReleaseName  string `json:"releaseName,omitempty"`
}

type EnvParas

type EnvParas struct {
	Namespace string   `json:"namespace,omitempty"`
	EnvId     int64    `json:"envId,omitempty"`
	GitRsaKey string   `json:"gitRsaKey,omitempty"`
	GitUrl    string   `json:"gitUrl,omitempty"`
	Releases  []string `json:"instances,omitempty"`
}

type EnvStatus

type EnvStatus struct {
	EnvCode       string
	EnvId         int64
	GitReady      bool
	GitOpDuration time.Duration
}

type GitInitConfig

type GitInitConfig struct {
	SshKey string `json:"sshKey,omitempty"`
	GitUrl string `json:"gitUrl,omitempty"`
}

type OldEnv

type OldEnv struct {
	Namespace string `json:"namespace,omitempty"`
	EnvId     int64  `json:"envId,omitempty"`
}

type Packet

type Packet struct {
	Key     string `json:"key,omitempty"`
	Type    string `json:"type,omitempty"`
	Payload string `json:"payload,omitempty"`
}

func (*Packet) Namespace

func (c *Packet) Namespace() string

func (*Packet) String

func (c *Packet) String() string

type UpgradeInfo

type UpgradeInfo struct {
	Envs         []OldEnv `json:"envs,omitempty"`
	Token        string   `json:"token,omitempty"`
	PlatformCode string   `json:"platformCode,omitempty"`
}

Jump to

Keyboard shortcuts

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