provider

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector discovers and instantiates the appropriate cloud provider

func NewDetector

func NewDetector(
	logger logr.Logger,
	k8sClient kubernetes.Interface,
	opts ...DetectorOpt,
) *Detector

NewDetector creates a new provider detector

func (*Detector) DetectProvider

func (d *Detector) DetectProvider(ctx context.Context) (Provider, error)

DetectProvider attempts to identify and return the appropriate provider

type DetectorOpt

type DetectorOpt func(*detectorOptions)

DetectorOpt is a function that configures a Detector.

func WithKubeContextName

func WithKubeContextName(name string) DetectorOpt

WithKubeContextName sets the KubeContextName for the Detector.

type GenericProvider

type GenericProvider struct {
	sync.Mutex
	// contains filtered or unexported fields
}

GenericProvider implements basic cloud provider, cluster name, cluster version and cluster region detection

func NewGenericProvider

func NewGenericProvider(
	logger logr.Logger,
	k8sClient kubernetes.Interface,
	kubeContextName string,
) *GenericProvider

NewGenericProvider creates a new generic provider

func (*GenericProvider) GetClusterMetadata

func (p *GenericProvider) GetClusterMetadata(ctx context.Context) (map[string]interface{}, error)

GetClusterMetadata gathers basic metadata without cloud-specific information

func (*GenericProvider) Name

func (p *GenericProvider) Name() string

Name returns the provider name

type Provider

type Provider interface {
	// Name returns the provider's name (eks, gke, aks, etc.)
	Name() string

	// GetClusterMetadata retrieves provider-specific cluster metadata
	GetClusterMetadata(ctx context.Context) (map[string]interface{}, error)
}

Provider defines functionality for cloud provider-specific operations

Jump to

Keyboard shortcuts

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