Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2034 from weaveworks/log-ignored-by-sync
Browse files Browse the repository at this point in the history
Log warning re not applying resource by namespace
  • Loading branch information
squaremo authored May 13, 2019
2 parents 1bd32aa + c3f0fe2 commit eb9aedd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cluster/kubernetes/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ func (c *Cluster) Sync(syncSet cluster.SyncSet) error {

cs := makeChangeSet()
var errs cluster.SyncError
var excluded []string
for _, res := range syncSet.Resources {
resID := res.ResourceID()
id := resID.String()
if !c.IsAllowedResource(resID) {
excluded = append(excluded, id)
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())
Expand All @@ -93,6 +95,10 @@ func (c *Cluster) Sync(syncSet cluster.SyncSet) error {
}
}

if len(excluded) > 0 {
logger.Log("warning", "not applying resources; excluded by namespace constraints", "resources", strings.Join(excluded, ","))
}

c.mu.Lock()
defer c.mu.Unlock()
c.muSyncErrors.RLock()
Expand Down

0 comments on commit eb9aedd

Please sign in to comment.