mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
config: remove source, remove deadcode, fix linting issues (#4118)
* remove source, remove deadcode, fix linting issues * use github action for lint * fix missing envoy
This commit is contained in:
parent
34c1e44c7e
commit
bbed421cd8
122 changed files with 438 additions and 998 deletions
|
@ -169,7 +169,7 @@ func saveAndLogConfig(ctx context.Context, client databroker.DataBrokerServiceCl
|
|||
return nil
|
||||
}
|
||||
|
||||
func waitHealthy(ctx context.Context, client *http.Client, routes []*config.Route) error {
|
||||
func waitHealthy(ctx context.Context, _ *http.Client, routes []*config.Route) error {
|
||||
now := time.Now()
|
||||
if err := xdserr.WaitForHealthy(ctx, httpClient, routes); err != nil {
|
||||
return err
|
||||
|
@ -184,12 +184,12 @@ func waitHealthy(ctx context.Context, client *http.Client, routes []*config.Rout
|
|||
}
|
||||
|
||||
func saveConfig(ctx context.Context, client databroker.DataBrokerServiceClient, cfg *config.Config) error {
|
||||
any := protoutil.NewAny(cfg)
|
||||
data := protoutil.NewAny(cfg)
|
||||
r, err := client.Put(ctx, &databroker.PutRequest{
|
||||
Records: []*databroker.Record{{
|
||||
Type: any.GetTypeUrl(),
|
||||
Type: data.GetTypeUrl(),
|
||||
Id: "test_config",
|
||||
Data: any,
|
||||
Data: data,
|
||||
}},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -43,20 +43,20 @@ func DumpConfig(ctx context.Context, adminURL string) (*adminv3.RoutesConfigDump
|
|||
return nil, err
|
||||
}
|
||||
|
||||
any, _ := anypb.New(&emptypb.Empty{})
|
||||
fmt.Println(protojson.Format(any))
|
||||
a, _ := anypb.New(&emptypb.Empty{})
|
||||
fmt.Println(protojson.Format(a))
|
||||
opts := &protojson.UnmarshalOptions{
|
||||
AllowPartial: true,
|
||||
DiscardUnknown: true,
|
||||
}
|
||||
for i, data := range cfg.Configs {
|
||||
any := new(anypb.Any)
|
||||
if err = opts.Unmarshal(data, any); err != nil {
|
||||
a := new(anypb.Any)
|
||||
if err = opts.Unmarshal(data, a); err != nil {
|
||||
log.Error(ctx).Err(err).Int("config", i).
|
||||
//RawJSON("data", data).
|
||||
// RawJSON("data", data).
|
||||
Msg("decode")
|
||||
} else {
|
||||
log.Info(ctx).Msg(any.TypeUrl)
|
||||
log.Info(ctx).Msg(a.TypeUrl)
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func echo(w http.ResponseWriter, r *http.Request) {
|
||||
func echo(w http.ResponseWriter, _ *http.Request) {
|
||||
fmt.Fprintf(w, "pong")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue