Skip to content

Commit

Permalink
Add CSV based env var to define istio hosts Signed-off-by: Josh Harwo…
Browse files Browse the repository at this point in the history
…od <josh.harwood@thisisbud.com>
  • Loading branch information
josh-thisisbud committed Mar 26, 2024
1 parent bd7f250 commit fb35194
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,13 @@ func generateVirtualService(instance *v1beta1.Notebook) (*unstructured.Unstructu
vsvc.SetKind("VirtualService")
vsvc.SetName(virtualServiceName(name, namespace))
vsvc.SetNamespace(namespace)
if err := unstructured.SetNestedStringSlice(vsvc.Object, []string{"*"}, "spec", "hosts"); err != nil {
istioHostsEnv := os.Getenv("ISTIO_HOSTS")
if len(istioHostsEnv) == 0 {
istioHosts = []string{"*"}
} else {
istioHosts := strings.Split(istioHostsEnv, ",")
}
if err := unstructured.SetNestedStringSlice(vsvc.Object, istioHosts, "spec", "hosts"); err != nil {
return nil, fmt.Errorf("set .spec.hosts error: %v", err)
}

Expand Down

0 comments on commit fb35194

Please sign in to comment.