@@ -21,8 +21,7 @@ func getServerIP() string {
2121}
2222
2323func playHome (w http.ResponseWriter , r * http.Request ) {
24- bannedIp = r .URL .Query ().Get ("ip" )
25- status := "Customer Support, Mr. Cat speaking, how can I help you!"
24+ status := "Customer Support, Mr. Cat speaking, how can I help you?"
2625 img := "1.3.0"
2726 if bannedIp == getServerIP () {
2827 status = "I don't want to die Mr. Stark ( x_x ) ..."
@@ -31,8 +30,8 @@ func playHome(w http.ResponseWriter, r *http.Request) {
3130 html := `<!DOCTYPE html><html><body><center>
3231 <img src="https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/` + img + `.png">
3332 <h1 style="color:green">Playing with Kubernetes</h1>
34- <h2 style="color:blue">Your server IP: ` + getServerIP () + `9090 </h2>
35- <h3 style="color:blue">Version: twogghub/k8s-workshop:` + version + `</h3>
33+ <h2 style="color:blue">Server IP ` + getServerIP () + `</h2>
34+ <h3 style="color:blue">Version twogghub/k8s-workshop:` + version + `</h3>
3635 <h3 style="color:red">` + status + `</h3>
3736 </center></body></html>`
3837 fmt .Fprintf (w , html )
@@ -55,6 +54,7 @@ func playDead(w http.ResponseWriter, r *http.Request) {
5554func main () {
5655 http .HandleFunc ("/" , playHome )
5756 http .HandleFunc ("/health" , playHealth )
57+ http .HandleFunc ("/kill" , playDead )
5858 if err := http .ListenAndServe (":9090" , nil ); err != nil {
5959 panic (err )
6060 }
0 commit comments