data

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: MIT Imports: 13 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUpdateData

func AddUpdateData(c *models.Cluster, v AvailableComponentVersion) error

AddUpdateData adds UpdateAvailable field data to cluster components Any cluster object modifications are made "in-place"

func GetAvailableVersions

func GetAvailableVersions(a AvailableVersions, cluster models.Cluster) ([]models.ComponentVersion, error)

GetAvailableVersions gets available component version data from the cache. If there was a cache miss, gets the versions from the k8s and versions APIs

func GetCluster

GetCluster collects all cluster metadata and returns a Cluster

func GetDoctorInfo

GetDoctorInfo collects doctor info and return DoctorInfo struct

func GetID

func GetID(id ClusterID) (string, error)

GetID gets the cluster ID from the cache. on a cache miss, uses the k8s API to get it

func GetInstalled

func GetInstalled(g InstalledData) (models.Cluster, error)

GetInstalled collects all installed components and returns a Cluster

func GetLatestVersion

func GetLatestVersion(
	component string,
	cluster models.Cluster,
	availVsns AvailableVersions,
) (models.Version, error)

GetLatestVersion returns the latest known version of a deis component

func NewestSemVer

func NewestSemVer(v1 string, v2 string) (string, error)

NewestSemVer returns the newest (largest) semver string

func ParseJSONCluster

func ParseJSONCluster(rawJSON []byte) (models.Cluster, error)

ParseJSONCluster converts a JSON representation of a cluster to a Cluster type

Types

type AvailableComponentVersion

type AvailableComponentVersion interface {
	// will have a Get method to retrieve available component version data
	Get(component string, cluster models.Cluster) (models.Version, error)
}

AvailableComponentVersion is an interface for managing component version data

func NewLatestReleasedComponent

func NewLatestReleasedComponent(
	ri *k8s.ResourceInterfaceNamespaced,
	availableVersions AvailableVersions,
) AvailableComponentVersion

NewLatestReleasedComponent creates a new AvailableComponentVersion that gets the latest released component using sgc as the implementation to get and create secrets

type AvailableVersions

type AvailableVersions interface {
	// Cached returns the internal cache of component versions. Returns the empty slice on a miss
	Cached() []models.ComponentVersion
	// Refresh gets the latest versions of each component listed in the given cluster
	Refresh(models.Cluster) ([]models.ComponentVersion, error)
	// Store stores the given slice of models.ComponentVersion in internal storage
	Store([]models.ComponentVersion)
}

AvailableVersions is an interface for managing available component version data

func NewAvailableVersionsFromAPI

func NewAvailableVersionsFromAPI(
	apiClient *apiclient.WorkflowManager,
	baseVersionsURL string,
) AvailableVersions

NewAvailableVersionsFromAPI returns a new AvailableVersions implementation that fetches its version information from a workflow manager API. It uses baseVersionsURL as the server address. If that parameter is passed as the empty string, uses config.Spec.VersionsAPIURL

type ClusterID

type ClusterID interface {
	// will have a Get method to retrieve the cluster ID
	Get() (string, error)
	// Cached returns the internal cache of the cluster ID. returns the empty string on a miss
	Cached() string
	// StoreInCache stores the given string in the internal cluster ID cache
	StoreInCache(string)
}

ClusterID is an interface for managing cluster ID data

func NewClusterIDFromPersistentStorage

func NewClusterIDFromPersistentStorage(sgc k8s.KubeSecretGetterCreator) ClusterID

NewClusterIDFromPersistentStorage returns a new ClusterID implementation that uses the kubernetes API to get its cluster information

type ComponentVersionsJSONWrapper

type ComponentVersionsJSONWrapper struct {
	Data []models.ComponentVersion `json:"data"`
}

ComponentVersionsJSONWrapper is the JSON compatible struct that holds a slice of types.ComponentVersion structs

type InstalledData

type InstalledData interface {
	// will have a Get method to retrieve installed data
	Get() ([]byte, error)
}

InstalledData is an interface for managing installed cluster metadata

func NewInstalledDeisData

func NewInstalledDeisData(ri *k8s.ResourceInterfaceNamespaced) InstalledData

NewInstalledDeisData returns a new InstalledDeisData using rcl as the rc.Lister implementation

type SparseComponentAndTrainInfo

type SparseComponentAndTrainInfo struct {
	Component SparseComponentInfo `json:"component"`
	Version   SparseVersionInfo   `json:"version"`
}

SparseComponentAndTrainInfo is the JSON compatible struct that holds a SparseComponentInfo and SparseVersionInfo

type SparseComponentAndTrainInfoJSONWrapper

type SparseComponentAndTrainInfoJSONWrapper struct {
	Data []SparseComponentAndTrainInfo `json:"data"`
}

SparseComponentAndTrainInfoJSONWrapper is the JSON compatible struct that holds a slice of SparseComponentAndTrainInfo structs

type SparseComponentInfo

type SparseComponentInfo struct {
	Name string `json:"name"`
}

SparseComponentInfo is the JSON compatible struct that holds limited data about a component

type SparseVersionInfo

type SparseVersionInfo struct {
	Train string `json:"train"`
}

SparseVersionInfo is the JSON compatible struct that holds limited data about a component version

Jump to

Keyboard shortcuts

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