Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task] VX-207: Improve go report (prometheus part) #159

Merged
merged 4 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -45,8 +45,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 @@ -96,8 +94,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 @@ -134,8 +130,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 @@ -172,8 +166,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 @@ -212,8 +204,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 @@ -227,8 +217,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