Help us shape the future of Go! Take the 2026 Go Developer Survey

cluster

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 49 Imported by: 28

Documentation

Index

Constants

View Source
const (
	CmName = "cluster-event"
)
View Source
const DataSourceNameFormat = "Prometheus-%s-EnvId-%d"
View Source
const (
	// Cluster connectivity error constants
	ErrClusterNotReachable = "cluster is not reachable"
)

Variables

This section is empty.

Functions

func ParseCmNameForK8sInformerOnClusterEvent added in v1.8.0

func ParseCmNameForK8sInformerOnClusterEvent(clusterId int) string

Types

type ClusterDescriptionBean added in v0.6.17

type ClusterDescriptionBean struct {
	ClusterId        int                              `json:"clusterId" validate:"number"`
	ClusterName      string                           `json:"clusterName" validate:"required"`
	Description      string                           `json:"description"`
	ServerUrl        string                           `json:"serverUrl"`
	ClusterCreatedBy string                           `json:"clusterCreatedBy" validate:"number"`
	ClusterCreatedOn time.Time                        `json:"clusterCreatedOn" validate:"required"`
	ClusterNote      *apiBean.GenericNoteResponseBean `json:"clusterNote,omitempty"`
}

type ClusterDescriptionService added in v0.6.17

type ClusterDescriptionService interface {
	FindByClusterIdWithClusterDetails(id int) (*ClusterDescriptionBean, error)
}

type ClusterDescriptionServiceImpl added in v0.6.17

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

func NewClusterDescriptionServiceImpl added in v0.6.17

func NewClusterDescriptionServiceImpl(repository repository.ClusterDescriptionRepository, userRepository repository2.UserRepository, logger *zap.SugaredLogger) *ClusterDescriptionServiceImpl

func (*ClusterDescriptionServiceImpl) FindByClusterIdWithClusterDetails added in v0.6.17

func (impl *ClusterDescriptionServiceImpl) FindByClusterIdWithClusterDetails(clusterId int) (*ClusterDescriptionBean, error)

type ClusterService

type ClusterService interface {
	Save(parent context.Context, bean *bean.ClusterBean, userId int32) (*bean.ClusterBean, error)
	UpdateClusterDescription(bean *bean.ClusterBean, userId int32) error
	ValidateKubeconfig(kubeConfig string) (map[string]*bean.ValidateClusterBean, error)
	FindOne(clusterName string) (*bean.ClusterBean, error)
	FindOneActive(clusterName string) (*bean.ClusterBean, error)
	FindAll() ([]*bean.ClusterBean, error)
	FindAllExceptVirtual() ([]*bean.ClusterBean, error)
	FindAllWithoutConfig() ([]*bean.ClusterBean, error)
	FindAllActive() ([]bean.ClusterBean, error)
	DeleteFromDb(bean *clusterBean.DeleteClusterBean, userId int32) (string, error)

	FindById(id int) (*bean.ClusterBean, error)
	FindByIdWithoutConfig(id int) (*bean.ClusterBean, error)
	FindByIds(id []int) ([]bean.ClusterBean, error)
	FindByIdsWithoutConfig(ids []int) ([]*bean.ClusterBean, error)
	Update(ctx context.Context, bean *bean.ClusterBean, userId int32) (*bean.ClusterBean, error)
	Delete(bean *bean.ClusterBean, userId int32) error

	FindAllForAutoComplete() ([]bean.ClusterBean, error)
	CreateGrafanaDataSource(clusterBean *bean.ClusterBean, env *repository2.Environment) (int, error)
	GetAllClusterNamespaces() map[string][]string
	FindAllNamespacesByUserIdAndClusterId(userId int32, clusterId int, isActionUserSuperAdmin bool) ([]string, error)
	FindAllForClusterByUserId(userId int32, isActionUserSuperAdmin bool) ([]bean.ClusterBean, error)
	FetchRolesFromGroup(userId int32) ([]*repository3.RoleModel, error)
	HandleErrorInClusterConnections(clusters []*bean.ClusterBean, respMap *sync.Map, clusterExistInDb bool)
	ConnectClustersInBatch(clusters []*bean.ClusterBean, clusterExistInDb bool)
	ConvertClusterBeanToCluster(clusterBean *bean.ClusterBean, userId int32) *repository.Cluster
	ConvertClusterBeanObjectToCluster(bean *bean.ClusterBean) *v1alpha1.Cluster

	GetClusterConfigByClusterId(clusterId int) (*k8s.ClusterConfig, error)
}

type ClusterServiceImpl

type ClusterServiceImpl struct {
	K8sUtil            *k8s.K8sServiceImpl
	K8sInformerFactory informer.K8sInformerFactory
	// contains filtered or unexported fields
}

func NewClusterServiceImpl

func NewClusterServiceImpl(repository repository.ClusterRepository, logger *zap.SugaredLogger,
	K8sUtil *k8s.K8sServiceImpl, K8sInformerFactory informer.K8sInformerFactory,
	userAuthRepository repository3.UserAuthRepository, userRepository repository3.UserRepository,
	roleGroupRepository repository3.RoleGroupRepository,
	envVariables *globalUtil.EnvironmentVariables,
	cronLogger *cronUtil.CronLoggerImpl,
	clusterReadService read.ClusterReadService,
	asyncRunnable *async.Runnable) (*ClusterServiceImpl, error)

func (*ClusterServiceImpl) CheckIfConfigIsValid added in v0.6.2

func (impl *ClusterServiceImpl) CheckIfConfigIsValid(cluster *bean.ClusterBean) error

func (*ClusterServiceImpl) ConnectClustersInBatch added in v0.6.18

func (impl *ClusterServiceImpl) ConnectClustersInBatch(clusters []*bean.ClusterBean, clusterExistInDb bool)

func (*ClusterServiceImpl) ConvertClusterBeanObjectToCluster added in v0.6.18

func (impl *ClusterServiceImpl) ConvertClusterBeanObjectToCluster(bean *bean.ClusterBean) *v1alpha1.Cluster

func (*ClusterServiceImpl) ConvertClusterBeanToCluster added in v0.6.18

func (impl *ClusterServiceImpl) ConvertClusterBeanToCluster(clusterBean *bean.ClusterBean, userId int32) *repository.Cluster

func (*ClusterServiceImpl) CreateGrafanaDataSource

func (impl *ClusterServiceImpl) CreateGrafanaDataSource(clusterBean *bean.ClusterBean, env *repository2.Environment) (int, error)

func (*ClusterServiceImpl) Delete

func (impl *ClusterServiceImpl) Delete(bean *bean.ClusterBean, userId int32) error

func (*ClusterServiceImpl) DeleteFromDb added in v0.3.15

func (impl *ClusterServiceImpl) DeleteFromDb(bean *clusterBean.DeleteClusterBean, userId int32) (string, error)

func (*ClusterServiceImpl) FetchRolesFromGroup added in v0.6.11

func (impl *ClusterServiceImpl) FetchRolesFromGroup(userId int32) ([]*repository3.RoleModel, error)

func (*ClusterServiceImpl) FindAll

func (impl *ClusterServiceImpl) FindAll() ([]*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindAllActive

func (impl *ClusterServiceImpl) FindAllActive() ([]bean.ClusterBean, error)

func (*ClusterServiceImpl) FindAllExceptVirtual added in v0.6.24

func (impl *ClusterServiceImpl) FindAllExceptVirtual() ([]*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindAllForAutoComplete

func (impl *ClusterServiceImpl) FindAllForAutoComplete() ([]bean.ClusterBean, error)

func (*ClusterServiceImpl) FindAllForClusterByUserId added in v0.6.11

func (impl *ClusterServiceImpl) FindAllForClusterByUserId(userId int32, isActionUserSuperAdmin bool) ([]bean.ClusterBean, error)

func (*ClusterServiceImpl) FindAllNamespacesByUserIdAndClusterId added in v0.6.11

func (impl *ClusterServiceImpl) FindAllNamespacesByUserIdAndClusterId(userId int32, clusterId int, isActionUserSuperAdmin bool) ([]string, error)

func (*ClusterServiceImpl) FindAllWithoutConfig added in v0.6.13

func (impl *ClusterServiceImpl) FindAllWithoutConfig() ([]*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindById

func (impl *ClusterServiceImpl) FindById(id int) (*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindByIdWithoutConfig added in v0.6.13

func (impl *ClusterServiceImpl) FindByIdWithoutConfig(id int) (*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindByIds

func (impl *ClusterServiceImpl) FindByIds(ids []int) ([]bean.ClusterBean, error)

func (*ClusterServiceImpl) FindByIdsWithoutConfig added in v1.8.0

func (impl *ClusterServiceImpl) FindByIdsWithoutConfig(ids []int) ([]*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindOne

func (impl *ClusterServiceImpl) FindOne(clusterName string) (*bean.ClusterBean, error)

func (*ClusterServiceImpl) FindOneActive

func (impl *ClusterServiceImpl) FindOneActive(clusterName string) (*bean.ClusterBean, error)

func (*ClusterServiceImpl) GetAllClusterNamespaces added in v0.6.10

func (impl *ClusterServiceImpl) GetAllClusterNamespaces() map[string][]string

func (*ClusterServiceImpl) GetAndUpdateConnectionStatusForOneCluster added in v0.6.21

func (impl *ClusterServiceImpl) GetAndUpdateConnectionStatusForOneCluster(k8sClientSet *kubernetes.Clientset, clusterId int, respMap *sync.Map)

func (*ClusterServiceImpl) GetClusterConfigByClusterId added in v0.6.25

func (impl *ClusterServiceImpl) GetClusterConfigByClusterId(clusterId int) (*k8s.ClusterConfig, error)

func (*ClusterServiceImpl) HandleErrorInClusterConnections added in v0.6.18

func (impl *ClusterServiceImpl) HandleErrorInClusterConnections(clusters []*bean.ClusterBean, respMap *sync.Map, clusterExistInDb bool)

func (*ClusterServiceImpl) Save

func (impl *ClusterServiceImpl) Save(parent context.Context, bean *bean.ClusterBean, userId int32) (*bean.ClusterBean, error)

func (*ClusterServiceImpl) SyncNsInformer added in v0.3.14

func (impl *ClusterServiceImpl) SyncNsInformer(bean *bean.ClusterBean)

func (*ClusterServiceImpl) Update

func (impl *ClusterServiceImpl) Update(ctx context.Context, bean *bean.ClusterBean, userId int32) (*bean.ClusterBean, error)

func (*ClusterServiceImpl) UpdateClusterDescription added in v0.6.26

func (impl *ClusterServiceImpl) UpdateClusterDescription(bean *bean.ClusterBean, userId int32) error

UpdateClusterDescription is new api service logic to only update description, this should be done in cluster update operation only but not supported currently as per product

func (*ClusterServiceImpl) ValidateKubeconfig added in v0.6.18

func (impl *ClusterServiceImpl) ValidateKubeconfig(kubeConfig string) (map[string]*bean.ValidateClusterBean, error)

type ClusterServiceImplExtended added in v0.3.9

type ClusterServiceImplExtended struct {
	*ClusterServiceImpl
	// contains filtered or unexported fields
}

extends ClusterServiceImpl and enhances method of ClusterService with full mode specific errors

func NewClusterServiceImplExtended added in v0.3.9

func NewClusterServiceImplExtended(environmentRepository repository.EnvironmentRepository,
	grafanaClient grafana.GrafanaClient, installedAppRepository repository2.InstalledAppRepository,
	gitOpsConfigReadService config.GitOpsConfigReadService,
	clusterServiceImpl *ClusterServiceImpl,
	argoCDClientWrapper argocdServer.ArgoClientWrapperService) *ClusterServiceImplExtended

func (*ClusterServiceImplExtended) CreateGrafanaDataSource added in v0.3.9

func (impl *ClusterServiceImplExtended) CreateGrafanaDataSource(clusterBean *bean.ClusterBean, env *repository.Environment) (int, error)

func (ClusterServiceImplExtended) DeleteFromDb added in v0.3.15

func (impl ClusterServiceImplExtended) DeleteFromDb(bean *bean.DeleteClusterBean, userId int32) (string, error)

func (*ClusterServiceImplExtended) FindAll added in v0.3.9

func (impl *ClusterServiceImplExtended) FindAll() ([]*bean.ClusterBean, error)

func (*ClusterServiceImplExtended) FindAllExceptVirtual added in v0.6.24

func (impl *ClusterServiceImplExtended) FindAllExceptVirtual() ([]*bean.ClusterBean, error)

func (*ClusterServiceImplExtended) FindAllWithoutConfig added in v0.6.13

func (impl *ClusterServiceImplExtended) FindAllWithoutConfig() ([]*bean.ClusterBean, error)

func (*ClusterServiceImplExtended) FindByIdsWithoutConfig added in v1.8.0

func (impl *ClusterServiceImplExtended) FindByIdsWithoutConfig(ids []int) ([]*bean.ClusterBean, error)

func (*ClusterServiceImplExtended) GetClusterFullModeDTO added in v0.6.24

func (impl *ClusterServiceImplExtended) GetClusterFullModeDTO(beans []*bean.ClusterBean) ([]*bean.ClusterBean, error)

func (*ClusterServiceImplExtended) Save added in v0.3.9

func (*ClusterServiceImplExtended) Update added in v0.3.9

func (impl *ClusterServiceImplExtended) Update(ctx context.Context, bean *bean.ClusterBean, userId int32) (*bean.ClusterBean, error)

type EphemeralContainerService added in v0.6.21

type EphemeralContainerService interface {
	AuditEphemeralContainerAction(model bean.EphemeralContainerRequest, actionType repository.ContainerAction) error
}

type EphemeralContainerServiceImpl added in v0.6.21

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

func NewEphemeralContainerServiceImpl added in v0.6.21

func NewEphemeralContainerServiceImpl(repository repository.EphemeralContainersRepository, logger *zap.SugaredLogger) *EphemeralContainerServiceImpl

func (*EphemeralContainerServiceImpl) AuditEphemeralContainerAction added in v0.6.21

func (impl *EphemeralContainerServiceImpl) AuditEphemeralContainerAction(model bean.EphemeralContainerRequest, actionType repository.ContainerAction) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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