-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Anthos MultiCloud distributions to UserAgentMode #465
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,9 @@ const ( | |
UAModeUnspecified = "unspecified" | ||
UAModeAVMW = "on-prem" | ||
UAModeABM = "baremetal" | ||
UAModeAWS = "aws" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have both a Is there any way to auto-detect whether we're running in AWS or Azure using a go library that we could add to the logic in For on-prem or baremetal, autodetection is not possible due to the heterogeneity of those environments, so using "mode" as a way to distinguish these makes sense, albeit it's getting double-usage out of that flag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point. @ericroman920 could you comment on the auto detection for anthos on aws & azure? |
||
UAModeAzure = "azure" | ||
UAModeAttached = "attached" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is "attached"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attached clusters could be any k8s cluster that customers want to connect to Google. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha - could you add a comment? |
||
) | ||
|
||
// Environment variable that contains additional command line arguments. | ||
|
@@ -133,7 +136,7 @@ func FromFlags(a *kingpin.Application, userAgentProduct string) func(log.Logger, | |
a.Flag("export.label.project-id", fmt.Sprintf("Default project ID set for all exported data. Prefer setting the external label %q in the Prometheus configuration if not using the auto-discovered default.", export.KeyProjectID)). | ||
Default(opts.ProjectID).StringVar(&opts.ProjectID) | ||
|
||
a.Flag("export.user-agent-mode", fmt.Sprintf("Mode for user agent used for requests against the GCM API. Valid values are %q, %q, %q, %q or %q.", UAModeGKE, UAModeKubectl, UAModeAVMW, UAModeABM, UAModeUnspecified)). | ||
a.Flag("export.user-agent-mode", fmt.Sprintf("Mode for user agent used for requests against the GCM API. Valid values are %q, %q, %q, %q, %q, %q, %q or %q.", UAModeGKE, UAModeKubectl, UAModeAVMW, UAModeABM, UAModeAWS, UAModeAzure, UAModeAttached, UAModeUnspecified)). | ||
Default("unspecified").EnumVar(&opts.UserAgentMode, UAModeUnspecified, UAModeGKE, UAModeKubectl, UAModeAVMW, UAModeABM) | ||
|
||
// The location and cluster flag should probably not be used. On the other hand, they make it easy | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add comments on what each of these modes means? e.g. what's the difference between "on-prem" and "baremetal"?