controllers

package
v0.0.0-...-676ee26 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMirroringMode                  = "snapshot"
	MirroringModeKey                      = "mirroringMode"
	SchedulingIntervalKey                 = "schedulingInterval"
	ReplicationSecretNameKey              = "replication.storage.openshift.io/replication-secret-name"
	ReplicationSecretNamespaceKey         = "replication.storage.openshift.io/replication-secret-namespace"
	ReplicationIDKey                      = "replicationid"
	RBDVolumeReplicationClassNameTemplate = "rbd-volumereplicationclass-%v"
	RBDReplicationSecretName              = "rook-csi-rbd-provisioner"
	RamenLabelTemplate                    = "ramendr.openshift.io/%s"
	RBDProvisionerTemplate                = "%s.rbd.csi.ceph.com"
)
View Source
const (
	WebhookCertDir  = "/apiserver.local.config/certificates"
	WebhookCertName = "apiserver.crt"
	WebhookKeyName  = "apiserver.key"
)

Variables

This section is empty.

Functions

func NewManagerCommand

func NewManagerCommand() *cobra.Command

func PeersConnectedToPeerRef

func PeersConnectedToPeerRef(sourcePeerRef multiclusterv1alpha1.PeerRef, mirrorPeers []multiclusterv1alpha1.MirrorPeer) []multiclusterv1alpha1.PeerRef

PeersConnectedToPeerRef returns a list of PeerRefs connected to the 'sourcePeerRef'.

func PeersConnectedToSecret

func PeersConnectedToSecret(secret *corev1.Secret, mirrorPeers []multiclusterv1alpha1.MirrorPeer) ([]multiclusterv1alpha1.PeerRef, error)

PeersConnectedToSecret return unique PeerRefs associated with the secret

Types

type DRPolicyReconciler

type DRPolicyReconciler struct {
	HubClient client.Client
	Scheme    *runtime.Scheme
}

func (*DRPolicyReconciler) Reconcile

func (r *DRPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*DRPolicyReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ManagerOptions

type ManagerOptions struct {
	MetricsAddr             string
	EnableLeaderElection    bool
	ProbeAddr               string
	MulticlusterConsolePort int
	ZapOpts                 zap.Options
}

func NewManagerOptions

func NewManagerOptions() *ManagerOptions

func (*ManagerOptions) AddFlags

func (o *ManagerOptions) AddFlags(cmd *cobra.Command)

type MirrorPeerReconciler

type MirrorPeerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

MirrorPeerReconciler reconciles a MirrorPeer object

func (*MirrorPeerReconciler) Reconcile

func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

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

func (*MirrorPeerReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type MirrorPeerSecretReconciler

type MirrorPeerSecretReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

MirrorPeerSecretReconciler reconciles MirrorPeer CRs, and source/destination Secrets

func (*MirrorPeerSecretReconciler) Reconcile

Reconcile standard reconcile function for MirrorPeerSecret controller

func (*MirrorPeerSecretReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type NamedPeerRefWithSecretData

type NamedPeerRefWithSecretData struct {
	multiclusterv1alpha1.PeerRef
	Name         string
	Data         []byte
	SecretOrigin string
}

NamedPeerRefWithSecretData is an intermediate data structure, when converting a source secret to corresponding peer destination secret

func NewNamedPeerRefWithSecretData

func NewNamedPeerRefWithSecretData(secret *corev1.Secret, peerRef multiclusterv1alpha1.PeerRef) *NamedPeerRefWithSecretData

NewNamedPeerRefWithSecretData creates a new PeerRef instance which has the source Name and Data details attached to it. Make sure we give a source secret and it's (one of the) connected PeerRef as arguments.

func (*NamedPeerRefWithSecretData) CreateOrUpdateDestinationSecret

func (nPR *NamedPeerRefWithSecretData) CreateOrUpdateDestinationSecret(ctx context.Context, rc client.Client) error

CreateOrUpdateDestinationSecret creates/updates the destination secret from NamedPeerRefWithSecretData object

func (*NamedPeerRefWithSecretData) ErrorOnNilReceiver

func (nPR *NamedPeerRefWithSecretData) ErrorOnNilReceiver() (err error)

func (*NamedPeerRefWithSecretData) GenerateSecret

func (nPR *NamedPeerRefWithSecretData) GenerateSecret(secretLabelType utils.SecretLabelType) *corev1.Secret

GenerateSecret will generate a secret of provided type. nPeerRef object contains TWO parts,

a. details of the secret, like name,namespace etc; that is to be generated
b. data part that is to be passed on to the newly created secret

The type of secret (ie; source or destination) is passed as the argument

func (*NamedPeerRefWithSecretData) GetAssociatedSecret

func (nPR *NamedPeerRefWithSecretData) GetAssociatedSecret(ctx context.Context, rc client.Client, holdSecret *corev1.Secret) error

GetAssociatedSecret returns a secret in the cluster, which has the same 'Name' and 'Namespace' matching the PeerRef's name and clustername

func (*NamedPeerRefWithSecretData) Request

func (nPR *NamedPeerRefWithSecretData) Request() (req reconcile.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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