Documentation
¶
Index ¶
- func CreateSecret(client client.Client, secret *corev1.Secret, logger logr.Logger) error
- func IsRequestRetryable(err error) bool
- type ConfigMapController
- func (s *ConfigMapController) CreateConfigMap(cm *corev1.ConfigMap) error
- func (s *ConfigMapController) DeleteConfigMap(cm *corev1.ConfigMap) error
- func (s *ConfigMapController) GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)
- func (s *ConfigMapController) UpdateConfigMap(cm *corev1.ConfigMap) error
- type DeploymentController
- func (d *DeploymentController) CreateDeployment(deployment *appsv1.Deployment) error
- func (d *DeploymentController) DeleteDeployment(deployment *appsv1.Deployment) error
- func (d *DeploymentController) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
- func (d *DeploymentController) ListDeploymentByLabels(namespace string, labs client.MatchingLabels) (*appsv1.DeploymentList, error)
- func (d *DeploymentController) UpdateDeployment(deployment *appsv1.Deployment) error
- type IConfigMapControl
- type ICustomResource
- type IDeploymentControl
- type IJobControl
- type INodeControl
- type IPodControl
- type IPodDisruptionBudgetControl
- type IPvcControl
- type ISecretControl
- type IServiceControl
- type IStatefulSetControl
- type JobController
- func (j *JobController) CreateJob(job *batchv1.Job) error
- func (j *JobController) DeleteJob(job *batchv1.Job) error
- func (j *JobController) GetJob(namespace, name string) (*batchv1.Job, error)
- func (j *JobController) ListJobByLabels(namespace string, labs client.MatchingLabels) (*batchv1.JobList, error)
- func (j *JobController) UpdateJob(job *batchv1.Job) error
- type NodeController
- type PodController
- func (p *PodController) CreatePod(pod *corev1.Pod) error
- func (p *PodController) DeletePod(pod *corev1.Pod) error
- func (p *PodController) DeletePodByName(namespace, name string) error
- func (p *PodController) GetPod(namespace, name string) (*corev1.Pod, error)
- func (p *PodController) UpdatePod(pod *corev1.Pod) error
- func (p *PodController) UpdatePodLabels(pod *corev1.Pod, labelKey string, labelValue string) error
- type PodDisruptionBudgetController
- func (s *PodDisruptionBudgetController) CreatePodDisruptionBudget(pb *policyv1.PodDisruptionBudget) error
- func (s *PodDisruptionBudgetController) DeletePodDisruptionBudget(pb *policyv1.PodDisruptionBudget) error
- func (s *PodDisruptionBudgetController) DeletePodDisruptionBudgetByName(namespace, name string) error
- func (s *PodDisruptionBudgetController) GetPodDisruptionBudget(namespace, name string) (*policyv1.PodDisruptionBudget, error)
- func (s *PodDisruptionBudgetController) UpdatePodDisruptionBudget(pb *policyv1.PodDisruptionBudget) error
- type SecretController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSecret ¶
func IsRequestRetryable ¶
Types ¶
type ConfigMapController ¶
type ConfigMapController struct {
// contains filtered or unexported fields
}
func (*ConfigMapController) CreateConfigMap ¶
func (s *ConfigMapController) CreateConfigMap(cm *corev1.ConfigMap) error
CreateConfigMap implement the IConfigMapControl.Interface.
func (*ConfigMapController) DeleteConfigMap ¶
func (s *ConfigMapController) DeleteConfigMap(cm *corev1.ConfigMap) error
DeleteConfigMap implement the IConfigMapControl.Interface.
func (*ConfigMapController) GetConfigMap ¶
func (s *ConfigMapController) GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)
GetConfigMap implement the IConfigMapControl.Interface.
func (*ConfigMapController) UpdateConfigMap ¶
func (s *ConfigMapController) UpdateConfigMap(cm *corev1.ConfigMap) error
UpdateConfigMap implement the IConfigMapControl.Interface.
type DeploymentController ¶
type DeploymentController struct {
// contains filtered or unexported fields
}
func (*DeploymentController) CreateDeployment ¶
func (d *DeploymentController) CreateDeployment(deployment *appsv1.Deployment) error
CreateDeployment implement the IDeploymentControl.Interface.
func (*DeploymentController) DeleteDeployment ¶
func (d *DeploymentController) DeleteDeployment(deployment *appsv1.Deployment) error
DeleteDeployment implement the IDeploymentControl.Interface.
func (*DeploymentController) GetDeployment ¶
func (d *DeploymentController) GetDeployment(namespace, name string) (*appsv1.Deployment, error)
GetDeployment implement the IDeploymentControl.Interface.
func (*DeploymentController) ListDeploymentByLabels ¶
func (d *DeploymentController) ListDeploymentByLabels(namespace string, labs client.MatchingLabels) (*appsv1.DeploymentList, error)
func (*DeploymentController) UpdateDeployment ¶
func (d *DeploymentController) UpdateDeployment(deployment *appsv1.Deployment) error
UpdateDeployment implement the IDeploymentControl.Interface.
type IConfigMapControl ¶
type IConfigMapControl interface {
// CreateConfigMap creates a ConfigMap in a DistributedRedisCluster.
CreateConfigMap(*corev1.ConfigMap) error
// UpdateConfigMap updates a ConfigMap in a DistributedRedisCluster.
UpdateConfigMap(*corev1.ConfigMap) error
// DeleteConfigMap deletes a ConfigMap in a DistributedRedisCluster.
DeleteConfigMap(*corev1.ConfigMap) error
// GetConfigMap get ConfigMap in a DistributedRedisCluster.
GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)
}
IConfigMapControl defines the interface that uses to create, update, and delete ConfigMaps.
func NewConfigMapController ¶
func NewConfigMapController(client client.Client) IConfigMapControl
NewRealConfigMapControl creates a concrete implementation of the IConfigMapControl.
type ICustomResource ¶
type ICustomResource interface {
// UpdateCRStatus update the RedisCluster status
UpdateCRStatus(runtime.Object) error
UpdateCR(runtime.Object) error
GetRedisClusterBackup(namespace, name string) (*redisv1alpha1.RedisClusterBackup, error)
GetDistributedRedisCluster(namespace, name string) (*redisv1alpha1.DistributedRedisCluster, error)
}
ICustomResource defines the interface that uses to update cr status
func NewCRControl ¶
func NewCRControl(client client.Client) ICustomResource
NewCRControl creates a concrete implementation of the ICustomResource.
type IDeploymentControl ¶
type IDeploymentControl interface {
CreateDeployment(*appsv1.Deployment) error
UpdateDeployment(*appsv1.Deployment) error
DeleteDeployment(*appsv1.Deployment) error
GetDeployment(namespace, name string) (*appsv1.Deployment, error)
ListDeploymentByLabels(namespace string, labs client.MatchingLabels) (*appsv1.DeploymentList, error)
}
IDeploymentControl define the interface that used to create, update, and delete Deployments.
func NewDeploymentController ¶
func NewDeploymentController(client client.Client) IDeploymentControl
NewRealDeploymentControl creates a concrete implementation of the IDeploymentControl.
type IJobControl ¶
type IJobControl interface {
CreateJob(*batchv1.Job) error
UpdateJob(*batchv1.Job) error
DeleteJob(*batchv1.Job) error
GetJob(namespace, name string) (*batchv1.Job, error)
ListJobByLabels(namespace string, labs client.MatchingLabels) (*batchv1.JobList, error)
}
IJobControl definej the interface that usej to create, update, and delete Jobs.
func NewJobController ¶
func NewJobController(client client.Client) IJobControl
NewRealJobControl creates a concrete implementation of the IJobControl.
type INodeControl ¶
type INodeControl interface {
// GetNode with the node name obtained from podspec.
GetNode(nodename string) (*corev1.Node, error)
// Get the Zonename of the node. if not found return unknown.
GetZoneLabel(node *corev1.Node) string
}
IPodControl defines the interface that uses to create, update, and delete Pods.
func NewNodeController ¶
func NewNodeController(client client.Client) INodeControl
NewNodeController creates a concrete implementation of the INodeControl.
type IPodControl ¶
type IPodControl interface {
// CreatePod creates a Pod in a DistributedRedisCluster.
CreatePod(*corev1.Pod) error
// UpdatePod updates a Pod in a DistributedRedisCluster.
UpdatePod(*corev1.Pod) error
// DeletePod deletes a Pod in a DistributedRedisCluster.
DeletePod(*corev1.Pod) error
DeletePodByName(namespace, name string) error
// GetPod get Pod in a DistributedRedisCluster.
GetPod(namespace, name string) (*corev1.Pod, error)
// UpdatePodLabels updates label of a pod in a DistributedRedisCluster.
UpdatePodLabels(pod *corev1.Pod, labelKey string, labelValue string) error
}
IPodControl defines the interface that uses to create, update, and delete Pods.
func NewPodController ¶
func NewPodController(client client.Client) IPodControl
NewPodController creates a concrete implementation of the IPodControl.
type IPodDisruptionBudgetControl ¶
type IPodDisruptionBudgetControl interface {
// CreatePodDisruptionBudget creates a PodDisruptionBudget in a DistributedRedisCluster.
CreatePodDisruptionBudget(*policyv1.PodDisruptionBudget) error
// UpdatePodDisruptionBudget updates a PodDisruptionBudget in a DistributedRedisCluster.
UpdatePodDisruptionBudget(*policyv1.PodDisruptionBudget) error
// DeletePodDisruptionBudget deletes a PodDisruptionBudget in a DistributedRedisCluster.
DeletePodDisruptionBudget(*policyv1.PodDisruptionBudget) error
DeletePodDisruptionBudgetByName(namespace, name string) error
// GetPodDisruptionBudget get PodDisruptionBudget in a DistributedRedisCluster.
GetPodDisruptionBudget(namespace, name string) (*policyv1.PodDisruptionBudget, error)
}
IPodDisruptionBudgetControl defines the interface that uses to create, update, and delete PodDisruptionBudgets.
func NewPodDisruptionBudgetController ¶
func NewPodDisruptionBudgetController(client client.Client) IPodDisruptionBudgetControl
NewRealPodDisruptionBudgetControl creates a concrete implementation of the IPodDisruptionBudgetControl.
type IPvcControl ¶
type IPvcControl interface {
DeletePvc(claim *corev1.PersistentVolumeClaim) error
DeletePvcByLabels(namespace string, labels map[string]string) error
GetPvc(namespace, name string) (*corev1.PersistentVolumeClaim, error)
}
IPvcControl defines the interface that uses to create, update, and delete PersistentVolumeClaim.
func NewPvcController ¶
func NewPvcController(client client.Client) IPvcControl
NewPvcController creates a concrete implementation of the IPvcControl.
type ISecretControl ¶
type ISecretControl interface {
// CreateSecret creates a Secret in a DistributedRedisCluster.
CreateSecret(*corev1.Secret) error
// UpdateSecret updates a Secret in a DistributedRedisCluster.
UpdateSecret(*corev1.Secret) error
// DeleteSecret deletes a Secret in a DistributedRedisCluster.
DeleteSecret(*corev1.Secret) error
// GetSecret get Secret in a DistributedRedisCluster.
GetSecret(namespace, name string) (*corev1.Secret, error)
}
ISecretControl defines the interface that uses to create, update, and delete Secrets.
func NewSecretController ¶
func NewSecretController(client client.Client) ISecretControl
NewRealSecretControl creates a concrete implementation of the ISecretControl.
type IServiceControl ¶
type IServiceControl interface {
// CreateService creates a Service in a DistributedRedisCluster.
CreateService(*corev1.Service) error
// UpdateService updates a Service in a DistributedRedisCluster.
UpdateService(*corev1.Service) error
// DeleteService deletes a Service in a DistributedRedisCluster.
DeleteService(*corev1.Service) error
DeleteServiceByName(namespace, name string) error
// GetService get Service in a DistributedRedisCluster.
GetService(namespace, name string) (*corev1.Service, error)
}
IServiceControl defines the interface that uses to create, update, and delete Services.
func NewServiceController ¶
func NewServiceController(client client.Client) IServiceControl
NewRealServiceControl creates a concrete implementation of the IServiceControl.
type IStatefulSetControl ¶
type IStatefulSetControl interface {
// CreateStatefulSet creates a StatefulSet in a DistributedRedisCluster.
CreateStatefulSet(*appsv1.StatefulSet) error
// UpdateStatefulSet updates a StatefulSet in a DistributedRedisCluster.
UpdateStatefulSet(*appsv1.StatefulSet) error
// DeleteStatefulSet deletes a StatefulSet in a DistributedRedisCluster.
DeleteStatefulSet(*appsv1.StatefulSet) error
DeleteStatefulSetByName(namespace, name string) error
// GetStatefulSet get StatefulSet in a DistributedRedisCluster.
GetStatefulSet(namespace, name string) (*appsv1.StatefulSet, error)
ListStatefulSetByLabels(namespace string, labels map[string]string) (*appsv1.StatefulSetList, error)
// GetStatefulSetPods will retrieve the pods managed by a given StatefulSet.
GetStatefulSetPods(namespace, name string) (*corev1.PodList, error)
GetStatefulSetPodsByLabels(namespace string, labels map[string]string) (*corev1.PodList, error)
}
IStatefulSetControl defines the interface that uses to create, update, and delete StatefulSets.
func NewStatefulSetController ¶
func NewStatefulSetController(client client.Client) IStatefulSetControl
NewRealStatefulSetControl creates a concrete implementation of the IStatefulSetControl.
type JobController ¶
type JobController struct {
// contains filtered or unexported fields
}
func (*JobController) CreateJob ¶
func (j *JobController) CreateJob(job *batchv1.Job) error
CreateJob implement the IJobControl.Interface.
func (*JobController) DeleteJob ¶
func (j *JobController) DeleteJob(job *batchv1.Job) error
DeleteJob implement the IJobControl.Interface.
func (*JobController) GetJob ¶
func (j *JobController) GetJob(namespace, name string) (*batchv1.Job, error)
GetJob implement the IJobControl.Interface.
func (*JobController) ListJobByLabels ¶
func (j *JobController) ListJobByLabels(namespace string, labs client.MatchingLabels) (*batchv1.JobList, error)
type NodeController ¶
type NodeController struct {
// contains filtered or unexported fields
}
func (*NodeController) GetNode ¶
func (p *NodeController) GetNode(nodename string) (*corev1.Node, error)
GetNode with the node name obtained from podspec.
func (*NodeController) GetZoneLabel ¶
func (p *NodeController) GetZoneLabel(node *corev1.Node) string
type PodController ¶
type PodController struct {
// contains filtered or unexported fields
}
func (*PodController) CreatePod ¶
func (p *PodController) CreatePod(pod *corev1.Pod) error
CreatePod implement the IPodControl.Interface.
func (*PodController) DeletePod ¶
func (p *PodController) DeletePod(pod *corev1.Pod) error
DeletePod implement the IPodControl.Interface.
func (*PodController) DeletePodByName ¶
func (p *PodController) DeletePodByName(namespace, name string) error
DeletePod implement the IPodControl.Interface.
func (*PodController) GetPod ¶
func (p *PodController) GetPod(namespace, name string) (*corev1.Pod, error)
GetPod implement the IPodControl.Interface.
func (*PodController) UpdatePod ¶
func (p *PodController) UpdatePod(pod *corev1.Pod) error
UpdatePod implement the IPodControl.Interface.
func (*PodController) UpdatePodLabels ¶
type PodDisruptionBudgetController ¶
type PodDisruptionBudgetController struct {
// contains filtered or unexported fields
}
func (*PodDisruptionBudgetController) CreatePodDisruptionBudget ¶
func (s *PodDisruptionBudgetController) CreatePodDisruptionBudget(pb *policyv1.PodDisruptionBudget) error
CreatePodDisruptionBudget implement the IPodDisruptionBudgetControl.Interface.
func (*PodDisruptionBudgetController) DeletePodDisruptionBudget ¶
func (s *PodDisruptionBudgetController) DeletePodDisruptionBudget(pb *policyv1.PodDisruptionBudget) error
DeletePodDisruptionBudget implement the IPodDisruptionBudgetControl.Interface.
func (*PodDisruptionBudgetController) DeletePodDisruptionBudgetByName ¶
func (s *PodDisruptionBudgetController) DeletePodDisruptionBudgetByName(namespace, name string) error
func (*PodDisruptionBudgetController) GetPodDisruptionBudget ¶
func (s *PodDisruptionBudgetController) GetPodDisruptionBudget(namespace, name string) (*policyv1.PodDisruptionBudget, error)
GetPodDisruptionBudget implement the IPodDisruptionBudgetControl.Interface.
func (*PodDisruptionBudgetController) UpdatePodDisruptionBudget ¶
func (s *PodDisruptionBudgetController) UpdatePodDisruptionBudget(pb *policyv1.PodDisruptionBudget) error
UpdatePodDisruptionBudget implement the IPodDisruptionBudgetControl.Interface.
type SecretController ¶
type SecretController struct {
// contains filtered or unexported fields
}
func (*SecretController) CreateSecret ¶
func (s *SecretController) CreateSecret(cm *corev1.Secret) error
CreateSecret implement the ISecretControl.Interface.
func (*SecretController) DeleteSecret ¶
func (s *SecretController) DeleteSecret(cm *corev1.Secret) error
DeleteSecret implement the ISecretControl.Interface.
func (*SecretController) GetSecret ¶
func (s *SecretController) GetSecret(namespace, name string) (*corev1.Secret, error)
GetSecret implement the ISecretControl.Interface.
func (*SecretController) UpdateSecret ¶
func (s *SecretController) UpdateSecret(cm *corev1.Secret) error
UpdateSecret implement the ISecretControl.Interface.