refactor(config): rename embedded SP kubeconfig and namespace env vars - #32
refactor(config): rename embedded SP kubeconfig and namespace env vars#32jenniferubah wants to merge 3 commits into
Conversation
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
PR Summary by QodoRename embedded SP kubeconfig and namespace environment variables
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR |
| }) | ||
|
|
||
| It("uses agent kubeconfig when SP_KUBECONFIG is unset", func() { | ||
| It("uses SP_DEFAULT_KUBECONFIG when SP_KUBECONFIG is unset", func() { |
There was a problem hiding this comment.
In production the path is SP_DEFAULT_KUBECONFIG → config.Load → FromAgent → shared.Apply when SP_KUBECONFIG is unset.
This test skips that chain and passes Kubeconfig straight into shared.Agent{...}.
it never reads SP_DEFAULT_KUBECONFIG.
So the old name (“uses agent kubeconfig…”) matched what the test does.
After the rename only the title changed. I don't see a value in this change
There was a problem hiding this comment.
Updated it to kubeconfig from shared.Agent to be more explicit - 94e1ba5
| type SPConfig struct { | ||
| // DefaultKubeconfig is the kubeconfig path shared by all embedded SPs (SP_DEFAULT_KUBECONFIG). | ||
| // When empty, SPs use in-cluster configuration unless overridden per SP via SP_KUBECONFIG. | ||
| DefaultKubeconfig string `env:"SP_DEFAULT_KUBECONFIG"` |
There was a problem hiding this comment.
SP_DEFAULT_KUBECONFIG moved out of AgentConfig, but internal/config/config_test.go has no case for it
| type Config struct { | ||
| shared.Config | ||
| Namespace string `env:"KUBERNETES_NAMESPACE" envDefault:"default"` | ||
| Namespace string `env:"SP_VM_NAMESPACE" envDefault:"default"` |
There was a problem hiding this comment.
Same small gap as storage. One test for SP_VM_NAMESPACE would mirror the container coverage and guard the KUBERNETES_NAMESPACE rename.
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
gabriel-farache
left a comment
There was a problem hiding this comment.
I am just wondering is the new unit test for config are really needed and if those use cases/behaviours are not already tested by IT (or if they should be tested by IT). Especially as only the new SP_* var are tested
Some of the new tests in the acm and container config were redundant and already covered in the shared tests. While the kubevirtvm and storage config tests are of low value and not really needed. I could remove them |
96f1bf4 to
20b68ab
Compare
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
20b68ab to
cadb6e2
Compare
Summary
Assisted-By: Cursor AI