-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
963 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/stackrox/image-prefetcher/internal/logging" | ||
"github.com/stackrox/image-prefetcher/internal/metrics/server" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// aggregateMetricsCmd represents the aggregate-metrics command | ||
var aggregateMetricsCmd = &cobra.Command{ | ||
Use: "aggregate-metrics", | ||
Short: "Accept metrics submissions and serve them.", | ||
Long: `This subcommand is intended to run in a single pod. | ||
It serves: | ||
- a gRPC endpoint to which individual metrics can be submitted, | ||
- an HTTP endpoint from which the aggregate metrics can be fetched.`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return server.Run(logging.GetLogger(), grpcPort, httpPort) | ||
}, | ||
} | ||
|
||
var ( | ||
grpcPort int | ||
httpPort int | ||
) | ||
|
||
func init() { | ||
rootCmd.AddCommand(aggregateMetricsCmd) | ||
logging.AddFlags(aggregateMetricsCmd.Flags()) | ||
aggregateMetricsCmd.Flags().IntVar(&grpcPort, "grpc-port", 8443, "Port for metrics submission gRPC endpoint to listen on.") | ||
aggregateMetricsCmd.Flags().IntVar(&httpPort, "http-port", 8080, "Port for metrics retrieval HTTP endpoint to listen on.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
module github.com/stackrox/image-prefetcher | ||
|
||
go 1.21 | ||
go 1.22.0 | ||
|
||
toolchain go1.21.7 | ||
toolchain go1.22.1 | ||
|
||
require ( | ||
github.com/cenkalti/backoff/v4 v4.2.1 | ||
github.com/google/uuid v1.6.0 | ||
github.com/spf13/cobra v1.8.0 | ||
github.com/spf13/pflag v1.0.5 | ||
google.golang.org/grpc v1.63.2 | ||
k8s.io/apimachinery v0.29.3 | ||
google.golang.org/protobuf v1.33.0 | ||
k8s.io/apimachinery v0.30.0 | ||
k8s.io/cri-api v0.29.3 | ||
k8s.io/klog/v2 v2.110.1 | ||
k8s.io/klog/v2 v2.120.1 | ||
) | ||
|
||
require ( | ||
github.com/go-logr/logr v1.3.0 // indirect | ||
github.com/go-logr/logr v1.4.1 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
golang.org/x/net v0.21.0 // indirect | ||
golang.org/x/sys v0.17.0 // indirect | ||
golang.org/x/net v0.23.0 // indirect | ||
golang.org/x/sys v0.18.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect | ||
google.golang.org/protobuf v1.33.0 // indirect | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.