namespaces

package
v0.0.0-...-adfa13f Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package namespaces handles interaction with Consul namespaces needed across commands.

Index

Constants

View Source
const (
	WildcardNamespace = "*"
	DefaultNamespace  = "default"
)

Variables

This section is empty.

Functions

func ConsulNamespace

func ConsulNamespace(kubeNS string, enableConsulNamespaces bool, consulDestNS string, enableMirroring bool, mirroringPrefix string) string

ConsulNamespace returns the consul namespace that a service should be registered in based on the namespace options. It returns an empty string if namespaces aren't enabled.

func EnsureDeleted

func EnsureDeleted(client *capi.Client, ns string) error

EnsureDeleted ensures a Consul namespace with name ns is deleted. If it is already not found the call to delete will be skipped.

func EnsureExists

func EnsureExists(client *capi.Client, ns string, crossNSAClPolicy string) (bool, error)

EnsureExists ensures a Consul namespace with name ns exists. If it doesn't, it will create it and set crossNSACLPolicy as a policy default. Boolean return value indicates if the namespace was created by this call.

func NonDefaultConsulNamespace

func NonDefaultConsulNamespace(consulNS string) string

NonDefaultConsulNamespace returns the given Consul namespace if it is not default or empty. Otherwise, it returns the empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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