Skip to content

Commit

Permalink
fix(generator): fix status annot on unused ns
Browse files Browse the repository at this point in the history
   - resolves #222
   - check for config status annotation before setting `IsKnowFromBefore` on each `nsconfig`

Signed-off-by: Anton Ouzounov <aouzounov@vmware.com>
  • Loading branch information
Anton Ouzounov committed Jun 28, 2021
1 parent a42d24c commit 8c2a09c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config-reloader/datasource/kube_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,18 @@ func (d *kubeInformerConnection) GetNamespaces() ([]*NamespaceConfig, error) {
}
minis := convertPodToMinis(podList)

// If the AnnotStatus is not present on ns then set IsKnownFromBefore to false
annotStatusExists := false
if _, ok := nsobj.Annotations[d.cfg.AnnotStatus]; ok {
annotStatusExists = true
}

// Create a new NamespaceConfig from the data we've processed up to now
nsconfigs = append(nsconfigs, &NamespaceConfig{
Name: ns,
FluentdConfig: configdata,
PreviousConfigHash: d.hashes[ns],
IsKnownFromBefore: true,
IsKnownFromBefore: annotStatusExists,
Labels: nsobj.Labels,
MiniContainers: minis,
})
Expand Down

0 comments on commit 8c2a09c

Please sign in to comment.