Skip to content

Commit 781a623

Browse files
committed
[helm] feat: add helm hellok8s:v6 code.
1 parent 400c6cb commit 781a623

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

hello-helm/main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"io"
6+
"net/http"
7+
"os"
8+
)
9+
10+
func hello(w http.ResponseWriter, r *http.Request) {
11+
host, _ := os.Hostname()
12+
message := os.Getenv("MESSAGE")
13+
namespace := os.Getenv("NAMESPACE")
14+
dbURL := os.Getenv("DB_URL")
15+
dbPassword := os.Getenv("DB_PASSWORD")
16+
17+
io.WriteString(w, fmt.Sprintf("[v6] Hello, Helm! Message from helm values: %s, From namespace: %s, From host: %s, Get Database Connect URL: %s, Database Connect Password: %s", message, namespace, host, dbURL, dbPassword))
18+
}
19+
20+
func main() {
21+
http.HandleFunc("/", hello)
22+
http.ListenAndServe(":3000", nil)
23+
}

0 commit comments

Comments
 (0)