Switch LogOf from panicking when logger is missing to creating logger with the defaults.

Update CORS tests to a table-based test and cover more cases.
This commit is contained in:
Jessica Forrester
2014-09-09 17:05:18 -04:00
parent becf6ca4e7
commit 0cac1c5f79
7 changed files with 85 additions and 92 deletions

View File

@@ -24,6 +24,7 @@ import (
"net/http"
"os"
"strconv"
"strings"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
@@ -141,7 +142,7 @@ func main() {
if len(corsAllowedOriginList) > 0 {
allowedOriginRegexps, err := util.CompileRegexps(corsAllowedOriginList)
if err != nil {
glog.Fatalf("Invalid CORS allowed origin: %v", err)
glog.Fatalf("Invalid CORS allowed origin, --cors_allowed_origins flag was set to %v - %v", strings.Join(corsAllowedOriginList, ","), err)
}
handler = apiserver.CORS(handler, allowedOriginRegexps, nil, nil, "true")
}