mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 12:17:52 +00:00
pr feedback
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -52,8 +52,8 @@ func (m clusterDomainVar) Set(v string) error {
|
||||
v = strings.TrimSuffix(v, ".")
|
||||
segments := strings.Split(v, ".")
|
||||
for _, segment := range segments {
|
||||
if !validation.IsDNS1123Label(segment) {
|
||||
return fmt.Errorf("Not a valid DNS label")
|
||||
if errs := validation.IsDNS1123Label(segment); len(errs) > 0 {
|
||||
return fmt.Errorf("Not a valid DNS label. %v", errs)
|
||||
}
|
||||
}
|
||||
if !strings.HasSuffix(v, ".") {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,6 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
"github.com/skynetservices/skydns/metrics"
|
||||
"github.com/skynetservices/skydns/server"
|
||||
"k8s.io/kubernetes/cmd/kube-dns/app/options"
|
||||
@@ -104,7 +103,13 @@ func (server *KubeDNSServer) setupHealthzHandlers() {
|
||||
fmt.Fprintf(w, "ok\n")
|
||||
})
|
||||
http.HandleFunc("/cache", func(w http.ResponseWriter, req *http.Request) {
|
||||
fmt.Fprint(w, server.kd.GetCacheAsJSON())
|
||||
serializedJSON, err := server.kd.GetCacheAsJSON()
|
||||
if err == nil {
|
||||
fmt.Fprint(w, serializedJSON)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
fmt.Fprint(w, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -23,11 +23,9 @@ import (
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/flag"
|
||||
"k8s.io/kubernetes/pkg/version/verflag"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
config := options.NewKubeDNSConfig()
|
||||
config.AddFlags(pflag.CommandLine)
|
||||
|
||||
|
Reference in New Issue
Block a user