Documentation ¶
Index ¶
- Variables
- func GetDeploymentCondition(conditions []appsv1.DeploymentCondition, ...) *appsv1.DeploymentCondition
- func SilenceConflicts(r reconcile.Reconciler) reconcile.Reconciler
- type WebsiteReconciler
- func (r *WebsiteReconciler) ConfigMapForWebsite(serverName string, website *webhostingv1alpha1.Website, ...) (*corev1.ConfigMap, error)
- func (r *WebsiteReconciler) DeploymentForWebsite(serverName string, website *webhostingv1alpha1.Website, ...) (*appsv1.Deployment, error)
- func (r *WebsiteReconciler) IngressForWebsite(serverName string, website *webhostingv1alpha1.Website) (*networkingv1.Ingress, error)
- func (r *WebsiteReconciler) MapThemeToWebsites(ctx context.Context, theme client.Object) []reconcile.Request
- func (r *WebsiteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *WebsiteReconciler) ServiceForWebsite(serverName string, website *webhostingv1alpha1.Website) (*corev1.Service, error)
- func (r *WebsiteReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
This section is empty.
Variables ¶
var ConfigMapDataChanged = predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { if e.ObjectOld == nil || e.ObjectNew == nil { return false } oldConfigMap, ok := e.ObjectOld.(*corev1.ConfigMap) if !ok { return false } newConfigMap, ok := e.ObjectNew.(*corev1.ConfigMap) if !ok { return false } return !apiequality.Semantic.DeepEqual(oldConfigMap.Data, newConfigMap.Data) }, }
ConfigMapDataChanged is a predicate for filtering relevant ConfigMap events.
var DeploymentReadinessChanged = predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { if e.ObjectOld == nil || e.ObjectNew == nil { return false } oldDeployment, ok := e.ObjectOld.(*appsv1.Deployment) if !ok { return false } newDeployment, ok := e.ObjectNew.(*appsv1.Deployment) if !ok { return false } if !apiequality.Semantic.DeepEqual(oldDeployment.Status.ReadyReplicas, newDeployment.Status.ReadyReplicas) { return true } oldAvailable := GetDeploymentCondition(oldDeployment.Status.Conditions, appsv1.DeploymentAvailable) newAvailable := GetDeploymentCondition(newDeployment.Status.Conditions, appsv1.DeploymentAvailable) return !apiequality.Semantic.DeepEqual(oldAvailable, newAvailable) }, }
DeploymentReadinessChanged is a predicate for filtering relevant Deployment events.
var IngressSpecChanged = predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { if e.ObjectOld == nil || e.ObjectNew == nil { return false } oldIngress, ok := e.ObjectOld.(*networkingv1.Ingress) if !ok { return false } newIngress, ok := e.ObjectNew.(*networkingv1.Ingress) if !ok { return false } return !apiequality.Semantic.DeepEqual(oldIngress.Spec, newIngress.Spec) }, }
IngressSpecChanged is a predicate for filtering relevant Ingress events.
var ServiceSpecChanged = predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { if e.ObjectOld == nil || e.ObjectNew == nil { return false } oldService, ok := e.ObjectOld.(*corev1.Service) if !ok { return false } newService, ok := e.ObjectNew.(*corev1.Service) if !ok { return false } return !apiequality.Semantic.DeepEqual(oldService.Spec, newService.Spec) }, }
ServiceSpecChanged is a predicate for filtering relevant Service events.
Functions ¶
func GetDeploymentCondition ¶
func GetDeploymentCondition(conditions []appsv1.DeploymentCondition, conditionType appsv1.DeploymentConditionType) *appsv1.DeploymentCondition
GetDeploymentCondition returns the condition with the given type or nil, if it is not included.
func SilenceConflicts ¶
func SilenceConflicts(r reconcile.Reconciler) reconcile.Reconciler
SilenceConflicts wraps a reconciler to not return conflict errors. The requests is requeued with exponential backoff as if an error was returned but the error will not be logged.
Types ¶
type WebsiteReconciler ¶
type WebsiteReconciler struct { Client client.Client ShardedClient client.Client Scheme *runtime.Scheme Recorder record.EventRecorder Config *configv1alpha1.WebhostingOperatorConfig // contains filtered or unexported fields }
WebsiteReconciler reconciles a Website object.
func (*WebsiteReconciler) ConfigMapForWebsite ¶
func (r *WebsiteReconciler) ConfigMapForWebsite(serverName string, website *webhostingv1alpha1.Website, theme *webhostingv1alpha1.Theme) (*corev1.ConfigMap, error)
ConfigMapForWebsite creates a ConfigMap object to be applied for the given website.
func (*WebsiteReconciler) DeploymentForWebsite ¶
func (r *WebsiteReconciler) DeploymentForWebsite(serverName string, website *webhostingv1alpha1.Website, configMap *corev1.ConfigMap) (*appsv1.Deployment, error)
DeploymentForWebsite creates a Deployment object to be applied for the given website.
func (*WebsiteReconciler) IngressForWebsite ¶
func (r *WebsiteReconciler) IngressForWebsite(serverName string, website *webhostingv1alpha1.Website) (*networkingv1.Ingress, error)
IngressForWebsite creates a Ingress object to be applied for the given website.
func (*WebsiteReconciler) MapThemeToWebsites ¶
func (r *WebsiteReconciler) MapThemeToWebsites(ctx context.Context, theme client.Object) []reconcile.Request
MapThemeToWebsites maps a theme to all websites that use it.
func (*WebsiteReconciler) ServiceForWebsite ¶
func (r *WebsiteReconciler) ServiceForWebsite(serverName string, website *webhostingv1alpha1.Website) (*corev1.Service, error)
ServiceForWebsite creates a Service object to be applied for the given website.
func (*WebsiteReconciler) SetupWithManager ¶
func (r *WebsiteReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.