// AddNamespacedName adds namespaced name by node
7358
func (nsr *NamespaceResolver) AddNamespacedName(nn node.Node, nodeName string) {
	if nsr.Namespace.Namespace == "" {
		nsr.ResolvedNames[nn] = nodeName
	} else {
		nsr.ResolvedNames[nn] = nsr.Namespace.Namespace + "\\" + nodeName
	}
}
1342307
func (n Namespace) AddDynamicElement(name, description string) Namespace {
	nse := NamespaceElement{Name: name, Description: description, Value: "*"}
	return append(n, nse)
}
1135671
func (s *ListUsersInput) SetNamespace(v string) *ListUsersInput {
	s.Namespace = &v
	return s
}
1043634
func (k *kubernetesClient) GetNamespace(name string) (*core.Namespace, error) {
	ns, err := k.getNamespaceByName(name)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if err := checkNamespaceOwnedByJuju(ns, k.annotations); err != nil {
		return nil, errors.NotFoundf("namespace %q", name)
	}
	return ns, nil
}
452580
func Namespace(c context.Context, namespace string) (context.Context, error) {
	if !validNamespace.MatchString(namespace) {
		return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", namespace, validNamespace)
	}
	n := &namespacedContext{
		ctx:       c,
		namespace: namespace,
	}
	return internal.WithNamespace(internal.WithCallOverride(c, n.call), namespace), nil
}
489637
func (uvm *UtilityVM) AddNetNS(id string) (err error) {
	op := "uvm::AddNetNS"
	log := logrus.WithFields(logrus.Fields{
		logfields.UVMID: uvm.id,
		"netns-id":      id,
	})
	log.Debug(op + " - Begin Operation")
	defer func() {
		if err != nil {
			log.Data[logrus.ErrorKey] = err
			log.Error(op + " - End Operation - Error")
		} else {
			log.Debug(op + " - End Operation - Success")
		}
	}()

	uvm.m.Lock()
	defer uvm.m.Unlock()
	if _, ok := uvm.namespaces[id]; ok {
		return ErrNetNSAlreadyAttached
	}

	if uvm.isNetworkNamespaceSupported() {
		// Add a Guest Network namespace. On LCOW we add the adapters
		// dynamically.
		if uvm.operatingSystem == "windows" {
			hcnNamespace, err := hcn.GetNamespaceByID(id)
			if err != nil {
				return err
			}
			guestNamespace := hcsschema.ModifySettingRequest{
				GuestRequest: guestrequest.GuestRequest{
					ResourceType: guestrequest.ResourceTypeNetworkNamespace,
					RequestType:  requesttype.Add,
					Settings:     hcnNamespace,
				},
			}
			if err := uvm.Modify(&guestNamespace); err != nil {
				return err
			}
		}
	}

	if uvm.namespaces == nil {
		uvm.namespaces = make(map[string]*namespaceInfo)
	}
	uvm.namespaces[id] = &namespaceInfo{
		nics: make(map[string]*nicInfo),
	}
	return nil
}
663022
func (k *kubernetesClient) Namespaces() ([]string, error) {
	namespaces := k.client().CoreV1().Namespaces()
	ns, err := namespaces.List(v1.ListOptions{IncludeUninitialized: true})
	if err != nil {
		return nil, errors.Annotate(err, "listing namespaces")
	}
	result := make([]string, len(ns.Items))
	for i, n := range ns.Items {
		if err := checkNamespaceOwnedByJuju(&n, k.annotations); err != nil {
			continue
		}
		result[i] = n.Name
	}
	return result, nil
}
697264
func NewNamespaceNamer(shortNames bool) *NamespaceNamer {
	return &NamespaceNamer{shortNames: shortNames, re: regexp.MustCompile(invalidTokensExpr)}
}
1074112
func (s *DiscoverInstancesInput) SetNamespaceName(v string) *DiscoverInstancesInput {
	s.NamespaceName = &v
	return s
}
1182397
func AddNamespaceEndpoint(namespaceId string, endpointId string) error {
	logrus.Debugf("hcn::HostComputeEndpoint::AddNamespaceEndpoint id=%s", endpointId)

	mapA := map[string]string{"EndpointId": endpointId}
	settingsJson, err := json.Marshal(mapA)
	if err != nil {
		return err
	}
	requestMessage := &ModifyNamespaceSettingRequest{
		ResourceType: NamespaceResourceTypeEndpoint,
		RequestType:  RequestTypeAdd,
		Settings:     settingsJson,
	}

	return ModifyNamespaceSettings(namespaceId, requestMessage)
}
11412
func (s *UpdateUserInput) SetNamespace(v string) *UpdateUserInput {
	s.Namespace = &v
	return s
}
1117159
func (s *RegisterUserInput) SetNamespace(v string) *RegisterUserInput {
	s.Namespace = &v
	return s
}
349242
func (s *CreateGroupInput) SetNamespace(v string) *CreateGroupInput {
	s.Namespace = &v
	return s
}
1168468
func NewNamespacer(d discovery.DiscoveryInterface) (*namespaceViaDiscovery, error) {
	fallback, err := getDefaultNamespace()
	if err != nil {
		return nil, err
	}
	return &namespaceViaDiscovery{fallbackNamespace: fallback, disco: d}, nil
}
122303
func QueryNamespace(query string, dst interface{}, namespace string) error {
	return Query(query, dst, nil, namespace)
}
278849
func (l *dynamicLister) Namespace(namespace string) NamespaceLister {
	return &dynamicNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr}
}
512221
func (u *DockerRegistryURL) AddLibraryNamespace() {
	// If the image name does not contain '/', it is intended to be an official
	// image; so we add the `library` namespace to the URL.
	if !strings.Contains(u.ImageName, "/") {
		u.ImageName = fmt.Sprintf("library/%s", u.ImageName)
	}
}