platform

package
v0.14.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlatformName

func GetPlatformName(cfg *rest.Config) (string, error)

GetPlatformName is a helper method to return the platform name from GetPlatformInfo results Accepts <nil> or instantiated 'cfg' rest config parameter.

Types

type PlatformInfo

type PlatformInfo struct {
	Name       PlatformType `json:"name"`
	K8SVersion string       `json:"k8sVersion"`
	OS         string       `json:"os"`
}

func GetPlatformInfo

func GetPlatformInfo(cfg *rest.Config) (PlatformInfo, error)

GetPlatformInfo examines the Kubernetes-based environment and determines the running platform, version, & OS. Accepts <nil> or instantiated 'cfg' rest config parameter.

Result: PlatformInfo{ Name: OpenShift, K8SVersion: 1.13+, OS: linux/amd64 }

func (PlatformInfo) IsOpenShift

func (info PlatformInfo) IsOpenShift() bool

func (PlatformInfo) String

func (info PlatformInfo) String() string

type PlatformType

type PlatformType string
const (
	OpenShift  PlatformType = "OpenShift"
	Kubernetes PlatformType = "Kubernetes"
)

Jump to

Keyboard shortcuts

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