detect

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DetectedFromUser    string = "user-supplied"
	DetectedFromCluster string = "autodetected from cluster"
	DetectedFailure     string = "autodetection failed"
)

Variables

This section is empty.

Functions

func KubernetesVersion added in v0.7.0

func KubernetesVersion(ctx context.Context) (platform.Version, error)

TODO: we need to wait for the client-go to be fixed to accept a context

func KubernetesVersionFromDiscovery added in v0.15.0

func KubernetesVersionFromDiscovery(_ context.Context, cli discovery.ServerVersionInterface) (platform.Version, error)

func OpenshiftVersion added in v0.7.0

func OpenshiftVersion(ctx context.Context) (platform.Version, error)

func OpenshiftVersionFromGetter added in v0.15.0

func OpenshiftVersionFromGetter(ctx context.Context, coGetter ClusterOperatorsGetter) (platform.Version, error)

func Platform added in v0.7.0

func Platform(ctx context.Context) (platform.Platform, error)

func PlatformFromClients added in v0.20.2

func PlatformFromClients(ctx context.Context, cvLister ClusterVersionsLister, infraGetter InfrastructuresGetter) (platform.Platform, error)

func PlatformFromLister added in v0.15.0

func PlatformFromLister(ctx context.Context, cvLister ClusterVersionsLister) (platform.Platform, error)

PlatformFromLister is deprecated, use PlatformFromClients instead

func Version added in v0.7.0

func Version(ctx context.Context, plat platform.Platform) (platform.Version, error)

Types

type ClusterInfo added in v0.7.0

type ClusterInfo struct {
	Platform PlatformInfo `json:"platform"`
	Version  VersionInfo  `json:"version"`
}

func (ClusterInfo) String added in v0.10.0

func (ci ClusterInfo) String() string

func (ClusterInfo) ToJSON added in v0.10.0

func (ci ClusterInfo) ToJSON() string

type ClusterOperatorsGetter added in v0.15.0

type ClusterOperatorsGetter interface {
	Get(ctx context.Context, name string, opts metav1.GetOptions) (*ocpconfigv1.ClusterOperator, error)
}

type ClusterVersionsLister added in v0.15.0

type ClusterVersionsLister interface {
	List(ctx context.Context, opts metav1.ListOptions) (*ocpconfigv1.ClusterVersionList, error)
}

type ControlPlaneInfo added in v0.20.1

type ControlPlaneInfo struct {
	NodeCount int `json:"nodeCount"`
}

func ControlPlane added in v0.20.1

func ControlPlane(ctx context.Context) (ControlPlaneInfo, error)

func ControlPlaneFromLister added in v0.20.1

func ControlPlaneFromLister(ctx context.Context, cli client.Client) (ControlPlaneInfo, error)

func (ControlPlaneInfo) String added in v0.20.1

func (cpi ControlPlaneInfo) String() string

func (ControlPlaneInfo) ToJSON added in v0.20.1

func (cpi ControlPlaneInfo) ToJSON() string

type InfrastructuresGetter added in v0.20.2

type InfrastructuresGetter interface {
	Get(ctx context.Context, name string, options metav1.GetOptions) (*ocpconfigv1.Infrastructure, error)
}

type PlatformInfo added in v0.7.0

type PlatformInfo struct {
	AutoDetected platform.Platform `json:"autoDetected"`
	UserSupplied platform.Platform `json:"userSupplied"`
	Discovered   platform.Platform `json:"discovered"`
}

func FindPlatform added in v0.7.0

func FindPlatform(ctx context.Context, userSupplied platform.Platform) (PlatformInfo, string, error)

type VersionInfo added in v0.7.0

type VersionInfo struct {
	AutoDetected platform.Version `json:"autoDetected"`
	UserSupplied platform.Version `json:"userSupplied"`
	Discovered   platform.Version `json:"discovered"`
}

func FindVersion added in v0.7.0

func FindVersion(ctx context.Context, plat platform.Platform, userSupplied platform.Version) (VersionInfo, string, error)

Jump to

Keyboard shortcuts

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