orchestration

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 8

Documentation

Index

Constants

View Source
const (
	K8S_VER = iota
	OC_VER_V3
	OC_VER_V4
)

Variables

View Source
var ErrMethodNotSupported = errors.New("Method not supported")
View Source
var ErrResourceNotSupported = errors.New("Method on resource not supported")
View Source
var ErrUnknownResource = errors.New("Unknown resource")

Functions

func GetK8sVersion

func GetK8sVersion(reGetK8sVersion, reGetOcVersion bool) (string, string)

Types

type Driver

type Driver interface {
	GetVersion(reGetK8sVersion, reGetOcVersion bool) (string, string)
	SetIPAddrScope(ports map[string][]share.CLUSIPAddr, meta *container.ContainerMeta, nets map[string]*container.Network)
	GetServiceFromPodLabels(namespace, pod, node string, labels map[string]string) *Service
	GetService(meta *container.ContainerMeta, node string) *Service
	GetPlatformRole(meta *container.ContainerMeta) (string, bool) // return platform type and if container should be secured
	GetDomain(labels map[string]string) string
	GetServiceSubnet(envs []string) *net.IPNet
	GetHostTunnelIP(links map[string]sk.NetIface) []net.IPNet
	IgnoreConnectFromManagedHost() bool
	ConsiderHostsAsInternal() bool
	ApplyPolicyAtIngress() bool
	SupportKubeCISBench() bool
	CleanupHostPorts(hostPorts map[string][]share.CLUSIPAddr) error
	SetFlavor(flavor string) error // for Openshift & Rancher
}

func GetDriver

func GetDriver(platform, flavor, network string, ver1, ver2 string,
	sys *system.SystemTools, rt container.Runtime,
) Driver

type ResourceDriver

type ResourceDriver interface {
	GetOEMVersion() (string, error)
	Login(username, password string) (string, string, error)
	Logout(username, token string) error
	GetAuthServerAlias() string
	GetUserRoles(username string, subjType uint8) (map[string]string, map[string]share.NvFedPermissions, error)
	ListUsers() []UserRBAC
	RegisterResource(rt string) error
	ListResource(rt, namespace string) ([]interface{}, error)
	StartWatchResource(rt, ns string, wcb WatchCallback, scb StateCallback) error
	StopWatchResource(rt string) error
	StopWatchAllResources() error
	GetResource(rt, namespace, name string) (interface{}, error)
	AddResource(rt string, res interface{}) error
	UpdateResource(rt string, res interface{}) error
	DeleteResource(rt string, res interface{}) error
	SetFlavor(flavor string) error                        // for Openshift & Rancher
	GetPlatformUserGroups(token string) ([]string, error) // for OpenShift
}

type Service

type Service struct {
	Name   string
	Domain string
}

type StateCallback

type StateCallback func(state string, err error)

type UserRBAC

type UserRBAC struct {
	Name   string
	Domain string
	RBAC   map[string]string                 // domain -> nv role
	RBAC2  map[string]share.NvFedPermissions // domain -> nv permissions
}

type WatchCallback

type WatchCallback func(rt string, event string, object interface{}, old interface{})

Jump to

Keyboard shortcuts

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