Repository navigation
Conversation
thomastaylor312
left a comment
There was a problem hiding this comment.
A few points of discussion. Otherwise a great looking refactor
| env := EnvSettings{ | ||
| Namespace: os.Getenv("HELM_NAMESPACE"), | ||
| return &EnvSettings{ | ||
| // Namespace: os.Getenv("HELM_NAMESPACE"), |
There was a problem hiding this comment.
I assume this line should be deleted
| fs.StringVar(&s.RegistryConfig, "registry-config", s.RegistryConfig, "path to the registry config file") | ||
| fs.StringVar(&s.RepositoryConfig, "repository-config", s.RepositoryConfig, "path to the file containing repository names and URLs") | ||
| fs.StringVar(&s.RepositoryCache, "repository-cache", s.RepositoryCache, "path to the file containing cached repository indexes") | ||
| s.KubeConfig.AddFlags(fs) |
There was a problem hiding this comment.
This is going to add tons of flags to the commands. Do we really want all of them? Obviously this would get us closer to what kubectl has, but it still feels a bit like overkill.
There was a problem hiding this comment.
Same to me, I would like to at least hide some of the flags here and for the logging setup
There was a problem hiding this comment.
I think we should not add the flags now and if the need comes up later, we can add this back in. I'm not married to the idea, so if you like it as is now, that should be fine!
There was a problem hiding this comment.
After looking at this again, I think this is ok to have
| if settings.Debug != tt.debug { | ||
| t.Errorf("expected debug %t, got %t", tt.debug, settings.Debug) | ||
| } | ||
| if settings.Namespace != tt.ns { |
There was a problem hiding this comment.
Do we need a unit test for the new Namespace function instead?
bbf6d7e to
03bea32
Compare
Signed-off-by: Adam Reese <[email protected]>
03bea32 to
f021ad4
Compare
| "HELM_REGISTRY_CONFIG": s.RegistryConfig, | ||
| "HELM_REPOSITORY_CACHE": s.RepositoryCache, | ||
| "HELM_REPOSITORY_CONFIG": s.RepositoryConfig, | ||
| "HELM_NAMESPACE": s.Namespace(), |
There was a problem hiding this comment.
Trying to adopt the helm-diff plugin for helm3 it came up that plugins are unaware of --kube-context and --namespace passed to the main binary. This makes it impossible to talk to the k8s cluster used by helm:
databus23/helm-diff#151 (comment)
Not sure if this is the right place but how about passing the values from --kube0context as HELM_KUBECONTEXT?
There was a problem hiding this comment.
Also of note from that issue in helm-diff is that @databus23 pointed out that we still have --kube-context as a top level flag in the helm CLI, and now we will also have --context due to the flags we attach with the AddFlags method
There was a problem hiding this comment.
I believe this is the right place to set something like HELM_KUBECONTEXT as this EnvVars are inherited to the plugin via
Line 219 in 9bc7934
There was a problem hiding this comment.
A dedicated issue opened for adding those envvars: #6631
|
Hey @adamreese! How are we on this PR? Do you need another set of eyes to review this one, or is there some refactoring work involved before I take this for a spin? |
No description provided.