-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat: unified source code #304
Changes from 7 commits
a7f890e
0c1e8b1
bc5393a
d78ba9a
f42c2da
3b47832
8edc090
b02557c
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 |
---|---|---|
|
@@ -32,28 +32,28 @@ func init() { | |
// allows environment variables to use _ instead of - | ||
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) // sync-provider-args becomes SYNC_PROVIDER_ARGS | ||
viper.SetEnvPrefix("FLAGD") // port becomes FLAGD_PORT | ||
flags.Int32P(metricsPortFlagName, "m", 8014, "Port to serve metrics on") | ||
flags.Int32P(portFlagName, "p", 8013, "Port to listen on") | ||
flags.StringP(socketPathFlagName, "d", "", "Flagd socket path. "+ | ||
"With grpc the service will become available on this address. "+ | ||
"With http(s) the grpc-gateway proxy will use this address internally.") | ||
flags.StringP(evaluatorFlagName, "e", "json", "DEPRECATED: Set an evaluator e.g. json, yaml/yml."+ | ||
"Please note that yaml/yml and json evaluations work the same (yaml/yml files are converted to json internally)") | ||
flags.StringP(serverCertPathFlagName, "c", "", "Server side tls certificate path") | ||
flags.StringP(serverKeyPathFlagName, "k", "", "Server side tls key path") | ||
flags.Int32P(metricsPortFlagName, "m", 8014, "port to serve metrics on") | ||
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. Please revert the flag argument description changes. |
||
flags.Int32P(portFlagName, "p", 8013, "port to listen on") | ||
flags.StringP(socketPathFlagName, "d", "", "flagd socket path"+ | ||
"with grpc the service will become available on this address"+ | ||
"with http(s) the grpc-gateway proxy will use this address internally") | ||
flags.StringP(evaluatorFlagName, "e", "json", "DEPRECATED: set an evaluator e.g. json, yaml/yml"+ | ||
"please note that yaml/yml and json evaluations work the same (yaml/yml files are converted to json internally)") | ||
flags.StringP(serverCertPathFlagName, "c", "", "server side tls certificate path") | ||
flags.StringP(serverKeyPathFlagName, "k", "", "server side tls key path") | ||
flags.StringToStringP(providerArgsFlagName, | ||
"a", nil, "Sync provider arguments as key values separated by =") | ||
"a", nil, "sync provider arguments as key values separated by =") | ||
flags.StringSliceP( | ||
uriFlagName, "f", []string{}, "Set a sync provider uri to read data from, this can be a filepath,"+ | ||
"url or FeatureFlagConfiguration. Using multiple providers is supported however if"+ | ||
uriFlagName, "f", []string{}, "set a sync provider uri to read data from, this can be a filepath,"+ | ||
"url or feature flag configuration. Using multiple providers is supported however if"+ | ||
" flag keys are duplicated across multiple sources it may lead to unexpected behavior. "+ | ||
"Please note that if you are using filepath, flagd only supports files with `.yaml/.yml/.json` extension.", | ||
) | ||
flags.StringP( | ||
bearerTokenFlagName, "b", "", "Set a bearer token to use for remote sync") | ||
bearerTokenFlagName, "b", "", "set a bearer token to use for remote sync") | ||
flags.StringSliceP(corsFlagName, "C", []string{}, "CORS allowed origins, * will allow all origins") | ||
flags.StringP( | ||
syncProviderFlagName, "y", "", "DEPRECATED: Set a sync provider e.g. filepath or remote", | ||
syncProviderFlagName, "y", "", "DEPRECATED: set a sync provider e.g. filepath or remote", | ||
) | ||
|
||
_ = viper.BindPFlag(portFlagName, flags.Lookup(portFlagName)) | ||
|
@@ -91,12 +91,12 @@ var startCmd = &cobra.Command{ | |
rtLogger := logger.WithFields(zap.String("component", "start")) | ||
|
||
if viper.GetString(syncProviderFlagName) != "" { | ||
rtLogger.Warn("DEPRECATED: The --sync-provider flag has been deprecated. " + | ||
rtLogger.Warn("DEPRECATED: the --sync-provider flag has been deprecated " + | ||
"Docs: https://github.com/open-feature/flagd/blob/main/docs/configuration.md") | ||
} | ||
|
||
if viper.GetString(evaluatorFlagName) != "" { | ||
rtLogger.Warn("DEPRECATED: The --evaluator flag has been deprecated. " + | ||
rtLogger.Warn("DEPRECATED: the --evaluator flag has been deprecated " + | ||
"Docs: https://github.com/open-feature/flagd/blob/main/docs/configuration.md") | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import ( | |
// versionCmd represents the version command | ||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Print the version number of FlagD", | ||
Short: "print the version number of flagd", | ||
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. Please revert |
||
Long: ``, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
if Version == "dev" { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,16 @@ highest priority, followed by environment variables and finally config file. | |
Supported flags are as follows (result of running `./flagd start --help`): | ||
|
||
``` | ||
-b, --bearer-token string Set a bearer token to use for remote sync | ||
-b, --bearer-token string set a bearer token to use for remote sync | ||
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. Please revert this. |
||
-C, --cors-origin strings CORS allowed origins, * will allow all origins | ||
-h, --help help for start | ||
-m, --metrics-port int32 Port to serve metrics on (default 8014) | ||
-p, --port int32 Port to listen on (default 8013) | ||
-c, --server-cert-path string Server side tls certificate path | ||
-k, --server-key-path string Server side tls key path | ||
-d, --socket-path string Flagd socket path. With grpc the service will become available on this address. With http(s) the grpc-gateway proxy will use this address internally. | ||
-a, --sync-provider-args stringToString Sync provider arguments as key values separated by = (default []) | ||
-f, --uri .yaml/.yml/.json Set a sync provider uri to read data from, this can be a filepath,url or FeatureFlagConfiguration. Using multiple providers is supported however if flag keys are duplicated across multiple sources it may lead to unexpected behavior. Please note that if you are using filepath, flagd only supports files with .yaml/.yml/.json extension. | ||
-m, --metrics-port int32 port to serve metrics on (default 8014) | ||
-p, --port int32 port to listen on (default 8013) | ||
-c, --server-cert-path string server side tls certificate path | ||
-k, --server-key-path string server side tls key path | ||
-d, --socket-path string flagd socket path. With grpc the service will become available on this address. With http(s) the grpc-gateway proxy will use this address internally. | ||
-a, --sync-provider-args stringToString sync provider arguments as key values separated by = (default []) | ||
-f, --uri .yaml/.yml/.json set a sync provider uri to read data from, this can be a filepath,url or FeatureFlagConfiguration. Using multiple providers is supported however if flag keys are duplicated across multiple sources it may lead to unexpected behavior. Please note that if you are using filepath, flagd only supports files with .yaml/.yml/.json extension. | ||
-e, --evaluator string DEPRECATED: Set an evaluator e.g. json, yaml/yml. Please note that yaml/yml and json evaluations work the same (yaml/yml files are converted to json internally) (default "json") | ||
-y, --sync-provider string DEPRECATED: Set a sync provider e.g. filepath or remote | ||
``` | ||
|
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.
Please revert the change made to the short description.