Доработайте публикацию и сверку вложений по итогам ревью

This commit is contained in:
2026-11-18 11:43:27 +03:00
parent 1f06d9f4ab
commit 80c4a56200
27 changed files with 605 additions and 275 deletions
+5 -4
View File
@@ -43,7 +43,7 @@ func run(ctx context.Context, args []string, out, errOut io.Writer) int {
fmt.Fprintln(errOut, "reconcile: no positional arguments allowed; --grace must be at least 2m")
return 2
}
dbConfig, err := config.LoadMigrate(os.LookupEnv)
databaseURL, err := config.LoadDatabaseURL(os.LookupEnv)
if err != nil {
fmt.Fprintln(errOut, "configuration error:", err)
return 2
@@ -54,12 +54,12 @@ func run(ctx context.Context, args []string, out, errOut io.Writer) int {
fmt.Fprintln(errOut, "configuration error:", err)
return 2
}
blobs, err := s3store.New(s3Config.Endpoint, s3Config.Region, s3Config.Bucket, s3Config.AccessKey, s3Config.SecretKey)
blobs, err := s3store.New(s3Config)
if err != nil {
fmt.Fprintln(errOut, "configuration error:", err)
return 2
}
db, err := postgres.NewPool(ctx, dbConfig.DatabaseURL, 10)
db, err := postgres.NewPool(ctx, databaseURL, 10)
if err != nil {
fmt.Fprintln(errOut, "reconcile:", err)
return 1
@@ -76,7 +76,8 @@ func run(ctx context.Context, args []string, out, errOut io.Writer) int {
defer cancel()
encoder := json.NewEncoder(out)
var outputErr error
stats, runErr := r.Run(scanCtx, *apply, *deep, func(f attachment.Finding) {
options := attachment.ReconcileOptions{Apply: *apply, Deep: *deep}
stats, runErr := r.Run(scanCtx, options, func(f attachment.Finding) {
if outputErr == nil {
outputErr = encoder.Encode(f)
if outputErr != nil {