fix: context handling
All checks were successful
Release Secrets Manager Action / build (push) Successful in 1m12s
All checks were successful
Release Secrets Manager Action / build (push) Successful in 1m12s
This commit is contained in:
parent
3c562f3d63
commit
c302a35868
3 changed files with 10 additions and 8 deletions
7
main.go
7
main.go
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
|
@ -19,6 +20,8 @@ func main() {
|
|||
log.Println(".env file not found, using regular environment variables")
|
||||
}
|
||||
|
||||
ctx := context.TODO()
|
||||
|
||||
var cfg config.Config
|
||||
err = env.Parse(&cfg)
|
||||
if err != nil {
|
||||
|
|
@ -26,11 +29,11 @@ func main() {
|
|||
}
|
||||
cfg = config.ValidateConfig(cfg)
|
||||
|
||||
s, err := secretsmanager.New(cfg)
|
||||
s, err := secretsmanager.New(ctx, cfg)
|
||||
if err != nil {
|
||||
log.Fatalf("Error initializing secrets manager client: %s", err)
|
||||
}
|
||||
data, err := s.GetSecrets(cfg)
|
||||
data, err := s.GetSecrets(ctx, cfg)
|
||||
if err != nil {
|
||||
log.Fatalf("Error retrieving secrets: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue