Skip to content

Commit e53a5ff

Browse files
weltekialexellis
authored andcommitted
Update response message for invalid namespaces
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent b76bbb0 commit e53a5ff

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

pkg/handlers/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func MakeDeleteHandler(defaultNamespace string, clientset *kubernetes.Clientset)
3838
}
3939

4040
if lookupNamespace != defaultNamespace {
41-
http.Error(w, fmt.Sprintf("valid namespaces are: %s", defaultNamespace), http.StatusBadRequest)
41+
http.Error(w, fmt.Sprintf("namespace must be: %s", defaultNamespace), http.StatusBadRequest)
4242
return
4343
}
4444

pkg/handlers/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func MakeDeployHandler(functionNamespace string, factory k8s.FunctionFactory) ht
6262
}
6363

6464
if namespace != functionNamespace {
65-
http.Error(w, fmt.Sprintf("valid namespaces are: %s", functionNamespace), http.StatusBadRequest)
65+
http.Error(w, fmt.Sprintf("namespace must be: %s", functionNamespace), http.StatusBadRequest)
6666
return
6767
}
6868

pkg/handlers/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func MakeFunctionReader(defaultNamespace string, deploymentLister v1.DeploymentL
3333
}
3434

3535
if lookupNamespace != defaultNamespace {
36-
http.Error(w, fmt.Sprintf("valid namespaces are: %s", defaultNamespace), http.StatusBadRequest)
36+
http.Error(w, fmt.Sprintf("namespace must be: %s", defaultNamespace), http.StatusBadRequest)
3737
return
3838
}
3939

pkg/handlers/replica_reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func MakeReplicaReader(defaultNamespace string, lister v1.DeploymentLister) http
3939
}
4040

4141
if lookupNamespace != defaultNamespace {
42-
http.Error(w, fmt.Sprintf("valid namespaces are: %s", defaultNamespace), http.StatusBadRequest)
42+
http.Error(w, fmt.Sprintf("namespace must be: %s", defaultNamespace), http.StatusBadRequest)
4343
return
4444
}
4545

pkg/handlers/replica_updater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func MakeReplicaUpdater(defaultNamespace string, clientset *kubernetes.Clientset
3636
}
3737

3838
if lookupNamespace != defaultNamespace {
39-
http.Error(w, fmt.Sprintf("valid namespaces are: %s", defaultNamespace), http.StatusBadRequest)
39+
http.Error(w, fmt.Sprintf("namespace must be: %s", defaultNamespace), http.StatusBadRequest)
4040
return
4141
}
4242

pkg/handlers/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func MakeUpdateHandler(defaultNamespace string, factory k8s.FunctionFactory) htt
4848
}
4949

5050
if lookupNamespace != defaultNamespace {
51-
http.Error(w, fmt.Sprintf("valid namespaces are: %s", defaultNamespace), http.StatusBadRequest)
51+
http.Error(w, fmt.Sprintf("namespace must be: %s", defaultNamespace), http.StatusBadRequest)
5252
return
5353
}
5454

0 commit comments

Comments
 (0)