Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use non-root user in Dockerfile for a1-policy-management-service
[nonrtric.git]
/
test
/
usecases
/
odusliceassurance
/
goversion
/
main.go
diff --git
a/test/usecases/odusliceassurance/goversion/main.go
b/test/usecases/odusliceassurance/goversion/main.go
index
05b5edf
..
8366843
100644
(file)
--- a/
test/usecases/odusliceassurance/goversion/main.go
+++ b/
test/usecases/odusliceassurance/goversion/main.go
@@
-22,6
+22,7
@@
package main
import (
"fmt"
import (
"fmt"
+ "net/http"
log "github.com/sirupsen/logrus"
"oransc.org/usecase/oduclosedloop/internal/config"
log "github.com/sirupsen/logrus"
"oransc.org/usecase/oduclosedloop/internal/config"
@@
-36,6
+37,8
@@
func main() {
configuration = config.New()
log.SetLevel(configuration.LogLevel)
configuration = config.New()
log.SetLevel(configuration.LogLevel)
+ log.SetFormatter(&log.JSONFormatter{})
+
log.Debug("Using configuration: ", configuration)
dmaapUrl := configuration.MRHost + ":" + configuration.MRPort
log.Debug("Using configuration: ", configuration)
dmaapUrl := configuration.MRHost + ":" + configuration.MRPort
@@
-46,8
+49,11
@@
func main() {
a := sliceassurance.App{}
a.Initialize(dmaapUrl, configuration.SDNRAddress)
a := sliceassurance.App{}
a.Initialize(dmaapUrl, configuration.SDNRAddress)
- a.Run(TOPIC, configuration.Polltime)
+ go a.Run(TOPIC, configuration.Polltime)
+
+ http.HandleFunc("/status", statusHandler)
+ log.Fatal(http.ListenAndServe(":40936", nil))
}
func validateConfiguration(configuration *config.Config) error {
}
func validateConfiguration(configuration *config.Config) error {
@@
-56,3
+62,7
@@
func validateConfiguration(configuration *config.Config) error {
}
return nil
}
}
return nil
}
+
+func statusHandler(w http.ResponseWriter, r *http.Request) {
+ // Just respond OK to show the service is alive for now. Might be extended later.
+}