Skip to content

Commit

Permalink
fix dns search domains configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
waynz0r committed Jul 11, 2019
1 parent 5761fbd commit 715908f
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions pkg/resources/sidecarinjector/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@ func (r *Reconciler) configMap() runtime.Object {
}

func (r *Reconciler) getValues() string {
podDNSSearchNamespaces := make([]string, 0)
if util.PointerToBool(r.Config.Spec.MultiMesh) {
podDNSSearchNamespaces = append(podDNSSearchNamespaces, []string{
"global",
"{{ valueOrDefault .DeploymentMeta.Namespace \"default\" }}.global",
}...)
return ""
}

values := map[string]interface{}{
"sidecarInjectorWebhook": map[string]interface{}{
"rewriteAppHTTPProbe": r.Config.Spec.SidecarInjector.RewriteAppHTTPProbe,
},
"global": map[string]interface{}{
"trustDomain": "cluster.local",
"imagePullPolicy": r.Config.Spec.ImagePullPolicy,
"network": r.Config.Spec.GetNetworkName(),
"podDNSSearchNamespaces": []string{
"global",
"total",
"{{ valueOrDefault .DeploymentMeta.Namespace \"default\" }}.global",
},
"trustDomain": "cluster.local",
"imagePullPolicy": r.Config.Spec.ImagePullPolicy,
"network": r.Config.Spec.GetNetworkName(),
"podDNSSearchNamespaces": podDNSSearchNamespaces,
"proxy_init": map[string]interface{}{
"image": r.Config.Spec.ProxyInit.Image,
},
Expand Down Expand Up @@ -122,18 +127,6 @@ func (r *Reconciler) siConfig() string {

}

func (r *Reconciler) dnsConfig() string {
if !util.PointerToBool(r.Config.Spec.MultiMesh) {
return ""
}
return `
dnsConfig:
searches:
- global
- "{{ valueOrDefault .DeploymentMeta.Namespace "default" }}.global"
`
}

func (r *Reconciler) templateConfig() string {
return `rewriteAppHTTPProbe: {{ valueOrDefault .Values.sidecarInjectorWebhook.rewriteAppHTTPProbe false }}
{{- if .Values.global.podDNSSearchNamespaces }}
Expand Down

0 comments on commit 715908f

Please sign in to comment.