znodecontroller

package
v0.0.0-...-1b11d85 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnect

func GetConnect(zkList []string) (conn *zk.Conn)

Types

type ConfigmapReconciler

type ConfigmapReconciler struct {
	common.GeneralResourceStyleReconciler[*zkv1alpha1.ZookeeperZnode, *zkv1alpha1.RoleGroupSpec]
	// contains filtered or unexported fields
}

func NewConfigmap

func NewConfigmap(
	scheme *runtime.Scheme,
	instance *zkv1alpha1.ZookeeperZnode,
	client client.Client,
	groupName string,
	mergedLabels map[string]string,
	mergedCfg *zkv1alpha1.RoleGroupSpec,
	znodePath string,
	cluster *zkv1alpha1.ZookeeperCluster,
) *ConfigmapReconciler

NewConfigmap new a ConfigmapReconciler

func (*ConfigmapReconciler) Build

type ZNodeReconciler

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

func NewZNodeReconciler

func NewZNodeReconciler(
	scheme *runtime.Scheme,
	instance *zkv1alpha1.ZookeeperZnode,
	client client.Client,
) *ZNodeReconciler

NewZNodeReconciler new a ZNodeReconciler

type ZkClient

type ZkClient struct {
	// The address of the zookeeper server
	Address string

	// The zk client
	Client *zk.Conn
}

func NewZkClient

func NewZkClient(address string) *ZkClient

NewZkClient new zk client

func (ZkClient) Close

func (z ZkClient) Close()

func (ZkClient) Create

func (z ZkClient) Create(path string, data []byte) error

func (ZkClient) Delete

func (z ZkClient) Delete(path string) error

func (ZkClient) Exists

func (z ZkClient) Exists(path string) (bool, error)

type ZkClientRepository

type ZkClientRepository interface {
	// Create a znode with the given path and data
	Create(path string, data []byte) error

	// Delete the znode with the given path
	Delete(path string) error

	// Close the connection
	Close()

	// Exists weather the znode with the given path exists
	Exists(path string) (bool, error)
}

type ZookeeperZnodeReconciler

type ZookeeperZnodeReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

ZookeeperZnodeReconciler reconciles a ZookeeperZnode object

func (*ZookeeperZnodeReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ZookeeperZnode object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile

func (*ZookeeperZnodeReconciler) SetupWithManager

func (r *ZookeeperZnodeReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*ZookeeperZnodeReconciler) UpdateStatus

func (r *ZookeeperZnodeReconciler) UpdateStatus(ctx context.Context, instance *zkv1alpha1.ZookeeperCluster) error

UpdateStatus updates the status of the ZookeeperCluster resource https://stackoverflow.com/questions/76388004/k8s-controller-update-status-and-condition

Jump to

Keyboard shortcuts

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