platform

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discoverer

type Discoverer interface {
	ServerVersion() (*version.Info, error)
	ServerGroups() (*v1.APIGroupList, error)
	OpenAPISchema() (*openapi_v2.Document, error)
	RESTClient() rest.Interface
}

type K8SBasedPlatformVersioner

type K8SBasedPlatformVersioner struct{}

func (K8SBasedPlatformVersioner) CompareOpenShiftVersion added in v1.4.3

func (pv K8SBasedPlatformVersioner) CompareOpenShiftVersion(client Discoverer, cfg *rest.Config, version string) (int, error)

func (K8SBasedPlatformVersioner) DefaultArgs

func (K8SBasedPlatformVersioner) DefaultArgs(client Discoverer, cfg *rest.Config) (Discoverer, *rest.Config, error)

deal with cfg coming from legacy method signature and allow injection for client testing

func (K8SBasedPlatformVersioner) GetPlatformInfo

func (pv K8SBasedPlatformVersioner) GetPlatformInfo(client Discoverer, cfg *rest.Config) (PlatformInfo, error)

func (K8SBasedPlatformVersioner) LookupOpenShiftVersion

func (pv K8SBasedPlatformVersioner) LookupOpenShiftVersion(client Discoverer, cfg *rest.Config) (OpenShiftVersion, error)

OCP4.1+ requires elevated cluster configuration user security permissions for version fetch REST call URL requiring permissions: /apis/config.openshift.io/v1/clusterversions

type OpenShiftVersion

type OpenShiftVersion struct {
	Version string `json:"ocpVersion"`
}

func MapKnownVersion added in v1.4.3

func MapKnownVersion(info PlatformInfo) OpenShiftVersion

MapKnownVersion maps from K8S version of PlatformInfo to equivalent OpenShift version

Result: OpenShiftVersion{ Version: 4.1.2 }

func (OpenShiftVersion) BuildVersion

func (info OpenShiftVersion) BuildVersion() string

func (OpenShiftVersion) Compare added in v1.4.3

func (v OpenShiftVersion) Compare(o OpenShiftVersion) (int, error)

func (OpenShiftVersion) MajorVersion

func (info OpenShiftVersion) MajorVersion() string

func (OpenShiftVersion) MinorVersion

func (info OpenShiftVersion) MinorVersion() string

func (OpenShiftVersion) String

func (info OpenShiftVersion) String() string

type PlatformClusterInfo

type PlatformClusterInfo struct {
	Status struct {
		Desired struct {
			Version string `json:"version"`
		} `json:"desired"`
	} `json:"status"`
}

full generated 'version' API fetch result struct @ gist.github.com/jeremyary/5a66530611572a057df7a98f3d2902d5

type PlatformInfo

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

func (PlatformInfo) IsKubernetes

func (info PlatformInfo) IsKubernetes() bool

func (PlatformInfo) IsOpenShift

func (info PlatformInfo) IsOpenShift() bool

func (PlatformInfo) K8SMajorVersion

func (info PlatformInfo) K8SMajorVersion() string

func (PlatformInfo) K8SMinorVersion

func (info PlatformInfo) K8SMinorVersion() string

func (PlatformInfo) String

func (info PlatformInfo) String() string

type PlatformType

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

type PlatformVersioner

type PlatformVersioner interface {
	GetPlatformInfo(discoverer Discoverer, cfg *rest.Config) (PlatformInfo, error)
}

Jump to

Keyboard shortcuts

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