Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rccrdpccl committed Jul 27, 2020
1 parent 2e692a0 commit 6d34607
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions cmd/node-policy-webhook/node-policy-webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const DEFAULT_BIND_ADDRESS = ":8443"
var handler *h.HttpHandler

func init() {
klog.V(0).Infof("Starting node-policy-webhook")

handler = getHttpHandler()
}

Expand All @@ -56,7 +54,6 @@ func main() {
rootCmd.MarkFlagRequired("tls-cert")
rootCmd.MarkFlagRequired("tls-key")

klog.V(0).Infof("Command initialised")
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down Expand Up @@ -92,7 +89,7 @@ func run(params *params) {
if address == "" {
address = DEFAULT_BIND_ADDRESS
}
klog.V(0).Infof("Starting server, bund at %v", address)
klog.V(0).Infof("Starting server, bound at %v", address)
klog.Infof("Listening to address %v", address)
srv := &http.Server{
Addr: address,
Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/reviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (r *AdmissionReviewer) newAdmissionError(pod *v1.Pod, err error) *v1beta1.A
}

func (r *AdmissionReviewer) admissionAllowedResponse(pod *v1.Pod) *v1beta1.AdmissionResponse {
klog.V(log.EXTENDED).Infof("Skipping admission review for pod %s/%s", pod.Namespace, pod.Name)
klog.Errorf("Skipping admission review for pod %s/%s", pod.Namespace, pod.Name)
return &v1beta1.AdmissionResponse{
Allowed: true,
}
Expand Down
1 change: 0 additions & 1 deletion pkg/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func NewHttpHanlder(reviewer *admission.AdmissionReviewer) *HttpHandler {
}

func (h *HttpHandler) HealthCheckHandler(w http.ResponseWriter, r *http.Request) {
klog.Warning("Responding HC")
w.WriteHeader(http.StatusOK)
if _, err := w.Write([]byte("ok")); err != nil {
failIfError(w, err)
Expand Down

0 comments on commit 6d34607

Please sign in to comment.