data

package
v2.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUpdateData

func AddUpdateData(c *types.Cluster, v AvailableComponentVersion, secretGetterCreator KubeSecretGetterCreator) error

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

func GetAvailableVersions

func GetAvailableVersions(a AvailableVersions, cluster types.Cluster) ([]types.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

func GetCluster(
	c InstalledData,
	i ClusterID,
	v AvailableComponentVersion,
	secretGetterCreator KubeSecretGetterCreator,
) (types.Cluster, error)

GetCluster collects all cluster metadata and returns a Cluster

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) (types.Cluster, error)

GetInstalled collects all installed components and returns a Cluster

func GetLatestVersion

func GetLatestVersion(
	component string,
	secretGetterCreator KubeSecretGetterCreator,
	rcLister rc.Lister,
	cluster types.Cluster,
	availVsns AvailableVersions,
) (types.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) (types.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 types.Cluster) (types.Version, error)
}

AvailableComponentVersion is an interface for managing component version data

func NewLatestReleasedComponent

func NewLatestReleasedComponent(
	sgc KubeSecretGetterCreator,
	rcl rc.Lister,
	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() []types.ComponentVersion
	// Refresh gets the latest versions of each component listed in the given cluster
	Refresh(types.Cluster) ([]types.ComponentVersion, error)
	// Store stores the given slice of types.ComponentVersion in internal storage
	Store([]types.ComponentVersion)
}

AvailableVersions is an interface for managing available component version data

func NewAvailableVersionsFromAPI

func NewAvailableVersionsFromAPI(
	restCl rest.Client,
	baseVersionsURL string,
	secretGetterCreator KubeSecretGetterCreator,
	rcLister rc.Lister,
) 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 KubeSecretGetterCreator) ClusterID

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

type ComponentVersionsJSONWrapper

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

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

type FakeKubeSecretGetterCreator

type FakeKubeSecretGetterCreator struct {
	*secret.FakeGetter
	*secret.FakeCreator
}

FakeKubeSecretGetterCreator is a composition of the secret.FakeGetter and secret.FakeCreator structs

func NewFakeKubeSecretGetterCreator

func NewFakeKubeSecretGetterCreator(fakeGetter *secret.FakeGetter, fakeCreator *secret.FakeCreator) *FakeKubeSecretGetterCreator

NewFakeKubeSecretGetterCreator creates a new FakeKubeSecretGetterCreator from the given fakeGetter and fakeCreator

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(rcl rc.Lister) InstalledData

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

type KubeSecretGetterCreator

type KubeSecretGetterCreator interface {
	secret.Getter
	secret.Creator
}

KubeSecretGetterCreator is a composition of secret.Getter and secret.Creator. Please refer to the Godoc for those two interfaces (https://godoc.org/github.com/arschles/kubeapp/api/secret)

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