Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
k8s/controller: always map "default" Consul namespace to empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorris committed Jan 4, 2023
1 parent fc3a7d6 commit 958a9d6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions internal/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,20 @@ type ConsulNamespaceConfig struct {
}

func (c ConsulNamespaceConfig) Namespace(namespace string) string {
var consulNamespace string

if c.MirrorKubernetesNamespaces {
return c.MirrorKubernetesNamespacePrefix + namespace
consulNamespace = c.MirrorKubernetesNamespacePrefix + namespace
} else {
consulNamespace = c.ConsulDestinationNamespace
}

// Always map the default namespace to "" for compatibility with Consul OSS
if consulNamespace == "default" {
consulNamespace = ""
}
return c.ConsulDestinationNamespace

return consulNamespace
}

type Kubernetes struct {
Expand Down

0 comments on commit 958a9d6

Please sign in to comment.