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:
Caleb Doxsey 2023-04-21 17:25:11 -06:00 committed by GitHub
parent 34c1e44c7e
commit bbed421cd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
122 changed files with 438 additions and 998 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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")
}