cluster

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 15 Imported by: 18

Documentation

Index

Constants

View Source
const CLUSTERID_GROUP = "gardener.cloud"
View Source
const DEFAULT = "default"
View Source
const OPTION_SOURCE = "cluster"
View Source
const SUBOPTION_DISABLE_DEPLOY_CRDS = "disable-deploy-crds"
View Source
const SUBOPTION_ID = "id"

Variables

This section is empty.

Functions

func Canonical

func Canonical(names []string) []string

func MustRegister

func MustRegister(name string, option string, short string)

func NewClusters

func NewClusters(cache SchemeCache) *_Clusters

func Register

func Register(name string, option string, short string) error

func RegisterExtension

func RegisterExtension(e Extension)

Types

type Clusters

type Clusters interface {
	Names() utils.StringSet
	GetCluster(name string) Interface
	GetById(id string) Interface
	GetClusters(name ...string) (Clusters, error)

	EffectiveNames() utils.StringSet
	GetEffective(name string) Interface
	GetAliases(name string) utils.StringSet

	GetObject(key resources.ClusterObjectKey) (resources.Object, error)
	GetCachedObject(key resources.ClusterObjectKey) (resources.Object, error)

	Ids() utils.StringSet

	String() string

	WithScheme(scheme *runtime.Scheme) (Clusters, error)
	Cache() SchemeCache
}

func CreateClustersFromDefaults

func CreateClustersFromDefaults(ctx context.Context, logger logger.LogContext, cfg *areacfg.Config, names utils.StringSet) (Clusters, error)

type Config added in v0.2.0

type Config struct {
	Definition
	KubeConfig string
	ClusterId  string
	OmitCRDs   bool

	config.OptionSet
}

func NewConfig added in v0.2.0

func NewConfig(def Definition) *Config

func (*Config) AddOptionsToSet added in v0.2.0

func (this *Config) AddOptionsToSet(set config.OptionSet)

type Configuration

type Configuration struct {
	// contains filtered or unexported fields
}

func Configure

func Configure(name string, option string, short string) Configuration

func (Configuration) Definition

func (this Configuration) Definition() Definition

func (Configuration) Fallback

func (this Configuration) Fallback(name string) Configuration

func (Configuration) MustRegister

func (this Configuration) MustRegister() Configuration

func (Configuration) MustRegisterAt

func (this Configuration) MustRegisterAt(registry Registry) Configuration

func (Configuration) Register

func (this Configuration) Register() error

func (Configuration) RegisterAt

func (this Configuration) RegisterAt(registry Registry) error

func (Configuration) Scheme added in v0.2.0

func (this Configuration) Scheme(scheme *runtime.Scheme) Configuration

type Definition

type Definition interface {
	Name() string
	Description() string
	ConfigOptionName() string
	Fallback() string
	Scheme() *runtime.Scheme

	Definition() Definition
	Configure() Configuration
}

type Definitions

type Definitions interface {
	Get(name string) Definition
	CreateClusters(ctx context.Context, logger logger.LogContext, cfg *areacfg.Config, cache SchemeCache, names utils.StringSet) (Clusters, error)
	ExtendConfig(cfg *areacfg.Config)
	GetScheme() *runtime.Scheme
}

func DefaultDefinitions

func DefaultDefinitions() Definitions

type Extension

type Extension interface {
	ExtendConfig(def Definition, cfg *Config)
	Extend(cluster Interface, config *Config) error
}

type Interface

type Interface interface {
	GetName() string
	GetId() string
	GetServerVersion() *semver.Version
	GetAttr(key interface{}) interface{}
	SetAttr(key, value interface{})
	GetObject(interface{}) (resources.Object, error)
	GetObjectInto(resources.ObjectName, resources.ObjectData) (resources.Object, error)
	GetCachedObject(interface{}) (resources.Object, error)
	GetResource(groupKind schema.GroupKind) (resources.Interface, error)
	Config() restclient.Config
	Resources() resources.Resources
	ResourceContext() resources.ResourceContext
	Definition() Definition

	WithScheme(scheme *runtime.Scheme) (Interface, error)
	resources.ClusterSource
}

func CreateCluster

func CreateCluster(ctx context.Context, logger logger.LogContext, def Definition, id string, kubeconfig string) (Interface, error)

func CreateClusterForScheme added in v0.2.0

func CreateClusterForScheme(ctx context.Context, logger logger.LogContext, def Definition, id string, kubeconfig *restclient.Config, scheme *runtime.Scheme) (Interface, error)

type Registerable

type Registerable interface {
	Definition() Definition
}

type RegistrationInterface

type RegistrationInterface interface {
	RegisterCluster(Registerable) error
	MustRegisterCluster(Registerable) RegistrationInterface
}

type Registrations

type Registrations map[string]Definition

type Registry

type Registry interface {
	RegistrationInterface
	GetDefinitions() Definitions
}

func DefaultRegistry

func DefaultRegistry() Registry

func NewRegistry

func NewRegistry(scheme *runtime.Scheme) Registry

type SchemeCache added in v0.2.0

type SchemeCache interface {
	Cleanup(id string)
	Add(c Interface)
	Get(s *runtime.Scheme, id string) Interface
	WithScheme(c Interface, s *runtime.Scheme) (Interface, error)
}

func NewSchemeCache added in v0.2.0

func NewSchemeCache() SchemeCache

Jump to

Keyboard shortcuts

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