-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fix: Use ARGOCD_SERVER for default value #21930
fix: Use ARGOCD_SERVER for default value #21930
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Signed-off-by: sivchari <[email protected]>
af51e13
to
3288a30
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21930 +/- ##
==========================================
+ Coverage 53.83% 55.72% +1.88%
==========================================
Files 341 341
Lines 57004 57004
==========================================
+ Hits 30689 31766 +1077
+ Misses 23720 22598 -1122
- Partials 2595 2640 +45 ☔ View full report in Codecov by Sentry. |
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.
Left a small comment.
@@ -67,7 +67,7 @@ func NewCommand() *cobra.Command { | |||
defaultLocalConfigPath, err := localconfig.DefaultLocalConfigPath() | |||
errors.CheckError(err) | |||
command.PersistentFlags().StringVar(&clientOpts.ConfigPath, "config", config.GetFlag("config", defaultLocalConfigPath), "Path to Argo CD config") | |||
command.PersistentFlags().StringVar(&clientOpts.ServerAddr, "server", config.GetFlag("server", ""), "Argo CD server address") | |||
command.PersistentFlags().StringVar(&clientOpts.ServerAddr, "server", config.GetFlag("server", env.StringFromEnv(common.EnvServer, "")), "Argo CD server address") |
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.
command.PersistentFlags().StringVar(&clientOpts.ServerAddr, "server", config.GetFlag("server", env.StringFromEnv(common.EnvServer, "")), "Argo CD server address") | |
command.PersistentFlags().StringVar(&clientOpts.ServerAddr, "server", config.GetFlag("server", env.StringFromEnv(common.EnvServer, "")), "Argo CD server address") |
what's the default value of this env?
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.
If ARGOCD_SERVER is set as environment variable, the default value is it. If not, the default value is empty string.
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.
This PR does not completely fix #21910 ARGOCD_AUTH_TOKEN
case is not handled. Is it possible to add the fix for the auth token too?
close #21910
Checklist:
ARGOCD_AUTH_TOKEN is already set for default value of auth-token flag. So I also added ARGOCD_SERVER.