route

package
v0.0.0-...-81cd6e7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, c client.Client, r *routev1.Route, equal EqualityFunc, mutate MutateFunc) error

CreateOrUpdate attempts first to get the given route. If the route does not exist, the route will be created. Otherwise, if the route exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.

func Get

Get returns the openshift route for the given object key or an error.

func MutateTLSConfigOnly

func MutateTLSConfigOnly(current, desired *routev1.Route)

MutateTLSConfigOnly is a default mutate implementation that copies only the route's tls config from desired to current.

func RouteTLSConfigEqual

func RouteTLSConfigEqual(current, desired *routev1.Route) bool

RouteTLSConfigEqual returns true only if the routes are equal in tls configs.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder represents the struct to build openshift api route objects

func New

func New(routeName, namespace, serviceName string, labels map[string]string) *Builder

New returns a new Builder for openshift api route objects.

func (*Builder) Build

func (b *Builder) Build() *routev1.Route

Build returns the final route object

func (*Builder) WithCA

func (b *Builder) WithCA(caCert []byte) *Builder

WithCA sets the certificate authority to the TLS config if present

func (*Builder) WithTLSConfig

func (b *Builder) WithTLSConfig(tc *routev1.TLSConfig) *Builder

WithTLSConfig sets the route TLS configuration

type EqualityFunc

type EqualityFunc func(current, desired *routev1.Route) bool

EqualityFunc is the type for functions that compare two routes. Return true if two route are equal.

type MutateFunc

type MutateFunc func(current, desired *routev1.Route)

MutateFunc is the type for functions that mutate the current route by applying the values from the desired route.

Jump to

Keyboard shortcuts

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