Skip to content

Commit 0a41aaa

Browse files
authored
Fix default metadata namespaces (#1633)
Summary: #1368 added the ability to limit the metadata service to specific namespaces. By default, if no namespaces are mentioned, the flag is supposed to choose all namespaces. However, if the environment variable is not specified, it is actually parsed as an empty list and the default is not properly chosen. Instead, we can assume no users actually want to watch 0 namespaces, and set it to all namespaces when that occurs. Relevant Issues: N/A Type of change: /kind bug Test Plan: Skaffold deploy metadata service Signed-off-by: Michelle Nguyen <michellenguyen@pixielabs.ai>
1 parent ea9a357 commit 0a41aaa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/vizier/services/metadata/metadata_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ func main() {
238238
mdh := k8smeta.NewHandler(updateCh, k8sMds, k8sMds, nc)
239239

240240
namespaces := viper.GetStringSlice("metadata_namespaces")
241+
if len(namespaces) == 0 {
242+
namespaces = []string{v1.NamespaceAll}
243+
}
241244
k8sMc, err := k8smeta.NewController(namespaces, updateCh)
242245
defer k8sMc.Stop()
243246

0 commit comments

Comments
 (0)