controllers

package
v0.0.0-...-54e9ee3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixEndpoint     = "/cloud/project"
	GetServiceEndpoint = "database/service"
	Mask               = "/32"
)

Variables

This section is empty.

Functions

func GetServicesForProjectId

func GetServicesForProjectId(ctx context.Context, r *DatabaseReconciler, projectId string) ([]string, error)

func UpdateClusterNodeIps

func UpdateClusterNodeIps(ctx context.Context, r *DatabaseReconciler, projectId string, serviceId string, engine string, ips []IpRestriction) error

Types

type Cluster

type Cluster struct {
	ID          string          `json:"id"`
	Engine      string          `json:"engine"`
	Ips         []IpRestriction `json:"ipRestrictions"`
	NetworkType string          `json:"networkType"`
}

func GetCluster

func GetCluster(ctx context.Context, r *DatabaseReconciler, projectId string, serviceId string) (*Cluster, error)

type ClusterUpdate

type ClusterUpdate struct {
	Ips []IpRestriction `json:"ipRestrictions"`
}

type DatabaseReconciler

type DatabaseReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	OvhClient *ovh.Client
}

DatabaseReconciler reconciles a Database object

func (*DatabaseReconciler) ProcessIpAuthorizationForOneService

func (r *DatabaseReconciler) ProcessIpAuthorizationForOneService(ctx context.Context, crd v1alpha1.Database, nodes corev1.NodeList, projectId string, serviceId string) error

func (*DatabaseReconciler) Reconcile

func (r *DatabaseReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the Database 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.14.1/pkg/reconcile

func (*DatabaseReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type IpRestriction

type IpRestriction struct {
	IP          string `json:"ip"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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