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

Matcher and Webhook Updates #487

Merged
merged 10 commits into from
Jul 25, 2024
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ _test
vendor
coverage*
report.json
yaml

# Architecture specific extensions/prefixes
*.[568vq]
Expand Down
10 changes: 8 additions & 2 deletions caduceus.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
"fmt"
"os"
"runtime/debug"
"time"

"github.com/alecthomas/kong"
"github.com/goschtalt/goschtalt"

_ "github.com/goschtalt/goschtalt/pkg/typical"
_ "github.com/goschtalt/yaml-decoder"
_ "github.com/goschtalt/yaml-encoder"
"github.com/xmidt-org/ancla"

Check failure on line 17 in caduceus.go

View workflow job for this annotation

GitHub Actions / ci / Build Go Program

github.com/xmidt-org/[email protected]: replacement directory /Users/mforti446/Documents/work/xmidt-repos/ancla does not exist

Check failure on line 17 in caduceus.go

View workflow job for this annotation

GitHub Actions / ci / Go Unit Tests

github.com/xmidt-org/[email protected]: replacement directory /Users/mforti446/Documents/work/xmidt-repos/ancla does not exist
"github.com/xmidt-org/arrange/arrangehttp"
anclahelper "github.com/xmidt-org/caduceus/internal/anclaHelper"
"github.com/xmidt-org/caduceus/internal/client"
"github.com/xmidt-org/caduceus/internal/handler"
"github.com/xmidt-org/caduceus/internal/metrics"
"github.com/xmidt-org/caduceus/internal/sink"
Expand Down Expand Up @@ -88,11 +90,13 @@
goschtalt.UnmarshalFunc[touchstone.Config]("prometheus"),
goschtalt.UnmarshalFunc[sink.Config]("sender"),
goschtalt.UnmarshalFunc[Service]("service"),
goschtalt.UnmarshalFunc[client.HttpClientTimeout]("argusClientTimeout"),
goschtalt.UnmarshalFunc[[]string]("authHeader"),
goschtalt.UnmarshalFunc[bool]("previousVersionSupport"),
goschtalt.UnmarshalFunc[HealthPath]("servers.health.path"),
goschtalt.UnmarshalFunc[MetricsPath]("servers.metrics.path"),
goschtalt.UnmarshalFunc[PprofPathPrefix]("servers.pprof.path"),
goschtalt.UnmarshalFunc[ancla.Config]("webhook"),
fx.Annotated{
Name: "server",
Target: goschtalt.UnmarshalFunc[string]("server"),
Expand Down Expand Up @@ -152,10 +156,12 @@
touchstone.Provide(),
touchhttp.Provide(),
metrics.Provide(),
// ancla.ProvideMetrics(), //TODO: need to add back in once we fix the ancla/argus dependency issue
client.Provide(),
ancla.ProvideMetrics(),

fx.Invoke(
lifeCycle,
anclahelper.InitializeAncla,
),
)

Expand Down
17 changes: 4 additions & 13 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package caduceus
import (
"fmt"
"os"
"time"

"github.com/goschtalt/goschtalt"
"github.com/xmidt-org/ancla"
"github.com/xmidt-org/arrange/arrangehttp"
"github.com/xmidt-org/arrange/arrangepprof"
"github.com/xmidt-org/bascule"
"github.com/xmidt-org/caduceus/internal/client"
"github.com/xmidt-org/caduceus/internal/sink"
"github.com/xmidt-org/candlelight"
"github.com/xmidt-org/clortho"
Expand All @@ -27,7 +28,7 @@ type Config struct {
Tracing candlelight.Config
Prometheus touchstone.Config
Servers Servers
ArgusClientTimeout HttpClientTimeout
ArgusClientTimeout client.HttpClientTimeout
JWTValidator JWTValidator
Sender sink.Config
Service Service
Expand All @@ -38,8 +39,7 @@ type Config struct {
Flavor string
PreviousVersionSupport bool
Region string
// Webhook ancla.Config //@TODO: need to fix the ancla/argus dependency issue

Webhook ancla.Config
}

type Service struct {
Expand Down Expand Up @@ -103,15 +103,6 @@ type PprofServer struct {

type PprofPathPrefix string

// httpClientTimeout contains timeouts for an HTTP client and its requests.
type HttpClientTimeout struct {
// ClientTimeout is HTTP Client Timeout.
ClientTimeout time.Duration

// NetDialerTimeout is the net dialer timeout
NetDialerTimeout time.Duration
}

type MetricsOption struct {
Namespace string
Subsystem string
Expand Down
43 changes: 23 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,29 @@ go 1.21

require (
github.com/alecthomas/kong v0.8.1
github.com/go-chi/chi/v5 v5.0.10
github.com/goschtalt/goschtalt v0.22.1
github.com/go-chi/chi/v5 v5.0.12
github.com/goschtalt/goschtalt v0.25.0
github.com/goschtalt/yaml-decoder v0.0.1
github.com/goschtalt/yaml-encoder v0.0.3
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_golang v1.19.1
github.com/satori/go.uuid v1.2.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/xmidt-org/ancla v0.3.13-0.20240718193746-a3cd5a39560c
github.com/xmidt-org/arrange v0.5.1-0.20230914215531-f02b8651b631
github.com/xmidt-org/bascule v0.11.7
github.com/xmidt-org/candlelight v0.0.21
github.com/xmidt-org/clortho v0.0.4
github.com/xmidt-org/httpaux v0.4.0
github.com/xmidt-org/retry v0.0.3
github.com/xmidt-org/sallust v0.2.2
github.com/xmidt-org/touchstone v0.1.3
github.com/xmidt-org/webhook-schema v0.1.0
github.com/xmidt-org/touchstone v0.1.5
github.com/xmidt-org/webhook-schema v0.1.1-0.20240718124820-b8c1ba1f19a9
github.com/xmidt-org/webpa-common/v2 v2.2.2
github.com/xmidt-org/wrp-go/v3 v3.2.3
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.46.1
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
go.uber.org/fx v1.20.1
go.uber.org/zap v1.26.0
go.uber.org/fx v1.22.1
go.uber.org/zap v1.27.0
gopkg.in/dealancer/validate.v2 v2.1.0
)

Expand All @@ -51,25 +52,25 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect
github.com/jtacoma/uritemplates v1.0.0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.4 // indirect
github.com/lestrrat-go/httprc v1.0.5 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.16 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.21 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/openzipkin/zipkin-go v0.4.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xmidt-org/chronon v0.1.1 // indirect
github.com/xmidt-org/urlegit v0.1.0 // indirect
github.com/xmidt-org/urlegit v0.1.12 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
Expand All @@ -83,14 +84,16 @@ require (
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/xmidt-org/ancla => /Users/mforti446/Documents/work/xmidt-repos/ancla
Loading
Loading