Skip to content

Commit

Permalink
Readd invalid rules test
Browse files Browse the repository at this point in the history
Signed-off-by: Jéssica Lins <jessicaalins@gmail.com>
  • Loading branch information
jessicalins committed Jan 25, 2022
1 parent ec05d23 commit 79a0937
Show file tree
Hide file tree
Showing 24 changed files with 498 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .errcheck_excludes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(github.com/go-kit/kit/log.Logger).Log
(github.com/go-kit/log.Logger).Log
2 changes: 1 addition & 1 deletion api/logs/v1/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/go-chi/chi"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"

Expand Down
2 changes: 1 addition & 1 deletion api/metrics/legacy/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/go-chi/chi"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"

Expand Down
4 changes: 2 additions & 2 deletions api/metrics/v1/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"time"

"github.com/go-chi/chi"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"

Expand Down
6 changes: 4 additions & 2 deletions api/metrics/v1/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"

"github.com/ghodss/yaml"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/observatorium/api/authentication"
"github.com/observatorium/api/rules"
)
Expand Down Expand Up @@ -122,6 +122,8 @@ func (rh *rulesHandler) put(w http.ResponseWriter, r *http.Request) {

defer resp.Body.Close()

w.WriteHeader(resp.StatusCode)

if _, err := io.Copy(w, resp.Body); err != nil {
http.Error(w, "error writing rules response", http.StatusInternalServerError)
return
Expand Down
4 changes: 2 additions & 2 deletions authentication/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"sync"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion authentication/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"testing"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/mitchellh/mapstructure"
"github.com/observatorium/api/logger"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion authentication/mtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"io/ioutil"
"net/http"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/mitchellh/mapstructure"
"github.com/prometheus/client_golang/prometheus"
)
Expand Down
4 changes: 2 additions & 2 deletions authentication/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/coreos/go-oidc"
"github.com/efficientgo/tools/core/pkg/backoff"
"github.com/go-chi/chi"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/mitchellh/mapstructure"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
Expand Down
4 changes: 2 additions & 2 deletions authentication/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/efficientgo/tools/core/pkg/backoff"
"github.com/go-chi/chi"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/golang-jwt/jwt/v4"
"github.com/mitchellh/mapstructure"
"github.com/observatorium/api/authentication/openshift"
Expand Down
22 changes: 14 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ module github.com/observatorium/api
go 1.16

require (
github.com/brancz/kube-rbac-proxy v0.5.0
github.com/cloudflare/cfssl v1.4.1
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/brancz/kube-rbac-proxy v0.11.0
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cloudflare/cfssl v1.6.1
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/deepmap/oapi-codegen v1.9.0
github.com/efficientgo/e2e v0.11.1
Expand All @@ -13,15 +15,14 @@ require (
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/chi/v5 v5.0.0
github.com/go-chi/httprate v0.4.0
github.com/go-kit/kit v0.10.0
github.com/go-kit/log v0.2.0
github.com/golang-jwt/jwt/v4 v4.1.0
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/metalmatze/signal v0.0.0-20210307161603-1c9aa721a97a
github.com/mitchellh/mapstructure v1.4.1
github.com/mitchellh/mapstructure v1.4.3
github.com/oklog/run v1.1.0
github.com/onsi/ginkgo v1.16.3 // indirect
github.com/onsi/gomega v1.13.0 // indirect
Expand All @@ -31,17 +32,22 @@ require (
github.com/prometheus-community/prom-label-proxy v0.3.1-0.20210623095334-9d425172d7bb
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.32.1
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/prometheus v1.8.2-0.20210621150501-ff58416a0b02
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.18.0
go.opentelemetry.io/contrib/propagators v0.18.0
go.opentelemetry.io/otel v0.18.0
go.opentelemetry.io/otel/exporters/trace/jaeger v0.18.0
go.opentelemetry.io/otel/sdk v0.18.0
go.opentelemetry.io/otel/trace v0.18.0
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/automaxprocs v1.2.0
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 // indirect
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08
google.golang.org/grpc v1.38.0
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4
google.golang.org/grpc v1.43.0
google.golang.org/protobuf v1.27.1
gopkg.in/square/go-jose.v2 v2.4.1 // indirect
k8s.io/apimachinery v0.21.1
Expand Down
Loading

0 comments on commit 79a0937

Please sign in to comment.