Skip to content

Commit

Permalink
fix(k8sprocessor): fix metadata dependencies
Browse files Browse the repository at this point in the history
Fixes #512
  • Loading branch information
andrzej-stencel committed Mar 31, 2022
1 parent 28f4d4b commit 8175226
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/processor/k8sprocessor/kube/owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ func newOwnerProvider(
ownerCache.deleteObject)
}

// Only enable ReplicaSet informer when ReplicaSet extraction rule is enabled
if extractionRules.ReplicaSetName {
// Only enable ReplicaSet informer when ReplicaSet or DeploymentName extraction rule is enabled
if extractionRules.ReplicaSetName || extractionRules.DeploymentName {
logger.Debug("adding informer for ReplicaSet", zap.String("api_version", "apps/v1"))
ownerCache.addOwnerInformer("ReplicaSet",
factory.Apps().V1().ReplicaSets().Informer(),
Expand Down Expand Up @@ -163,8 +163,8 @@ func newOwnerProvider(
ownerCache.deleteEndpoint)
}

// Only enable Job informer when Job extraction rule is enabled
if extractionRules.JobName {
// Only enable Job informer when Job or CronJob extraction rule is enabled
if extractionRules.JobName || extractionRules.CronJobName {
logger.Debug("adding informer for Job", zap.String("api_version", "batch/v1"))
ownerCache.addOwnerInformer("Job",
factory.Batch().V1().Jobs().Informer(),
Expand Down

0 comments on commit 8175226

Please sign in to comment.