func main()

in cmd/rbe_configs_upload/rbe_configs_upload.go [194:228]


func main() {
	flag.Parse()
	printFlags()

	if len(*configsTarball) == 0 {
		log.Fatalf("--configs_tarball was not specified.")
	}
	if len(*configsManifest) == 0 {
		log.Fatalf("--configs_manifest was not specified.")
	}

	ctx := context.Background()
	mc, err := initMonitoringClient(ctx)
	if err != nil {
		log.Fatalf("Failed to initialize monitoring: %v", err)
	}

	result := true
	if err := uploadConfigs(ctx, *monitoringDockerImage); err != nil {
		log.Printf("Configs upload failed: %v", err)
		result = false
	} else {
		log.Printf("Configs uploaded successfully.")
	}

	// Monitoring is optional and used for internal alerting by the owners of this repo only.
	if mc != nil {
		if err := mc.ReportToolchainConfigsUpload(ctx, *monitoringDockerImage, result); err != nil {
			log.Fatalf("Failed to report results to monitoring: %v", err)
		}
	}
	if !result {
		os.Exit(1)
	}
}