Documentation
¶
Overview ¶
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * RUC: Read Update Commit * ======================= * * This file contains code for safely updating complex etcd stor objects * concurrently. The basic pattern is that each function takes * * - an object to be updates * - a function that updates the object * * the RUC routine then does the following * * - try to perform a versioned update on the object * - if the update fails, try up to 10 times * - returns the result of the transactional update *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index ¶
- Constants
- Variables
- func AllResourceIds(net *xir.Net) []string
- func CancelTask(prefix string) error
- func CheckForTasks(etcd *clientv3.Client, doTask func(*Task) error) error
- func Cmdr(cfg common.Config, f func(cm.CommanderClient) error) error
- func CogletId() string
- func CommanderClient(cfg common.Config) (*grpc.ClientConn, cm.CommanderClient, error)
- func ContainerdClient() (*containerd.Client, error)
- func CreateContainer(ctr *ContainerSpec) error
- func CreateContainerRecord(spec *ContainerSpec) error
- func CreateContainerTask(ctr *ContainerSpec) error
- func CreateIfx(netns string, ifx *EnclaveVeth, save bool) error
- func CreateInfrapodNS(name string) error
- func CreateLinks(mzid, instance string, fragments []*site.MzFragment) error
- func CreateTask(ctx context.Context, ctr containerd.Container, ns, name string) error
- func DelEnclaveBridge(spec *EnclaveSpec, ctx *rtnl.Context) error
- func DelEnclaveIptables(mzid string, spec *EnclaveSpec) error
- func Delete(obj Object) error
- func DeleteContainer(name, namespace string) error
- func DeleteContainerIfx(namespace, name string) error
- func DeleteContainerImg(name, namespace string) error
- func DeleteContainerNs(name string) error
- func DeleteContainerRecord(name, namespace string, a *Action) error
- func DeleteContainerTask(name, namespace string) error
- func DeleteIfx(netns string, ifx *EnclaveVeth) error
- func DeleteInfrapodNS(name string) error
- func DeleteObjects(objs []Object) error
- func DeleteTask(ctx context.Context, container containerd.Container) error
- func DestroyLinks(mzid, instance string, fragments []*site.MzFragment) error
- func DestroyNetNS(netns *NetNS) error
- func EnclaveBridge(spec *EnclaveSpec, ctx *rtnl.Context) error
- func EnclaveIptables(mzid string, spec *EnclaveSpec) error
- func EnsureEtcd(etcdp **clientv3.Client) error
- func EtcdConnect() (*clientv3.Client, error)
- func EvpnAdvertiseMac(mac string, vni, vindex int) error
- func EvpnAdvertiseMulticast(vni, vindex int) error
- func EvpnWithdrawMac(mac string, vni, vindex int) error
- func EvpnWithdrawMulticast(vni, vindex int) error
- func Exec(etcdp **clientv3.Client, cog string, doTask func(*Task) error) error
- func ExtractConstraint(props map[string]interface{}, key string) *xir.Constraint
- func FromJson(o Object, b []byte)
- func GetInfraEndpoint(n *xir.Node) *xir.Endpoint
- func GetIntLike(x interface{}) (int, error)
- func GetNativeNlri(p *api.Path) (bgp.AddrPrefixInterface, error)
- func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error)
- func GetNodeLeaf(nodeEndpoint *xir.Endpoint) *xir.Endpoint
- func HandleIncoming(rq *cm.IncomingRequest) error
- func HandleLinkCreate(rq *cm.MzRequest) error
- func HandleLinkDestroy(rq *cm.MzRequest) error
- func HandleNodeRecycle(rq *cm.MzRequest) error
- func HandleNodeSetup(rq *cm.MzRequest) error
- func HandleStatus(rq *cm.StatusRequest) (*cm.StatusResponse, error)
- func HandleTask(etcd *etcd.Client, task *Task, lease etcd.LeaseID, doTask func(*Task) error)
- func Init()
- func InitInfranet(mzinfo *MzInfo, props map[string]interface{}) error
- func IsTxnFailed(err error) bool
- func KeepLeaseAlive(etcd *clientv3.Client, lease clientv3.LeaseID) (chan bool, error)
- func LaunchTask(task *Task) error
- func LeaseTask(c *etcd.Client, t *Task) (etcd.LeaseID, error)
- func ListContainers(ctx context.Context) ([]containerd.Container, error)
- func ListNamespaces() ([]string, error)
- func LoadXIR() (*xir.Net, error)
- func MarshalFlowSpecRules(values []bgp.FlowSpecComponentInterface) []*any.Any
- func MarshalNLRI(value bgp.AddrPrefixInterface) *any.Any
- func MarshalNLRIs(values []bgp.AddrPrefixInterface) []*any.Any
- func MarshalPathAttributes(attrList []bgp.PathAttributeInterface) []*any.Any
- func MarshalRD(rd bgp.RouteDistinguisherInterface) *any.Any
- func MarshalRT(rt bgp.ExtendedCommunityInterface) *any.Any
- func MarshalRTs(values []bgp.ExtendedCommunityInterface) []*any.Any
- func Merge2Local(devId string) (string, error)
- func NewAggregatorAttributeFromNative(a *bgp.PathAttributeAggregator) *api.AggregatorAttribute
- func NewAigpAttributeFromNative(a *bgp.PathAttributeAigp) *api.AigpAttribute
- func NewAs4AggregatorAttributeFromNative(a *bgp.PathAttributeAs4Aggregator) *api.As4AggregatorAttribute
- func NewAs4PathAttributeFromNative(a *bgp.PathAttributeAs4Path) *api.As4PathAttribute
- func NewAsPathAttributeFromNative(a *bgp.PathAttributeAsPath) *api.AsPathAttribute
- func NewAtomicAggregateAttributeFromNative(a *bgp.PathAttributeAtomicAggregate) *api.AtomicAggregateAttribute
- func NewClusterListAttributeFromNative(a *bgp.PathAttributeClusterList) *api.ClusterListAttribute
- func NewCommunitiesAttributeFromNative(a *bgp.PathAttributeCommunities) *api.CommunitiesAttribute
- func NewEthernetSegmentIdentifierFromNative(a *bgp.EthernetSegmentIdentifier) *api.EthernetSegmentIdentifier
- func NewExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeExtendedCommunities) *api.ExtendedCommunitiesAttribute
- func NewIP6ExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeIP6ExtendedCommunities) *api.IP6ExtendedCommunitiesAttribute
- func NewLargeCommunitiesAttributeFromNative(a *bgp.PathAttributeLargeCommunities) *api.LargeCommunitiesAttribute
- func NewLocalPrefAttributeFromNative(a *bgp.PathAttributeLocalPref) *api.LocalPrefAttribute
- func NewMpReachNLRIAttributeFromNative(a *bgp.PathAttributeMpReachNLRI) *api.MpReachNLRIAttribute
- func NewMpUnreachNLRIAttributeFromNative(a *bgp.PathAttributeMpUnreachNLRI) *api.MpUnreachNLRIAttribute
- func NewMultiExitDiscAttributeFromNative(a *bgp.PathAttributeMultiExitDisc) *api.MultiExitDiscAttribute
- func NewNextHopAttributeFromNative(a *bgp.PathAttributeNextHop) *api.NextHopAttribute
- func NewOriginAttributeFromNative(a *bgp.PathAttributeOrigin) *api.OriginAttribute
- func NewOriginatorIdAttributeFromNative(a *bgp.PathAttributeOriginatorId) *api.OriginatorIdAttribute
- func NewPath(nlri bgp.AddrPrefixInterface, isWithdraw bool, ...) *api.Path
- func NewPmsiTunnelAttributeFromNative(a *bgp.PathAttributePmsiTunnel) *api.PmsiTunnelAttribute
- func NewTunnelEncapAttributeFromNative(a *bgp.PathAttributeTunnelEncap) *api.TunnelEncapAttribute
- func NewUnknownAttributeFromNative(a *bgp.PathAttributeUnknown) *api.UnknownAttribute
- func NodeOps(kind, mzid, instance string, status NodeStatus, fragments []*site.MzFragment) error
- func NodeRecycle(mzid, instance string, fragments []*site.MzFragment) error
- func NodeSetup(mzid, instance string, fragments []*site.MzFragment) error
- func NsDefaultRoute(mzid string, spec *EnclaveSpec) error
- func PullContainerImage(namespace, image string) error
- func RUC(o Object, update func(o Object)) error
- func Read(obj Object) error
- func ReadNew(obj Object) error
- func ReadObjects(objs []Object) (error, int)
- func ReadWait(obj Object, timer *ReadTimer) error
- func RegisterCoglet(c *etcd.Client, cog string) (error, etcd.LeaseID)
- func RegisterWithCommander()
- func RevokeLease(etcd *clientv3.Client, lease clientv3.LeaseID)
- func RunObjectTx(otx ObjectTx) error
- func SetupContainerLo(namespace string) error
- func SvcAddress(vindex int) string
- func SvcCidr(vindex int) string
- func TeardownInfranet(mzinfo *MzInfo, props map[string]interface{}) error
- func ToApiFamily(afi uint16, safi uint8) *api.Family
- func ToJson(o Object) string
- func ToRouteFamily(f *api.Family) bgp.RouteFamily
- func TxnFailed(message string) error
- func UnmarshalAttribute(an *any.Any) (bgp.PathAttributeInterface, error)
- func UnmarshalFlowSpecRules(values []*any.Any) ([]bgp.FlowSpecComponentInterface, error)
- func UnmarshalNLRI(rf bgp.RouteFamily, an *any.Any) (bgp.AddrPrefixInterface, error)
- func UnmarshalNLRIs(rf bgp.RouteFamily, values []*any.Any) ([]bgp.AddrPrefixInterface, error)
- func UnmarshalPathAttributes(values []*any.Any) ([]bgp.PathAttributeInterface, error)
- func UnmarshalRD(a *any.Any) (bgp.RouteDistinguisherInterface, error)
- func UnmarshalRT(a *any.Any) (bgp.ExtendedCommunityInterface, error)
- func UnmarshalRTs(values []*any.Any) ([]bgp.ExtendedCommunityInterface, error)
- func WithCogCNI(netns string) oci.SpecOpts
- func WithCtrMounts(mounts []*ContainerMount) oci.SpecOpts
- func WithEtcd(f func(*clientv3.Client) error) error
- func Write(obj Object, opts ...etcd.OpOption) error
- func WriteObjects(objs []Object, fresh bool, opts ...etcd.OpOption) error
- type Action
- type BelugaSpec
- type CogletInfo
- type Container
- type ContainerImageData
- type ContainerMount
- type ContainerSpec
- type CountSet
- type CtrComponent
- type DeleteContainerData
- type DeleteContainerIfxData
- type DeleteContainerNsData
- type Destination
- type EnclaveSpec
- type EnclaveVeth
- type Endpoint
- type EvpnInfo
- type EvpnWithdrawData
- type FoundrySetSpec
- type ImageBinding
- type ImageDefaults
- type ImageSpec
- type LinkInfo
- type LinkKind
- type LinkSpec
- type MacAdvSpec
- type MzInfo
- type MzOperation
- type MzStatus
- type MzfIndex
- type NetNS
- type NexMemberSpec
- type NexNetworkSpec
- type NimbusConfig
- type NimbusUser
- type NodeInfo
- type NodeInfraInfo
- type NodeSpec
- type NodeState
- type NodeStatus
- type NsnatSpec
- type Object
- type ObjectTx
- type OtterSpec
- type Path
- type PortMode
- type PortObj
- type RallyStore
- type ReadTimer
- type Stage
- type TargetNetwork
- type Task
- func (t *Task) AddDep(id string)
- func (t *Task) AddStage(s *Stage) *Stage
- func (t *Task) ClearErrors()
- func (t *Task) Complete() bool
- func (t *Task) DepsSatisfied() bool
- func (t *Task) Failed() []*Action
- func (t *Task) GetVersion() int64
- func (t *Task) Init()
- func (t *Task) InsertStage(after *Stage, new *Stage) *Stage
- func (t *Task) Key() string
- func (t *Task) MaskAction(stage, action int)
- func (t *Task) Mzid() string
- func (t *Task) Reset()
- func (t *Task) SetVersion(v int64)
- func (t *Task) Value() interface{}
- func (t *Task) Wait() error
- type VLMap
- type VLMentry
- type VLinkEdge
- type Vtep
- type VtepObj
- type VtepSpec
- type VxLan
Constants ¶
const ( HarborNet = "harbor.dcomptb.net" HarborSvcAddr = "172.31.0.2" //XXX hardcode HarborVindex = 2 HarborInfraVNI = 2 HarborInfraVID = 2 HarborXpVNI = 2 )
const ( ContainerKind = "container" LaunchCtr = "launch" PullCtrImage = "pull-image" CreateCtr = "create" CreateCtrTask = "create-task" CreateCtrNs = "create-ns" ConfigCtrLo = "config-lo" CreateCtrRecord = "create-record" DeleteCtr = "delete" DeleteCtrTask = "delete-task" DeleteCtrImg = "delete-img" DeleteCtrRecord = "delete-record" DeleteCtrNS = "delete-ctr-ns" NodeSetupKind = "NodeSetup" NodeRecycleKind = "NodeRecycle" PlumbingKind = "plumbing" CreateEnclave = "create-enclave" DestroyEnclave = "destroy-enclave" AdvertiseMac = "advertise-mac" DeleteNS = "delete-ns" NexKind = "Nex" CreateNexNetwork = "CreateNetwork" DeleteNexNetwork = "DeleteNetwork" DeleteNexMembers = "DeleteMembers" AddNexMembers = "AddMembers" CanopyKind = "Canopy" SetCanopyLinks = "SetLinks" SetCanopyServiceVtep = "SetServiceVtep" RemoveCanopyServiceVtep = "RemoveServiceVtep" RemoveCanopyLinks = "RemoveLinks" BookkeepingKind = "bookkeeping" DeleteMzinfo = "DeleteMzinfo" SetStatus = "UpdateStatus" OtterKind = "Otter" SetOtter = "Set" NimbusKind = "Nimbus" DeleteNimbusConfig = "Delete" CreateNimbusConfig = "Create" RallyKind = "Rally" RecycleRally = "Recycle" EnsureRally = "Ensure" )
const ( //assumes rex configures the machine he's running on InfraCanopyHost = "localhost" Svcbr = "svcbr" )
const ( FoundryNamespace = "foundry" FoundryImage = "docker.io/mergetb/foundry:latest" FoundryCertMountName = "foundry-cert" FoundryCertMountSource = "/etc/foundry/manage.pem" FoundryCertMountDest = "/etc/foundry/manage.pem" FoundryKeyMountName = "foundry-key" FoundryKeyMountSource = "/etc/foundry/manage-key.pem" FoundryKeyMountDest = "/etc/foundry/manage-key.pem" FoundryEnv = "FOUNDRYD_ARGS" FoundryArgs = "-no-auth" )
const ( EtcdNamespace = "etcd" EtcdImage = "docker.io/mergetb/etcd:latest" )
const ( NexNamespace = "nex" NexImage = "docker.io/mergetb/nex:v0.4.8" NexMountName = "nex-config" NexMountSource = "/etc/cogs/nex.yml" NexMountDest = "/etc/nex/nex.yml" NexDomainEnv = "DOMAIN" )
const ( InfrapodMznIfx = "ceth0" InfrapodSvcIfx = "ceth1" DefaultInternalGateway = "172.30.0.1" DefaultInternalGatewayCIDR = "172.30.0.1/16" DefaultServiceGateway = "172.31.0.1" HarborVni = 2 HarborVid = 2 MaxSystemVindex = 100 VindexKey = "vindex" InfraVniKey = "ivni" InfraVidKey = "ivid" XpVniKey = "xvni" XpVidKey = "xvid" HarborControlAddr = "172.31.0.2" HarborMzid = "harbor.dcomptb.io" //TODO XXX change to harbor.mergetb.io )
const ( TimeFormat = "2 Jan 06 15:04:05.00 MST" IdAlphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@" )
const (
DefaultMountType = "bind"
)
const (
RetryWait = 1 * time.Second
)
const (
TxnFailedPrefix = "txn failed"
)
const (
XIR_FILE_PATH = "/etc/dcomp/tb-xir.json"
)
Variables ¶
var ( GobgpdPort = flag.Int("gobgpd-port", 50051, "gobgpd listening port") BgpAddr = flag.String("bgp-addr", "10.99.0.254/32", "bgp address") BgpAS = flag.Int("bgp-as", 64799, "bgp autonomus system number") )
user flags
var (
AlreadyWorking error = fmt.Errorf("cog already running")
)
var (
DefaultMountOptions = []string{"rbind", "ro"}
)
var NotFound error = fmt.Errorf("not found")
var Version = "undefined"
Functions ¶
func AllResourceIds ¶
func AllResourceIds(net *xir.Net) []string
func CommanderClient ¶
func CommanderClient(cfg common.Config) ( *grpc.ClientConn, cm.CommanderClient, error)
func ContainerdClient ¶
func ContainerdClient() (*containerd.Client, error)
func CreateContainer ¶
func CreateContainer(ctr *ContainerSpec) error
func CreateContainerRecord ¶
func CreateContainerRecord(spec *ContainerSpec) error
func CreateContainerTask ¶
func CreateContainerTask(ctr *ContainerSpec) error
func CreateInfrapodNS ¶
func CreateLinks ¶
func CreateTask ¶
func DelEnclaveBridge ¶ added in v0.2.19
func DelEnclaveBridge(spec *EnclaveSpec, ctx *rtnl.Context) error
func DelEnclaveIptables ¶ added in v0.2.19
func DelEnclaveIptables(mzid string, spec *EnclaveSpec) error
func DeleteContainer ¶
func DeleteContainerIfx ¶
func DeleteContainerImg ¶
func DeleteContainerNs ¶
func DeleteContainerRecord ¶
func DeleteContainerTask ¶
func DeleteIfx ¶
func DeleteIfx(netns string, ifx *EnclaveVeth) error
func DeleteInfrapodNS ¶
func DeleteObjects ¶
func DeleteTask ¶
func DeleteTask(ctx context.Context, container containerd.Container) error
func DestroyLinks ¶
func DestroyNetNS ¶
func EnclaveBridge ¶ added in v0.2.19
func EnclaveBridge(spec *EnclaveSpec, ctx *rtnl.Context) error
func EnclaveIptables ¶ added in v0.2.19
func EnclaveIptables(mzid string, spec *EnclaveSpec) error
func EnsureEtcd ¶
EnsureEtcd Make sure we always have an etcd connection
func EtcdConnect ¶
EtcdConnect Try to get a etcd client- assumption EtcdClient is async until used
func EvpnAdvertiseMac ¶
func EvpnAdvertiseMulticast ¶
func EvpnWithdrawMac ¶
func EvpnWithdrawMulticast ¶
func Exec ¶
Exec is the primary lower half subroutine. It is designed to be executed in an infinite loop by lower half implementations.
func ExtractConstraint ¶
func GetInfraEndpoint ¶
func GetInfraEndpoint(n *xir.Node) *xir.Endpoint
func GetIntLike ¶
sigh, needed for data that gets cross-serialized, nfc what the number format will be, json it's int64, mapstructure+yaml its int
func GetNativeNlri ¶
func GetNativeNlri(p *api.Path) (bgp.AddrPrefixInterface, error)
func GetNativePathAttributes ¶
func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error)
func GetNodeLeaf ¶
func GetNodeLeaf(nodeEndpoint *xir.Endpoint) *xir.Endpoint
func HandleIncoming ¶
func HandleIncoming(rq *cm.IncomingRequest) error
func HandleLinkCreate ¶
func HandleLinkDestroy ¶
func HandleNodeRecycle ¶
func HandleNodeSetup ¶
func HandleStatus ¶
func HandleStatus(rq *cm.StatusRequest) (*cm.StatusResponse, error)
func HandleTask ¶
func InitInfranet ¶
func IsTxnFailed ¶
func KeepLeaseAlive ¶
func ListContainers ¶
func ListContainers(ctx context.Context) ([]containerd.Container, error)
func ListNamespaces ¶
func MarshalFlowSpecRules ¶
func MarshalFlowSpecRules(values []bgp.FlowSpecComponentInterface) []*any.Any
func MarshalNLRI ¶
func MarshalNLRI(value bgp.AddrPrefixInterface) *any.Any
func MarshalNLRIs ¶
func MarshalNLRIs(values []bgp.AddrPrefixInterface) []*any.Any
func MarshalPathAttributes ¶
func MarshalPathAttributes(attrList []bgp.PathAttributeInterface) []*any.Any
func MarshalRTs ¶
func MarshalRTs(values []bgp.ExtendedCommunityInterface) []*any.Any
func Merge2Local ¶
func NewAggregatorAttributeFromNative ¶
func NewAggregatorAttributeFromNative(a *bgp.PathAttributeAggregator) *api.AggregatorAttribute
func NewAigpAttributeFromNative ¶
func NewAigpAttributeFromNative(a *bgp.PathAttributeAigp) *api.AigpAttribute
func NewAs4AggregatorAttributeFromNative ¶
func NewAs4AggregatorAttributeFromNative(a *bgp.PathAttributeAs4Aggregator) *api.As4AggregatorAttribute
func NewAs4PathAttributeFromNative ¶
func NewAs4PathAttributeFromNative(a *bgp.PathAttributeAs4Path) *api.As4PathAttribute
func NewAsPathAttributeFromNative ¶
func NewAsPathAttributeFromNative(a *bgp.PathAttributeAsPath) *api.AsPathAttribute
func NewAtomicAggregateAttributeFromNative ¶
func NewAtomicAggregateAttributeFromNative(a *bgp.PathAttributeAtomicAggregate) *api.AtomicAggregateAttribute
func NewClusterListAttributeFromNative ¶
func NewClusterListAttributeFromNative(a *bgp.PathAttributeClusterList) *api.ClusterListAttribute
func NewCommunitiesAttributeFromNative ¶
func NewCommunitiesAttributeFromNative(a *bgp.PathAttributeCommunities) *api.CommunitiesAttribute
func NewEthernetSegmentIdentifierFromNative ¶
func NewEthernetSegmentIdentifierFromNative(a *bgp.EthernetSegmentIdentifier) *api.EthernetSegmentIdentifier
func NewExtendedCommunitiesAttributeFromNative ¶
func NewExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeExtendedCommunities) *api.ExtendedCommunitiesAttribute
func NewIP6ExtendedCommunitiesAttributeFromNative ¶
func NewIP6ExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeIP6ExtendedCommunities) *api.IP6ExtendedCommunitiesAttribute
func NewLargeCommunitiesAttributeFromNative ¶
func NewLargeCommunitiesAttributeFromNative(a *bgp.PathAttributeLargeCommunities) *api.LargeCommunitiesAttribute
func NewLocalPrefAttributeFromNative ¶
func NewLocalPrefAttributeFromNative(a *bgp.PathAttributeLocalPref) *api.LocalPrefAttribute
func NewMpReachNLRIAttributeFromNative ¶
func NewMpReachNLRIAttributeFromNative(a *bgp.PathAttributeMpReachNLRI) *api.MpReachNLRIAttribute
func NewMpUnreachNLRIAttributeFromNative ¶
func NewMpUnreachNLRIAttributeFromNative(a *bgp.PathAttributeMpUnreachNLRI) *api.MpUnreachNLRIAttribute
func NewMultiExitDiscAttributeFromNative ¶
func NewMultiExitDiscAttributeFromNative(a *bgp.PathAttributeMultiExitDisc) *api.MultiExitDiscAttribute
func NewNextHopAttributeFromNative ¶
func NewNextHopAttributeFromNative(a *bgp.PathAttributeNextHop) *api.NextHopAttribute
func NewOriginAttributeFromNative ¶
func NewOriginAttributeFromNative(a *bgp.PathAttributeOrigin) *api.OriginAttribute
func NewOriginatorIdAttributeFromNative ¶
func NewOriginatorIdAttributeFromNative(a *bgp.PathAttributeOriginatorId) *api.OriginatorIdAttribute
func NewPath ¶
func NewPath(nlri bgp.AddrPrefixInterface, isWithdraw bool, attrs []bgp.PathAttributeInterface, age time.Time) *api.Path
func NewPmsiTunnelAttributeFromNative ¶
func NewPmsiTunnelAttributeFromNative(a *bgp.PathAttributePmsiTunnel) *api.PmsiTunnelAttribute
func NewTunnelEncapAttributeFromNative ¶
func NewTunnelEncapAttributeFromNative(a *bgp.PathAttributeTunnelEncap) *api.TunnelEncapAttribute
func NewUnknownAttributeFromNative ¶
func NewUnknownAttributeFromNative(a *bgp.PathAttributeUnknown) *api.UnknownAttribute
func NodeOps ¶
func NodeOps( kind, mzid, instance string, status NodeStatus, fragments []*site.MzFragment, ) error
func NodeRecycle ¶
func NsDefaultRoute ¶ added in v0.2.19
func NsDefaultRoute(mzid string, spec *EnclaveSpec) error
func PullContainerImage ¶
func ReadObjects ¶
func ReadWait ¶
ReadWait attempts to read an object repeatedly until a timeout threshold is reached defined by timer. If timer is nil the defaults of 30 seconds with a retry period of 250 milliseconds is applied
func RegisterWithCommander ¶
func RegisterWithCommander()
func RunObjectTx ¶
func SetupContainerLo ¶
func SvcAddress ¶
func TeardownInfranet ¶
func ToRouteFamily ¶
func ToRouteFamily(f *api.Family) bgp.RouteFamily
func UnmarshalAttribute ¶
func UnmarshalAttribute(an *any.Any) (bgp.PathAttributeInterface, error)
func UnmarshalFlowSpecRules ¶
func UnmarshalFlowSpecRules(values []*any.Any) ([]bgp.FlowSpecComponentInterface, error)
func UnmarshalNLRI ¶
func UnmarshalNLRI(rf bgp.RouteFamily, an *any.Any) (bgp.AddrPrefixInterface, error)
func UnmarshalNLRIs ¶
func UnmarshalNLRIs(rf bgp.RouteFamily, values []*any.Any) ([]bgp.AddrPrefixInterface, error)
func UnmarshalPathAttributes ¶
func UnmarshalPathAttributes(values []*any.Any) ([]bgp.PathAttributeInterface, error)
func UnmarshalRD ¶
func UnmarshalRD(a *any.Any) (bgp.RouteDistinguisherInterface, error)
func UnmarshalRT ¶
func UnmarshalRT(a *any.Any) (bgp.ExtendedCommunityInterface, error)
func UnmarshalRTs ¶
func UnmarshalRTs(values []*any.Any) ([]bgp.ExtendedCommunityInterface, error)
func WithCogCNI ¶
func WithCtrMounts ¶
func WithCtrMounts(mounts []*ContainerMount) oci.SpecOpts
Types ¶
type Action ¶
type Action struct {
Kind string
Mzid string
MzOp MzOperation
MzInstance string
Action string
Data interface{}
Complete bool
Error *string
Masked bool
// contains filtered or unexported fields
}
func NexCreateMembers ¶
func NexDeleteMembers ¶
func NexDeleteNetwork ¶
type BelugaSpec ¶
type CogletInfo ¶
type CogletInfo struct {
Id string
Cog string
Host string
Pid int
// contains filtered or unexported fields
}
func ListCoglets ¶
func ListCoglets() ([]*CogletInfo, error)
func (*CogletInfo) GetVersion ¶
func (c *CogletInfo) GetVersion() int64
func (*CogletInfo) SetVersion ¶
func (c *CogletInfo) SetVersion(v int64)
func (*CogletInfo) Value ¶
func (c *CogletInfo) Value() interface{}
type Container ¶
type Container struct {
Name string
//CtrNamespace string
//NetNamespace string
Namespace string
Vindex int
Image string
// contains filtered or unexported fields
}
func (*Container) GetVersion ¶
func (*Container) SetVersion ¶
type ContainerImageData ¶
type ContainerMount ¶
type ContainerMount struct {
Name string
specs.Mount `mapstructure:",squash" yaml:",inline"`
CtrComponent `mapstructure:",squash" yaml:",inline"`
// contains filtered or unexported fields
}
func (*ContainerMount) GetVersion ¶
func (x *ContainerMount) GetVersion() int64
func (*ContainerMount) Key ¶
func (x *ContainerMount) Key() string
func (*ContainerMount) SetVersion ¶
func (x *ContainerMount) SetVersion(v int64)
func (*ContainerMount) Value ¶
func (x *ContainerMount) Value() interface{}
type ContainerSpec ¶
type ContainerSpec struct {
Container `mapstructure:",squash" yaml:",inline"`
//Interfaces []*ContainerInterface
Mounts []*ContainerMount
Environment map[string]string
// contains filtered or unexported fields
}
func (*ContainerSpec) Env ¶
func (ctr *ContainerSpec) Env() []string
type CountSet ¶
type CountSet struct {
Name string `json:"name"`
Size int `json:"size,omitempty"`
Values []int `json:"values"`
Offset int `json:"offset"`
// contains filtered or unexported fields
}
func (*CountSet) GetVersion ¶
func (*CountSet) SetVersion ¶
type CtrComponent ¶
type DeleteContainerData ¶
type DeleteContainerIfxData ¶
type DeleteContainerNsData ¶
type DeleteContainerNsData struct {
Name string
}
type Destination ¶
type Destination struct {
Paths []*Path
}
func NewDestination ¶
func NewDestination(dst *api.Destination) *Destination
func (*Destination) MarshalJSON ¶
func (d *Destination) MarshalJSON() ([]byte, error)
type EnclaveSpec ¶
type EnclaveSpec struct {
Mzid string
Vindex int
ExternalIfx string
ExternalGateway string
ExternalSubnet string
InternalGateway string
NatSourceIP string
Interfaces []*EnclaveVeth
// contains filtered or unexported fields
}
func (*EnclaveSpec) GetVersion ¶
func (e *EnclaveSpec) GetVersion() int64
func (*EnclaveSpec) Key ¶
func (e *EnclaveSpec) Key() string
func (*EnclaveSpec) SetVersion ¶
func (e *EnclaveSpec) SetVersion(v int64)
func (*EnclaveSpec) Value ¶
func (e *EnclaveSpec) Value() interface{}
type EnclaveVeth ¶
type EnclaveVeth struct {
Inner string
Outer string
Vni int `yaml:",omitempty"`
Vid int `yaml:",omitempty"`
Vindex int `yaml:",omitempty"`
EvpnAdvertise bool `yaml:",omitempty"`
Bridge string
Address string
HostMac string `yaml:",omitempty"`
CtrMac string `yaml:",omitempty"`
// contains filtered or unexported fields
}
func (*EnclaveVeth) GetVersion ¶
func (x *EnclaveVeth) GetVersion() int64
func (*EnclaveVeth) Key ¶
func (x *EnclaveVeth) Key() string
func (*EnclaveVeth) SetVersion ¶
func (x *EnclaveVeth) SetVersion(v int64)
func (*EnclaveVeth) Value ¶
func (x *EnclaveVeth) Value() interface{}
type EvpnInfo ¶
type EvpnInfo struct {
BgpIP net.IP
Rd bgp.RouteDistinguisherInterface
Rt bgp.ExtendedCommunityInterface
}
type EvpnWithdrawData ¶
type FoundrySetSpec ¶
type FoundrySetSpec struct {
Endpoint string
Machines []*foundry.MachineConfig
}
type ImageBinding ¶
type ImageBinding struct {
//Node string
//Mac string
Image *sled.Image // image storage information
Kexec *sled.Kexec // local kexec after initial sled write
}
type ImageDefaults ¶
type ImageDefaults struct {
Image sled.Image
// contains filtered or unexported fields
}
func (*ImageDefaults) GetVersion ¶
func (d *ImageDefaults) GetVersion() int64
func (*ImageDefaults) Key ¶
func (d *ImageDefaults) Key() string
func (*ImageDefaults) SetVersion ¶
func (d *ImageDefaults) SetVersion(v int64)
func (*ImageDefaults) Value ¶
func (d *ImageDefaults) Value() interface{}
type ImageSpec ¶
type ImageSpec struct {
Endpoint string // location of sledb
List []ImageBinding
NoVerify bool
}
type LinkInfo ¶
type LinkInfo struct {
Mzid string
Vlid string // virtual link identifier from merge
Vni int
Vid int
// contains filtered or unexported fields
}
func (*LinkInfo) GetVersion ¶
func (*LinkInfo) SetVersion ¶
type LinkSpec ¶
type MzInfo ¶
type MzInfo struct {
Mzid string
Instance string
Vindex int
Vni int
Vid int
Status MzStatus
IncomingTaskId string
TeardownTaskId string
NodeSetupTaskId string
NodeRecycleTaskId string
LinkCreateTaskId string
LinkDestroyTaskId string
NodeInfo map[string]NodeInfo
LinkInfo []LinkSpec
// contains filtered or unexported fields
}
func ListMaterializations ¶
func (*MzInfo) GetVersion ¶
func (*MzInfo) SetVersion ¶
type MzOperation ¶
type MzOperation string
const ( MzOutgoing MzOperation = "outgoing" MzIncoming MzOperation = "incoming" MzMod MzOperation = "mod" )
type MzfIndex ¶
type MzfIndex struct {
Resource string
Fragment *site.MzFragment
// contains filtered or unexported fields
}
func (*MzfIndex) GetVersion ¶
func (*MzfIndex) SetVersion ¶
type NetNS ¶
Network Namespace Record
func (*NetNS) GetVersion ¶
func (*NetNS) RemoveContainer ¶
func (*NetNS) SetVersion ¶
type NexMemberSpec ¶
type NexMemberSpec struct {
nex.MemberList `mapstructure:",squash" yaml:",inline"`
Endpoint string
}
type NexNetworkSpec ¶
type NexNetworkSpec struct {
// Core Nex data
Network nex.Network
// Nex endpoint address
Endpoint string
}
type NimbusConfig ¶
type NimbusConfig struct {
Node string
Users []NimbusUser
}
type NimbusUser ¶
type NodeInfo ¶
type NodeInfo struct {
XpName string
Image *ImageBinding
Config *foundry.MachineConfig
Nex *nex.Member
}
type NodeInfraInfo ¶
NodeInfraInfo something struct
type NodeSpec ¶
type NodeSpec struct {
Resource string
Xname string
Mac string
Interface string
Multidegree bool
SvcEndpoint string
Infranet *TargetNetwork
Binding *ImageBinding
Config *foundry.MachineConfig
}
type NodeState ¶ added in v0.2.20
type NodeState struct {
Name string
Mzid string
Status NodeStatus
// contains filtered or unexported fields
}
func (*NodeState) GetVersion ¶ added in v0.2.20
func (*NodeState) SetVersion ¶ added in v0.2.20
type NodeStatus ¶
type NodeStatus int
const ( NodeNone NodeStatus = iota Setup Recycling Ready Clean )
type Path ¶
type Path struct {
Nlri bgp.AddrPrefixInterface `json:"nlri"`
Age int64 `json:"age"`
Best bool `json:"best"`
Attrs []bgp.PathAttributeInterface `json:"attrs"`
Stale bool `json:"stale"`
Withdrawal bool `json:"withdrawal,omitempty"`
SourceID net.IP `json:"source-id,omitempty"`
NeighborIP net.IP `json:"neighbor-ip,omitempty"`
}
workaround. This for the json format compatibility. Once we update senario tests, we can remove this.
type PortObj ¶ added in v0.2.13
type PortObj struct {
Mzid string
Host string
Port string
Mode PortMode
Vids []int
Up bool
// contains filtered or unexported fields
}
func (*PortObj) GetVersion ¶ added in v0.2.13
func (*PortObj) SetVersion ¶ added in v0.2.13
type RallyStore ¶
type RallyStore struct {
Id string
}
type TargetNetwork ¶
type Task ¶
type Task struct {
Id string `yaml:",omitempty"`
Coglet string `yaml:",omitempty"`
Stages []*Stage
Deps []string `yaml:",omitempty"`
Timestamp string
// contains filtered or unexported fields
}
func (*Task) ClearErrors ¶
func (t *Task) ClearErrors()
func (*Task) DepsSatisfied ¶
func (*Task) GetVersion ¶
func (*Task) MaskAction ¶
func (*Task) SetVersion ¶
type VLMap ¶
type VLMap struct {
Mzid string
Entries map[int]*VLMentry
// contains filtered or unexported fields
}
func (*VLMap) GetVersion ¶
func (*VLMap) SetVersion ¶
type VtepObj ¶ added in v0.2.13
type VtepObj struct {
Mzid string
Host string
Name string
Vni int
Vid int
// contains filtered or unexported fields
}
func (*VtepObj) GetVersion ¶ added in v0.2.13
func (*VtepObj) SetVersion ¶ added in v0.2.13
type VxLan ¶
Vxlan Record