Skip to content

Commit 5a51c30

Browse files
authored
ignore Pods not owned by Replicaset (#377)
1 parent 7855e39 commit 5a51c30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/pod/pod.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ func (s *Service) GetDeploymentForPod(pod *v1.Pod) (string, error) {
184184
return "", nil
185185
}
186186

187+
if ownerRefrence.Kind != "ReplicaSet" {
188+
// Tortoise only supports Deployment for now, and ReplicaSet is the only controller that can own a pod in this case.
189+
return "", nil
190+
}
191+
187192
k := &controllerfetcher.ControllerKeyWithAPIVersion{
188193
ControllerKey: controllerfetcher.ControllerKey{
189194
Namespace: pod.Namespace,

0 commit comments

Comments
 (0)