controllers

package
v0.0.0-...-9620476 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// LastAppliedPodTemplate is annotation key of the last applied pod template
	LastAppliedPodTemplate = "seaweedfs.com/last-applied-podtemplate"

	// LastAppliedConfigAnnotation is annotation key of last applied configuration
	LastAppliedConfigAnnotation = "seaweedfs.com/last-applied-configuration"
)

Variables

This section is empty.

Functions

func DeploymentPodSpecChanged

func DeploymentPodSpecChanged(newDep *appsv1.Deployment, oldDep *appsv1.Deployment) bool

DeploymentPodSpecChanged checks whether the new deployment differs with the old one's last-applied-config

func EmptyClone

func EmptyClone(obj runtime.Object) (runtime.Object, error)

EmptyClone create an clone of the resource with the same name and namespace (if namespace-scoped), with other fields unset

func GetDeploymentLastAppliedPodTemplate

func GetDeploymentLastAppliedPodTemplate(dep *appsv1.Deployment) (*corev1.PodSpec, error)

GetDeploymentLastAppliedPodTemplate set last applied pod template from Deployment's annotation

func InferObjectKind

func InferObjectKind(obj runtime.Object) (schema.GroupVersionKind, error)

InferObjectKind infers the object kind

func IngressEqual

func IngressEqual(newIngress, oldIngres *networkingv1.Ingress) (bool, error)

func ReconcileResult

func ReconcileResult(err error) (bool, ctrl.Result, error)

func ServiceEqual

func ServiceEqual(newSvc, oldSvc *corev1.Service) (bool, error)

ServiceEqual compares the new Service's spec with old Service's last applied config

Types

type MergeFn

type MergeFn func(existing, desired runtime.Object) error

MergeFn is to resolve conflicts

type SeaweedReconciler

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

SeaweedReconciler reconciles a Seaweed object

func (*SeaweedReconciler) CreateOrUpdate

func (r *SeaweedReconciler) CreateOrUpdate(obj runtime.Object, mergeFn MergeFn) (runtime.Object, error)

CreateOrUpdate create an object to the Kubernetes cluster for controller, if the object to create is existed, call mergeFn to merge the change in new object to the existing object, then update the existing object. The object will also be adopted by the given controller.

func (*SeaweedReconciler) CreateOrUpdateConfigMap

func (r *SeaweedReconciler) CreateOrUpdateConfigMap(configMap *corev1.ConfigMap) (*corev1.ConfigMap, error)

func (*SeaweedReconciler) CreateOrUpdateDeployment

func (r *SeaweedReconciler) CreateOrUpdateDeployment(deploy *appsv1.Deployment) (*appsv1.Deployment, error)

func (*SeaweedReconciler) CreateOrUpdateIngress

func (r *SeaweedReconciler) CreateOrUpdateIngress(ingress *networkingv1.Ingress) (*networkingv1.Ingress, error)

func (*SeaweedReconciler) CreateOrUpdateService

func (r *SeaweedReconciler) CreateOrUpdateService(svc *corev1.Service) (*corev1.Service, error)

func (*SeaweedReconciler) CreateOrUpdateServiceMonitor

func (r *SeaweedReconciler) CreateOrUpdateServiceMonitor(serviceMonitor *monitorv1.ServiceMonitor) (*monitorv1.ServiceMonitor, error)

func (*SeaweedReconciler) Reconcile

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

Reconcile implements the reconcilation logic

func (*SeaweedReconciler) SetupWithManager

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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