route

package
v0.0.0-...-5f9e29a Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EndpointTypePassthrough             = "EndpointTypePassthrough"
	EndpointTypeInsecureEdge            = "EndpointTypeInsecureEdge"
	InsecureEdgeTerminationPolicyPort   = 8080
	TLSTerminationPassthroughPolicyPort = 6443
)

Variables

View Source
var IngressPort int32 = 443

Functions

func APIsToWatch

func APIsToWatch(c client.Client) ([]client.Object, error)

APIsToWatch give a list of APIs to watch if using this package to deploy the endpoint. The error can be checked as follows to determine if the package is not usable with the given kube apiserver

 	noResourceError := &metaapi.NoResourceMatchError{}
		if errors.As(err, &noResourceError) {
		}

func AddToScheme

func AddToScheme(scheme *runtime.Scheme) error

AddToScheme should be used as soon as scheme is created to add route objects for encoding/decoding

func New

func New(ctx context.Context, c client.Client, logger logr.Logger,
	namespacedName types.NamespacedName,
	eType EndpointType,
	hostname *string,
	labels map[string]string,
	ownerReferences []metav1.OwnerReference) (endpoint.Endpoint, error)

New creates the route endpoint object, deploys the resource on the cluster and then checks for the health of the route. Before using the fields of the route it is always recommended to check if the route is healthy.

In order to identify if the route API exists check for the following error after calling New() noResourceError := &metaapi.NoResourceMatchError{}

	switch {
	case errors.As(err, &noResourceError):
		// log route is not available, reconcilers should not requeue at this point
		log.Info("route.openshift.io is unavailable, route endpoint will be disabled")
 }

In order to generate the right RBAC, add the following lines to the Reconcile function annotations. +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete

Types

type EndpointType

type EndpointType string

Jump to

Keyboard shortcuts

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