fix namespaced state errors
@@ -1076,8 +1076,8 @@ func (k *Kuberhealthy) getCurrentStatusForNamespaces(namespaces []string) health
// if there is are requested namespaces, then filter out checks from namespaces not matching those requested
states := k.stateReflector.CurrentStatus()
statesForNamespaces := states
- states.Errors = []string{}
- states.OK = true
+ statesForNamespaces.Errors = []string{}
+ statesForNamespaces.OK = true
statesForNamespaces.CheckDetails = make(map[string]health.CheckDetails)
if len(namespaces) != 0 {
for checkName, checkState := range states.CheckDetails {
