Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ukff committed Oct 3, 2024
1 parent fac2fc7 commit 34c06e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion cmd/globalaccounts/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"context"

"github.com/kyma-project/kyma-environment-broker/internal/globalaccounts"
"github.com/vrischmann/envconfig"
)
Expand All @@ -11,5 +13,6 @@ func main() {
if err != nil {
panic(err.Error())
}
globalaccounts.Run(cfg)
ctx := context.Background()
globalaccounts.Run(ctx, cfg)
}
9 changes: 4 additions & 5 deletions internal/globalaccounts/globalaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@ type svcConfig struct {
SubaccountsURL string
}

func Run(c Config) {
ctx := context.Background()
func Run(ctx context.Context, cfg Config) {
logs := logrus.New()
logs.Infof("*** Start at: %s ***", time.Now().Format(time.RFC3339))
logs.Infof("is dry run?: %t ", c.DryRun)
logs.Infof("is dry run?: %t ", cfg.DryRun)

svc, db, kcp, err := initAll(ctx, c, logs)
svc, db, kcp, err := initAll(ctx, cfg, logs)
fatalOnError(err, logs)

clusterOp, err := clusterOp(ctx, kcp, logs)
fatalOnError(err, logs)
logs.Println(fmt.Sprintf("No. kymas: %d", len(clusterOp.Items)))

logic(c, svc, db, clusterOp, logs)
logic(cfg, svc, db, clusterOp, logs)
logs.Infof("*** End at: %s ***", time.Now().Format(time.RFC3339))
}

Expand Down

0 comments on commit 34c06e8

Please sign in to comment.