Skip to content

Commit

Permalink
Merge pull request #159 from linkernetworks/phstsai/VX-207
Browse files Browse the repository at this point in the history
[Task] VX-207: Improve go report (prometheus part)
  • Loading branch information
John-Lin authored Jul 25, 2018
2 parents 8e6d031 + 09dc796 commit 9cfcf07
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ apps.init-helm:

.PHONY: apps.launch-apps
apps.launch-apps:
helm install --name vortex-foundation --debug --set global.environment=testing deploy/helm/foundation
helm install --name vortex-apps --debug --set global.environment=testing deploy/helm/apps/
helm install --name vortex-foundation --debug --wait --set global.environment=local deploy/helm/foundation
helm install --name vortex-apps --debug --wait --set global.environment=local deploy/helm/apps/

.PHONY: apps.teardown
apps.teardown:
Expand Down
1 change: 0 additions & 1 deletion src/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func generateInitContainer(networks []entity.PodNetwork) ([]corev1.Container, er
func generateNetwork(session *mongo.Session, pod *entity.Pod) ([]string, []corev1.Container, error) {

networks := []entity.Network{}
containers := []corev1.Container{}
for i, v := range pod.Networks {
network := entity.Network{}
if err := session.FindOne(entity.NetworkCollectionName, bson.M{"name": v.Name}, &network); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions src/prometheuscontroller/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (suite *PrometheusQueryTestSuite) TestQuery() {
suite.NotEqual(0, float32(resource[0].Value))

// Get nil if the resource is empty
resource, err = query(suite.sp, "")
resource, _ = query(suite.sp, "")
suite.Equal(model.Vector(nil), resource)
}

Expand All @@ -63,6 +63,6 @@ func (suite *PrometheusQueryTestSuite) TestGetElements() {
suite.NotEqual(0, float32(resource[0].Value))

// Get nil if the resource is empty
resource, err = getElements(suite.sp, Expression{})
resource, _ = getElements(suite.sp, Expression{})
suite.Equal(model.Vector(nil), resource)
}
12 changes: 0 additions & 12 deletions src/server/handler_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ func listContainerMetricsHandler(ctx *web.Context) {

func getContainerMetricsHandler(ctx *web.Context) {
sp, req, resp := ctx.ServiceProvider, ctx.Request, ctx.Response

container := entity.ContainerMetrics{}
id := req.PathParameter("id")

container, err := pc.GetContainer(sp, id)
Expand Down Expand Up @@ -116,8 +114,6 @@ func listPodMetricsHandler(ctx *web.Context) {

func getPodMetricsHandler(ctx *web.Context) {
sp, req, resp := ctx.ServiceProvider, ctx.Request, ctx.Response

pod := entity.PodMetrics{}
id := req.PathParameter("id")

pod, err := pc.GetPod(sp, id)
Expand Down Expand Up @@ -164,8 +160,6 @@ func listControllerMetricsHandler(ctx *web.Context) {

func getControllerMetricsHandler(ctx *web.Context) {
sp, req, resp := ctx.ServiceProvider, ctx.Request, ctx.Response

controller := entity.ControllerMetrics{}
id := req.PathParameter("id")

controller, err := pc.GetController(sp, id)
Expand Down Expand Up @@ -212,8 +206,6 @@ func listServiceMetricsHandler(ctx *web.Context) {

func getServiceMetricsHandler(ctx *web.Context) {
sp, req, resp := ctx.ServiceProvider, ctx.Request, ctx.Response

service := entity.ServiceMetrics{}
id := req.PathParameter("id")

service, err := pc.GetService(sp, id)
Expand Down Expand Up @@ -252,8 +244,6 @@ func listNodeMetricsHandler(ctx *web.Context) {

func listNodeNicsMetricsHandler(ctx *web.Context) {
sp, req, resp := ctx.ServiceProvider, ctx.Request, ctx.Response

nicList := entity.NodeNICsMetrics{}
id := req.PathParameter("id")

nicList, err := pc.ListNodeNICs(sp, id)
Expand All @@ -267,8 +257,6 @@ func listNodeNicsMetricsHandler(ctx *web.Context) {

func getNodeMetricsHandler(ctx *web.Context) {
sp, req, resp := ctx.ServiceProvider, ctx.Request, ctx.Response

node := entity.NodeMetrics{}
id := req.PathParameter("id")

node, err := pc.GetNode(sp, id)
Expand Down

0 comments on commit 9cfcf07

Please sign in to comment.