azure-container-networking/network/namespace_windows.go

54 строки
1.2 KiB
Go
Исходник Обычный вид История

feat: cni refactor for swift v2 (#2330) * feat: update contracts to support swift 2 * add comments * rename AddressType to NICType * update contract names and comments * address comments * feat: update invokers to support swift 2 * address comments * address comments * refactor cns invoker per comments * update invokers based on contract change * update test * update with contract changes * fix linter errs * fix naming * fix linter * fix linter * address comments * update tests * add tests * address nit comments * add comments * address comments * fix casing * address comments * feat: update invokers to support swift 2 * address comments * feat: update invokers to support swift 2 * feat: update invokers to support swift 2 * feat: update endpoint clients for swift 2 * address comments * fix lint errs * update endpoint clients based on contract changes * update tests * only skip adding default route * modify AddEndpoints per comments * address comments * update deleteendpoint * enter ns before moving interface back to vm ns * update delete endpoint test * add namespace interface for testing * fix lint * fix lint * add comment * add extra delete endpoint test * update test * feat: update invokers to support swift 2 * address comments * address comments * feat: refactor endpoint create/delete flow for swift 2 * address comments * address comments * address linter * update based on contract changes * update with contract changes * add more tests and address comments * modify AddEndpoints per comments * update test for invoker add and endpoint client add failure * address comments * fix lint * update windows tests * update refactor with namespace interface * fix lint * rebasing fixes * address comments --------- Co-authored-by: Jaeryn <tsch@microsoft.com>
2023-11-01 22:50:35 +03:00
// Copyright 2017 Microsoft. All rights reserved.
// MIT License
package network
import (
"errors"
)
var errWindowsImpl = errors.New("windows impl err")
// Namespace represents a network namespace.
type Namespace struct{}
type NamespaceClient struct{}
func NewNamespaceClient() *NamespaceClient {
return &NamespaceClient{}
}
// OpenNamespace creates a new namespace object for the given netns path.
func (c *NamespaceClient) OpenNamespace(_ string) (NamespaceInterface, error) {
return nil, errWindowsImpl
}
// GetCurrentThreadNamespace returns the caller thread's current namespace.
func (c *NamespaceClient) GetCurrentThreadNamespace() (NamespaceInterface, error) {
return c.OpenNamespace("")
}
// Close releases the resources associated with the namespace object.
func (ns *Namespace) Close() error {
return nil
}
// GetFd returns the file descriptor of the namespace.
func (ns *Namespace) GetFd() uintptr {
return 0
}
func (ns *Namespace) GetName() string {
return "windows impl"
}
// Enter puts the caller thread inside the namespace.
func (ns *Namespace) Enter() error {
return nil
}
// Exit puts the caller thread to its previous namespace.
func (ns *Namespace) Exit() error {
return nil
}