Skip to content

Commit

Permalink
Fix default metadata namespaces (#1633)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
aimichelle authored Jul 21, 2023
1 parent ea9a357 commit 0a41aaa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vizier/services/metadata/metadata_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ func main() {
mdh := k8smeta.NewHandler(updateCh, k8sMds, k8sMds, nc)

namespaces := viper.GetStringSlice("metadata_namespaces")
if len(namespaces) == 0 {
namespaces = []string{v1.NamespaceAll}
}
k8sMc, err := k8smeta.NewController(namespaces, updateCh)
defer k8sMc.Stop()

Expand Down

0 comments on commit 0a41aaa

Please sign in to comment.