Skip to content
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

Provide a envconfig.Config method to inject a client from kubeconfig file. #39

Closed
vladimirvivien opened this issue Jul 29, 2021 · 0 comments · Fixed by #44
Closed

Provide a envconfig.Config method to inject a client from kubeconfig file. #39

vladimirvivien opened this issue Jul 29, 2021 · 0 comments · Fixed by #44

Comments

@vladimirvivien
Copy link
Contributor

The example here reveals the multi-steps necessary to create a klient.Client from a kubeconfig file and then inject that client into the environment's configuration.

func(ctx context.Context, cfg *envconf.Config) (context.Context, error) {

It would be nice if the envconf.Config type provided a method to handle the injection of the client in one step similar to:

func TestMain(m *testing.M){
    testenv.Setup(
        func(ctx context.Context, cfg *envconf.Config) (context.Context, error) { 
            cfg.WithKubeconfigFile(kubeconf_file_path) // this would create a new klient.Client, then inject it in the cfg
        },
    )
    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant