controllers

package
v0.0.0-...-a67e8b1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverPortsLabel

func DiscoverPortsLabel(ctx context.Context, workload *unstructured.Unstructured, r client.Reader, dm discoverymapper.DiscoveryMapper, childResources []*unstructured.Unstructured) ([]intstr.IntOrString, map[string]string, error)

DiscoverPortsLabel assume the workload or it's childResource will always having spec.template as PodTemplate if discoverable

func FillRouteTraitWithService

func FillRouteTraitWithService(service *corev1.Service, routeTrait *v1alpha1.Route)

FillRouteTraitWithService will use existing Service or created Service to fill the spec

func MatchService

func MatchService(targetPort intstr.IntOrString, rule v1alpha1.Rule) bool

MatchService try check if the service matches the rules

func NeedDiscovery

func NeedDiscovery(routeTrait *v1alpha1.Route) bool

NeedDiscovery checks the routeTrait Spec if it's needed to automatically discover

func Setup

func Setup(mgr ctrl.Manager) error

Setup adds a controller that reconciles MetricsTrait.

Types

type Reconciler

type Reconciler struct {
	client.Client

	Log logr.Logger

	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

Reconciler reconciles a Route object

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

Reconcile is the main logic of controller +kubebuilder:rbac:groups=standard.oam.dev,resources=routes,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=standard.oam.dev,resources=routes/status,verbs=get;update;patch

func (*Reconciler) SetupWithManager

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

SetupWithManager setup with manager

func (*Reconciler) UpdateStatus

func (r *Reconciler) UpdateStatus(ctx context.Context, route *standardv1alpha1.Route, opts ...client.UpdateOption) error

UpdateStatus updates standardv1alpha1.Route's Status with retry.RetryOnConflict

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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