Documentation
¶
Index ¶
- Constants
- func ApplyAdditionalRoute(ctx context.Context, client routeclient.RoutesGetter, required *routev1.Route) (*routev1.Route, bool, error)
- func ApplyRoute(client routeclient.RoutesGetter, required *routev1.Route) (*routev1.Route, bool, error)
- func GetActiveRouteInfo(routeClient routev1listers.RouteLister, activeRouteName string) (route *routev1.Route, routeURL *url.URL, reason string, err error)
- func GetAdditionalComponentRouteSpecs(ingressConfig *configv1.Ingress) []configv1.ComponentRouteSpec
- func GetAdditionalRouteHostnames(ingressConfig *configv1.Ingress) []string
- func GetComponentRouteSpecsByPrefix(ingressConfig *configv1.Ingress, routeName string) []configv1.ComponentRouteSpec
- func GetCustomRouteName(routeName string) string
- func GetDefaultRouteHost(routeName string, ingressConfig *configv1.Ingress) string
- func LoadCAFromSecret(secret *corev1.Secret) (*crypto.CA, error)
- func MakeAdditionalRoute(spec configv1.ComponentRouteSpec, customTLSCert *CustomTLSCert) *routev1.Route
- type CustomTLSCert
- type RouteConfig
- func (rc *RouteConfig) CustomRoute(tlsConfig *CustomTLSCert, routeName string) *routev1.Route
- func (rc *RouteConfig) DefaultRoute(tlsConfig *CustomTLSCert, ingressConfig *configv1.Ingress) *routev1.Route
- func (rc *RouteConfig) GetCustomRoute() RouteControllerSpec
- func (rc *RouteConfig) GetCustomRouteHostname() string
- func (rc *RouteConfig) GetCustomTLSSecretName() string
- func (rc *RouteConfig) GetDefaultRoute() RouteControllerSpec
- func (rc *RouteConfig) GetDefaultTLSSecretName() string
- func (rc *RouteConfig) GetDomain() string
- func (rc *RouteConfig) GetRouteName() string
- func (rc *RouteConfig) HostnameMatch() bool
- func (rc *RouteConfig) IsCustomHostnameSet() bool
- func (rc *RouteConfig) IsCustomTLSSecretSet() bool
- func (rc *RouteConfig) IsDefaultTLSSecretSet() bool
- func (rc *RouteConfig) UnsetTLS()
- type RouteControllerSpec
Constants ¶
const AdditionalRouteLabel = "console.openshift.io/additional-route"
Variables ¶
This section is empty.
Functions ¶
func ApplyAdditionalRoute ¶
func ApplyAdditionalRoute(ctx context.Context, client routeclient.RoutesGetter, required *routev1.Route) (*routev1.Route, bool, error)
ApplyAdditionalRoute applies a route with full label reconciliation. Unlike ApplyRoute which only merges labels additively, this function removes stale user-specified labels from the existing route that are no longer present in the required route.
func ApplyRoute ¶
func ApplyRoute(client routeclient.RoutesGetter, required *routev1.Route) (*routev1.Route, bool, error)
func GetActiveRouteInfo ¶
func GetActiveRouteInfo(routeClient routev1listers.RouteLister, activeRouteName string) (route *routev1.Route, routeURL *url.URL, reason string, err error)
func GetAdditionalComponentRouteSpecs ¶
func GetAdditionalComponentRouteSpecs(ingressConfig *configv1.Ingress) []configv1.ComponentRouteSpec
func GetComponentRouteSpecsByPrefix ¶
func GetComponentRouteSpecsByPrefix(ingressConfig *configv1.Ingress, routeName string) []configv1.ComponentRouteSpec
GetComponentRouteSpecsByPrefix returns componentRoutes in the openshift-console namespace whose name starts with the given prefix, excluding the primary route and its *-custom variant (those are handled by SyncDefaultRoute/SyncCustomRoute).
func GetCustomRouteName ¶
func GetDefaultRouteHost ¶
func LoadCAFromSecret ¶
LoadCAFromSecret parses a kubernetes.io/tls Secret into a crypto.CA, suitable for signing serving certs.
func MakeAdditionalRoute ¶
func MakeAdditionalRoute(spec configv1.ComponentRouteSpec, customTLSCert *CustomTLSCert) *routev1.Route
Types ¶
type CustomTLSCert ¶
holds information about custom TLS certificate and its key
func EnsureHTTP2Cert ¶
func EnsureHTTP2Cert(ctx context.Context, secretClient corev1client.SecretsGetter, secretLister corev1listers.SecretLister, hostname string, ca *crypto.CA) (*CustomTLSCert, error)
EnsureHTTP2Cert returns a TLS cert for HTTP/2 enablement, creating or regenerating one as needed. The cert is persisted in a Secret in the openshift-console namespace so it survives operator restarts without triggering unnecessary route updates.
func GenerateHTTP2Cert ¶
func GenerateHTTP2Cert(hostname string, ca *crypto.CA) (*CustomTLSCert, error)
GenerateHTTP2Cert creates a TLS certificate for the given hostname to enable HTTP/2 on the console route. The cert's only purpose is to be unique in the router's cert_config.map so that per-cert ALPN negotiation kicks in.
If ca is provided, the cert is signed by that CA (the ingress controller's CA, so the trust chain matches the wildcard cert). Otherwise a self-signed CA is created and used.
func GetCustomTLS ¶
func GetCustomTLS(customCertSecret *corev1.Secret) (*CustomTLSCert, error)
type RouteConfig ¶
type RouteConfig struct {
// contains filtered or unexported fields
}
func NewRouteConfig ¶
func NewRouteConfig(operatorConfig *operatorv1.Console, ingressConfig *configv1.Ingress, routeName string) *RouteConfig
func (*RouteConfig) CustomRoute ¶
func (rc *RouteConfig) CustomRoute(tlsConfig *CustomTLSCert, routeName string) *routev1.Route
func (*RouteConfig) DefaultRoute ¶
func (rc *RouteConfig) DefaultRoute(tlsConfig *CustomTLSCert, ingressConfig *configv1.Ingress) *routev1.Route
Default `console` route points by default to the `console` service. If custom Hostname for the console is set, then the default route should point to the redirect `console-redirect` service and the created custom route should be pointing to the `console` service.
func (*RouteConfig) GetCustomRoute ¶
func (rc *RouteConfig) GetCustomRoute() RouteControllerSpec
func (*RouteConfig) GetCustomRouteHostname ¶
func (rc *RouteConfig) GetCustomRouteHostname() string
func (*RouteConfig) GetCustomTLSSecretName ¶
func (rc *RouteConfig) GetCustomTLSSecretName() string
func (*RouteConfig) GetDefaultRoute ¶
func (rc *RouteConfig) GetDefaultRoute() RouteControllerSpec
func (*RouteConfig) GetDefaultTLSSecretName ¶
func (rc *RouteConfig) GetDefaultTLSSecretName() string
func (*RouteConfig) GetDomain ¶
func (rc *RouteConfig) GetDomain() string
func (*RouteConfig) GetRouteName ¶
func (rc *RouteConfig) GetRouteName() string
func (*RouteConfig) HostnameMatch ¶
func (rc *RouteConfig) HostnameMatch() bool
func (*RouteConfig) IsCustomHostnameSet ¶
func (rc *RouteConfig) IsCustomHostnameSet() bool
func (*RouteConfig) IsCustomTLSSecretSet ¶
func (rc *RouteConfig) IsCustomTLSSecretSet() bool
func (*RouteConfig) IsDefaultTLSSecretSet ¶
func (rc *RouteConfig) IsDefaultTLSSecretSet() bool
func (*RouteConfig) UnsetTLS ¶
func (rc *RouteConfig) UnsetTLS()