-
Notifications
You must be signed in to change notification settings - Fork 704
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
[FlyteCTL Feature] Add support for passing config via ENV vars #4948
Comments
🤖 Hey there @ddl-ebrown! 🚀 Great to see you back bringing valuable insights to the table. How's everything going on your end? Thank you for your feature request. It is indeed possible to add a feature to FlyteCTL that allows passing configuration via environment variables. This can be achieved by using the Here is a simple example of how you can read an environment variable in Go: package main
import (
"fmt"
"os"
)
func main() {
platformURL := os.Getenv("FLYTE_PLATFORM_URL")
fmt.Println(platformURL)
} In the context of the provided code, you can modify the func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet {
cmdFlags := pflag.NewFlagSet("Config", pflag.ExitOnError)
endpoint := os.Getenv("FLYTE_PLATFORM_URL")
if endpoint == "" {
endpoint = defaultConfig.Endpoint.String()
}
cmdFlags.String(fmt.Sprintf("%v%v", prefix, "endpoint"), endpoint, "For admin types, specify where the uri of the service is located.")
// ... rest of the code ...
return cmdFlags
} In this example, the This approach is similar to the one used in a previously solved issue in the Flyte repository: [BUG] Platform config fields other than 'endpoint' and 'insecure' cannot be overriden in flyte-cli commands. The issue was addressed by modifying the I hope this helps! If you have any further questions or need more clarification, please let me know. Sources
|
@ddl-ebrown , this is a great feature. Please, feel free to contribute. ❤️ Dosu's answers pinpoint exactly in the codebase where this change would take place. I'm happy to review a PR. |
#self-assign |
#take |
Describe the feature/command for FlyteCTL
pyflyte accepts values like
FLYTE_PLATFORM_URL
as an override for the admin endpoint in flytes config fileflytectl does not provide a similar config option. I thought it might be parsed like
FLTYE_ADMIN_ENDPOINT
orFLYTECTL_ADMIN_ENDPOINT
-- but it doesn't look like cobra / viper is configured to parse environment variables in the flytectl binary.Provide a possible output or UX example
This is useful for providing feature parity for configuration between the two toolchains.
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: