discovery

package
v1.42.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package discovery exposes helpers for detecting cluster shape (provider, multi-tenancy, served APIs) at operator startup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoDiscoverProvider

func AutoDiscoverProvider(ctx context.Context, clientset kubernetes.Interface) (operatorv1.Provider, error)

func MultiTenant

func MultiTenant(ctx context.Context, c kubernetes.Interface) (bool, error)

func RequiresTigeraSecure

func RequiresTigeraSecure(clientset *kubernetes.Clientset) (bool, error)

RequiresTigeraSecure determines if the configuration requires we start the tigera secure controllers.

func UseExternalElastic

func UseExternalElastic(config *corev1.ConfigMap) bool

UseExternalElastic returns true if this cluster is configured to use an external elasticsearch cluster, and false otherwise.

Types

type APIDiscovery

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

APIDiscovery is a snapshot of which API versions a cluster serves for the set of GroupKinds the operator cares about. Lookups are pure map reads; no API calls are made after construction.

func DiscoverAPIs

func DiscoverAPIs(mapper meta.RESTMapper) *APIDiscovery

DiscoverAPIs consults the supplied RESTMapper for each tracked GroupKind and records the preferred served version. GroupKinds not served by the cluster (or unknown to the RESTMapper) map to the empty string. Only GroupKinds listed in trackedGroupKinds are queried.

func NewStaticAPIDiscovery

func NewStaticAPIDiscovery(versions map[schema.GroupKind]string) *APIDiscovery

NewStaticAPIDiscovery constructs an APIDiscovery from an explicit version map. Intended for tests.

func (*APIDiscovery) ServedVersion

func (d *APIDiscovery) ServedVersion(group, kind string) string

ServedVersion returns the preferred served version for the given GroupKind, or "" if the kind is not served by the cluster (or is not in the tracked set).

Jump to

Keyboard shortcuts

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