Skip to content

Commit

Permalink
Make label_sync JSON format it's logs and set the 'component' log field.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjwagner committed Mar 12, 2019
1 parent 7f449a0 commit 3d75f4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions label_sync/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ go_library(
"//prow/config/secret:go_default_library",
"//prow/flagutil:go_default_library",
"//prow/github:go_default_library",
"//prow/logrusutil:go_default_library",
"//vendor/github.com/sirupsen/logrus:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/sigs.k8s.io/yaml:go_default_library",
Expand Down
5 changes: 5 additions & 0 deletions label_sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"k8s.io/test-infra/prow/config/secret"
"k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/github"
"k8s.io/test-infra/prow/logrusutil"
)

const maxConcurrentWorkers = 20
Expand Down Expand Up @@ -673,6 +674,10 @@ func newClient(tokenPath string, tokens, tokenBurst int, dryRun bool, hosts ...s
// It took about 10 minutes to process all my 8 repos with all wanted "kubernetes" labels (70+)
// Next run takes about 22 seconds to check if all labels are correct on all repos
func main() {
logrus.SetFormatter(
logrusutil.NewDefaultFieldsFormatter(nil, logrus.Fields{"component": "label_sync"}),
)

flag.Parse()
if *debug {
logrus.SetLevel(logrus.DebugLevel)
Expand Down

0 comments on commit 3d75f4a

Please sign in to comment.