Documentation ¶
Index ¶
- func DiscoverPortsLabel(ctx context.Context, workload *unstructured.Unstructured, r client.Reader, ...) ([]intstr.IntOrString, map[string]string, error)
- func FillRouteTraitWithService(service *corev1.Service, routeTrait *v1alpha1.Route)
- func MatchService(targetPort intstr.IntOrString, rule v1alpha1.Rule) bool
- func NeedDiscovery(routeTrait *v1alpha1.Route) bool
- func Setup(mgr ctrl.Manager) error
- type Reconciler
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 ¶
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 ¶
NeedDiscovery checks the routeTrait Spec if it's needed to automatically discover
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 ¶
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 ¶ added in v0.3.3
func (r *Reconciler) UpdateStatus(ctx context.Context, route *standardv1alpha1.Route, opts ...client.UpdateOption) error
UpdateStatus updates standardv1alpha1.Route's Status with retry.RetryOnConflict