k8sInformer

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

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HELM_RELEASE_SECRET_TYPE         = "helm.sh/release.v1"
	CLUSTER_MODIFY_EVENT_SECRET_TYPE = "cluster.request/modify"
	DEFAULT_CLUSTER                  = "default_cluster"
	INFORMER_ALREADY_EXIST_MESSAGE   = "INFORMER_ALREADY_EXIST"
	ADD                              = "add"
	UPDATE                           = "update"
	DELETE                           = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterSecretUpdateListener

type ClusterSecretUpdateListener interface {
	OnStateChange(clusterId int, action string)
}

type HelmReleaseConfig

type HelmReleaseConfig struct {
	EnableHelmReleaseCache bool `env:"ENABLE_HELM_RELEASE_CACHE" envDefault:"true"`
}

func GetHelmReleaseConfig

func GetHelmReleaseConfig() (*HelmReleaseConfig, error)

type K8sInformer

type K8sInformer interface {
	GetAllReleaseByClusterId(clusterId int) []*client.DeployedAppDetail
	CheckReleaseExists(clusterId int32, releaseName string) bool
	GetClusterClientSet(clusterInfo bean.ClusterInfo) (*kubernetes.Clientset, error)
	RegisterListener(listener ClusterSecretUpdateListener)
	// contains filtered or unexported methods
}

type K8sInformerImpl

type K8sInformerImpl struct {
	HelmListClusterMap map[int]map[string]*client.DeployedAppDetail
	// contains filtered or unexported fields
}

func Newk8sInformerImpl

func Newk8sInformerImpl(logger *zap.SugaredLogger, clusterRepository repository.ClusterRepository,
	helmReleaseConfig *HelmReleaseConfig, k8sUtil k8sUtils.K8sService, converter converter.ClusterBeanConverter) *K8sInformerImpl

func (*K8sInformerImpl) BuildInformerForAllClusters

func (impl *K8sInformerImpl) BuildInformerForAllClusters() error

func (*K8sInformerImpl) CheckReleaseExists

func (impl *K8sInformerImpl) CheckReleaseExists(clusterId int32, releaseName string) bool

func (*K8sInformerImpl) GetAllReleaseByClusterId

func (impl *K8sInformerImpl) GetAllReleaseByClusterId(clusterId int) []*client.DeployedAppDetail

func (*K8sInformerImpl) GetClusterClientSet

func (impl *K8sInformerImpl) GetClusterClientSet(clusterInfo bean.ClusterInfo) (*kubernetes.Clientset, error)

func (*K8sInformerImpl) OnStateChange

func (impl *K8sInformerImpl) OnStateChange(clusterId int, action string)

func (*K8sInformerImpl) RegisterListener

func (impl *K8sInformerImpl) RegisterListener(listener ClusterSecretUpdateListener)

Jump to

Keyboard shortcuts

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