pool

package
v0.0.0-...-47649f3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 22 Imported by: 8

Documentation

Index

Constants

View Source
const (
	ConstraintTypeTeam       = poolConstraintType("team")
	ConstraintTypeRouter     = poolConstraintType("router")
	ConstraintTypeService    = poolConstraintType("service")
	ConstraintTypePlan       = poolConstraintType("plan")
	ConstraintTypeVolumePlan = poolConstraintType("volume-plan")
)

Variables

View Source
var (
	ErrPublicDefaultPoolCantHaveTeams = errors.New("Public/Default pool can't have teams.")
	ErrDefaultPoolAlreadyExists       = errors.New("Default pool already exists.")
	ErrPoolNameIsRequired             = errors.New("Pool name is required.")
	ErrPoolNotFound                   = errors.New("Pool does not exist.")
	ErrPoolAlreadyExists              = errors.New("Pool already exists.")
	ErrPoolHasNoTeam                  = errors.New("no team found for pool")
	ErrPoolHasNoRouter                = errors.New("no router found for pool")
	ErrPoolHasNoService               = errors.New("no service found for pool")
	ErrPoolHasNoPlan                  = errors.New("no plan found for pool")
	ErrPoolHasNoVolumePlan            = errors.New("no volume-plan found for pool")
)
View Source
var (
	ErrInvalidConstraintType = errors.Errorf("invalid constraint type. Valid types are: %s", validConstraintTypes)
)

Functions

func AddPool

func AddPool(ctx context.Context, opts AddPoolOptions) error

func AddTeamsToPool

func AddTeamsToPool(poolName string, teams []string) error

func AppendPoolConstraint

func AppendPoolConstraint(c *PoolConstraint) error

func GetProvisionerForPool

func GetProvisionerForPool(ctx context.Context, name string) (provision.Provisioner, error)

func MigratePoolTeamsToPoolConstraints

func MigratePoolTeamsToPoolConstraints() error

func PoolService

func PoolService() (provisionTypes.PoolService, error)

func PoolStorage

func PoolStorage() (provisionTypes.PoolStorage, error)

func PoolUpdate

func PoolUpdate(ctx context.Context, name string, opts UpdatePoolOptions) error

func RemovePool

func RemovePool(poolName string) error

func RemoveTeamsFromPool

func RemoveTeamsFromPool(poolName string, teams []string) error

func RenamePoolTeam

func RenamePoolTeam(ctx context.Context, oldName, newName string) error

func ResetCache

func ResetCache()

func SetPoolConstraint

func SetPoolConstraint(c *PoolConstraint) error

func ToConstraintType

func ToConstraintType(value string) (poolConstraintType, error)

func ValidatePoolService

func ValidatePoolService(ctx context.Context, pool string, services []string) error

Types

type AddPoolOptions

type AddPoolOptions struct {
	Name        string
	Public      bool
	Default     bool
	Force       bool
	Provisioner string

	Labels map[string]string
}

type Pool

type Pool struct {
	Name        string `bson:"_id"`
	Default     bool
	Provisioner string

	Labels map[string]string
	// contains filtered or unexported fields
}

func GetDefaultPool

func GetDefaultPool(ctx context.Context) (*Pool, error)

func GetPoolByName

func GetPoolByName(ctx context.Context, name string) (*Pool, error)

GetPoolByName finds a pool by name

func ListAllPools

func ListAllPools(ctx context.Context) ([]Pool, error)

func ListPools

func ListPools(ctx context.Context, names ...string) ([]Pool, error)

func ListPoolsForTeam

func ListPoolsForTeam(ctx context.Context, team string) ([]Pool, error)

func ListPossiblePools

func ListPossiblePools(ctx context.Context, teams []string) ([]Pool, error)

func ListPublicPools

func ListPublicPools(ctx context.Context) ([]Pool, error)

func (*Pool) GetAffinity

func (p *Pool) GetAffinity() (*apiv1.Affinity, error)

func (*Pool) GetDefaultPlan

func (p *Pool) GetDefaultPlan() (*appTypes.Plan, error)

func (*Pool) GetDefaultRouter

func (p *Pool) GetDefaultRouter() (string, error)

func (*Pool) GetPlans

func (p *Pool) GetPlans() ([]string, error)

func (*Pool) GetProvisioner

func (p *Pool) GetProvisioner() (provision.Provisioner, error)

func (*Pool) GetRouters

func (p *Pool) GetRouters() ([]string, error)

func (*Pool) GetTeams

func (p *Pool) GetTeams() ([]string, error)

func (*Pool) GetVolumePlans

func (p *Pool) GetVolumePlans() ([]string, error)

func (*Pool) MarshalJSON

func (p *Pool) MarshalJSON() ([]byte, error)

func (*Pool) ValidateRouters

func (p *Pool) ValidateRouters(routers []appTypes.AppRouter) error

type PoolConstraint

type PoolConstraint struct {
	PoolExpr  string
	Field     poolConstraintType
	Values    []string
	Blacklist bool
}

func ListPoolsConstraints

func ListPoolsConstraints(query bson.M) ([]*PoolConstraint, error)

func (*PoolConstraint) AllowsAll

func (c *PoolConstraint) AllowsAll() bool

type UpdatePoolOptions

type UpdatePoolOptions struct {
	Default *bool
	Public  *bool
	Force   bool

	Labels map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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