From 1272377f6e8cb031b8e77bf5906f3a5c42c017a2 Mon Sep 17 00:00:00 2001 From: Michael Bridgen <mikeb@squaremobius.net> Date: Thu, 9 May 2019 17:35:19 +0100 Subject: [PATCH] Log warning re not applying resource by namespace We log when a resource in a manifest is dropped from sync because it's marked as ignored; would also help troubleshooting if we log when a resource is dropped because it's not in the allowed namespaces. --- cluster/kubernetes/sync.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cluster/kubernetes/sync.go b/cluster/kubernetes/sync.go index e6f7f67a7..1bf5bf3ce 100644 --- a/cluster/kubernetes/sync.go +++ b/cluster/kubernetes/sync.go @@ -64,10 +64,11 @@ func (c *Cluster) Sync(syncSet cluster.SyncSet) error { var errs cluster.SyncError for _, res := range syncSet.Resources { resID := res.ResourceID() + id := resID.String() if !c.IsAllowedResource(resID) { + logger.Log("warning", "not applying resource; excluded by namespace constraints", "resource", id, "source", res.Source()) continue } - id := resID.String() // make a record of the checksum, whether we stage it to // be applied or not, so that we don't delete it later. csum := sha1.Sum(res.Bytes())