Skip to content

Commit ef0838a

Browse files
draychevakshaysngupta
authored andcommitted
helm: Remove requiremens for watchNamespace; remove default (#337)
1 parent 2038327 commit ef0838a

File tree

9 files changed

+30
-14
lines changed

9 files changed

+30
-14
lines changed

cmd/appgw-ingress/main.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import (
3131

3232
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/annotations"
3333
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/appgw"
34-
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/agic_crd_client/clientset/versioned"
3534
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/controller"
36-
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
35+
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/agic_crd_client/clientset/versioned"
3736
istio "github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/istio_crd_client/clientset/versioned"
37+
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
3838
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/k8scontext"
3939
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/version"
4040
)
@@ -105,7 +105,11 @@ func main() {
105105
kubeClient := kubernetes.NewForConfigOrDie(apiConfig)
106106
namespaces := getNamespacesToWatch(env.WatchNamespace)
107107
validateNamespaces(namespaces, kubeClient) // side-effect: will panic on non-existent namespace
108-
glog.Info("Ingress Controller will observe the following namespaces:", strings.Join(namespaces, ","))
108+
if len(namespaces) == 0 {
109+
glog.Info("Ingress Controller will observe all namespaces.")
110+
} else {
111+
glog.Info("Ingress Controller will observe the following namespaces:", strings.Join(namespaces, ","))
112+
}
109113
crdClient := versioned.NewForConfigOrDie(apiConfig)
110114
istioCrdClient := istio.NewForConfigOrDie(apiConfig)
111115
k8sContext := k8scontext.NewContext(kubeClient, crdClient, istioCrdClient, namespaces, *resyncPeriod)
@@ -137,7 +141,7 @@ func validateNamespaces(namespaces []string, kubeClient *kubernetes.Clientset) {
137141
func getNamespacesToWatch(namespaceEnvVar string) []string {
138142

139143
// Returning an empty array effectively switches Ingress Controller
140-
// in a mode of observing all acessible namespaces.
144+
// in a mode of observing all accessible namespaces.
141145
if namespaceEnvVar == "" {
142146
return []string{}
143147
}

helm/ingress-azure/templates/NOTES.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ Configuration Details:
1818
- Resource Group : {{ .Values.appgw.resourceGroup }}
1919
- Application Gateway Name : {{ .Values.appgw.name }}
2020
* Kubernetes:
21-
- Watch Namespace : {{ .Values.kubernetes.watchNamespace }}
21+
{{- if .Values.kubernetes }}
22+
{{- if .Values.kubernetes.watchNamespace }}
23+
- Watching Namespaces: {{ .Values.kubernetes.watchNamespace }}
24+
{{- else }}
25+
- Watching All Namespaces
26+
{{- end }}
27+
{{- else }}
28+
- Watching All Namespaces
29+
{{- end }}
2230
* Verbosity level: {{ .Values.verbosityLevel }}
2331
{{ if eq .Values.armAuth.type "aadPodIdentity"}}
2432
Please make sure the associated aadpodidentity and aadpodidbinding is configured.

helm/ingress-azure/templates/configmap.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ data:
1515
APPGW_RESOURCE_GROUP: {{ required "A valid appgw entry is required!" .Values.appgw.resourceGroup }}
1616
APPGW_NAME: {{ required "A valid appgw entry is required!" .Values.appgw.name }}
1717
APPGW_VERBOSITY_LEVEL: "{{ .Values.verbosityLevel }}"
18-
KUBERNETES_WATCHNAMESPACE: {{ required "A valid kubernetes watch namespace is required!" .Values.kubernetes.watchNamespace }}
18+
{{- if .Values.kubernetes }}
19+
{{- if .Values.kubernetes.watchNamespace }}
20+
KUBERNETES_WATCHNAMESPACE: "{{ .Values.kubernetes.watchNamespace }}"
21+
{{- end }}
22+
{{- end }}
1923
USE_PRIVATE_IP: "{{ .Values.appgw.usePrivateIP }}"

helm/ingress-azure/values-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ image:
1111
################################################################################
1212
# Specify which kubernetes namespace the ingress controller will watch
1313
#
14-
kubernetes:
15-
watchNamespace: default
14+
# kubernetes:
15+
# watchNamespace: default
1616

1717
################################################################################
1818
# Specify which application gateway the ingress controller will manage

helm/ingress-azure/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ image:
1111
################################################################################
1212
# Specify which kubernetes namespace the ingress controller will watch
1313
#
14-
kubernetes:
15-
watchNamespace: default
14+
# kubernetes:
15+
# watchNamespace: default
1616

1717
################################################################################
1818
# Specify which application gateway the ingress controller will manage

pkg/appgw/appgw_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import (
2020

2121
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/annotations"
2222
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/agic_crd_client/clientset/versioned/fake"
23+
istio_fake "github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/istio_crd_client/clientset/versioned/fake"
2324
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
2425
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/events"
25-
istio_fake "github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/istio_crd_client/clientset/versioned/fake"
2626
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/k8scontext"
2727
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/tests"
2828
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/utils"

pkg/k8scontext/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
prohibitedv1 "github.com/Azure/application-gateway-kubernetes-ingress/pkg/apis/azureingressprohibitedtarget/v1"
2727
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/agic_crd_client/clientset/versioned"
2828
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/agic_crd_client/informers/externalversions"
29-
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
3029
istio_versioned "github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/istio_crd_client/clientset/versioned"
3130
istio_externalversions "github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/istio_crd_client/informers/externalversions"
31+
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
3232
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/utils"
3333
)
3434

pkg/k8scontext/k8scontext_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020

2121
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/annotations"
2222
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/agic_crd_client/clientset/versioned/fake"
23-
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
2423
istio_fake "github.com/Azure/application-gateway-kubernetes-ingress/pkg/crd_client/istio_crd_client/clientset/versioned/fake"
24+
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/environment"
2525
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/k8scontext"
2626
"github.com/Azure/application-gateway-kubernetes-ingress/pkg/tests"
2727
)

pkg/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ func PrettyJSON(js []byte, prefix string) ([]byte, error) {
5353
func GetLastChunkOfSlashed(s string) string {
5454
split := strings.Split(s, "/")
5555
return split[len(split)-1]
56-
}
56+
}

0 commit comments

Comments
 (0)