init_linux.go
func joinExistingNamespaces(namespaces []configs.Namespace) error {
	for _, ns := range namespaces {
		if ns.Path != "" {
			f, err := os.OpenFile(ns.Path, os.O_RDONLY, 0)
			if err != nil {
				return err
			}
			err = system.Setns(f.Fd(), uintptr(ns.Syscall()))
			f.Close()
			if err != nil {
				return err
			}
		}
	}
	return nil
}
func joinExistingNamespaces(namespaces []configs.Namespace) error {
	for _, ns := range namespaces {
		if ns.Path != "" {
			f, err := os.OpenFile(ns.Path, os.O_RDONLY, 0)
			if err != nil {
				return err
			}
			err = system.Setns(f.Fd(), uintptr(ns.Syscall()))
			f.Close()
			if err != nil {
				return err
			}
		}
	}
	return nil
}
func joinExistingNamespaces ( namespaces [ ] configs . Namespace ) error { for _ , ns := range namespaces { if ns . Path != " " { f , err := os . OpenFile ( ns . Path , os . O_RDONLY , 0 ) if err != nil { return err } err = system . Setns ( f . Fd ( ) , uintptr ( ns . Syscall ( ) ) ) f . Close ( ) if err != nil { return err } } } return nil }
// joinExistingNamespaces gets all the namespace paths specified for the container and
// does a setns on the namespace fd so that the current process joins the namespace.
joinExistingNamespaces gets all the namespace paths specified for the container and does a setns on the namespace fd so that the current process joins the namespace .