Closed surajssd closed 3 years ago
This is what https://github.com/kinvolk/lokomotive/pull/971 addresses.
Also related: #597.
As this is already addressed PR of @invidian. Would you mind if this is assigned to you?
Okay, this again turns out to be never-ending story to do right:
LoadConfig
, Meta
, Apply
, Destroy
, Initialize
and PostApplyHook
functions which can be misused when called on bad configuration. LoadConfig
should be completely removed from it and Meta
, Apply
, Destroy
, Initialize
and PostApplyHook
methods should be gated by a verifying function. Configuration struct should not implement Component/Platform interface. Validated configuration struct should.Edit:
- Right now we call function returning default configuration in each of the platform/component packages itself. The plan is to shift the calling to central platform/components packages, so function returning default configuration should become exporter.
Platforms already have NewConfig()
function exported, only aks
platform didn't, so I think this can be used for now.
However, the problem still applies for components. I guess they could follow the same convention as platforms for now.
Created PR #1147 to definitely address this.
Consider following test code:
Whose output looks like this:
Notice that in second test case we should see
https://prometheus.mydomain.net
but the old result persists for some reason. My first guess is that this is due to use of globals.I think
component.LoadConfig
andcomponent.RenderManifests
don't do the right thing. Or we should flush out old values whencomponents.Get
is called.