Skip to content

Commit

Permalink
Limit list to namespace objects
Browse files Browse the repository at this point in the history
Similar issue to qjob, namespace was passed but not used.

[#165900520](https://www.pivotaltracker.com/story/show/165900520)
  • Loading branch information
Mario Manno authored and Mario Manno committed May 14, 2020
1 parent d09bff9 commit 02fae54
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/kube/controllers/quarkslink/pod_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (m *PodMutator) Handle(ctx context.Context, req admission.Request) admissio
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
m.log.Debugf("Pod mutator handler ran for pod '%s/%s' (%s)", pod.Namespace, pod.Name, req.Namespace)

updatedPod := pod.DeepCopy()
if validEntanglement(pod.GetAnnotations()) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kube/controllers/quarksstatefulset/pod_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (m *PodMutator) Handle(ctx context.Context, req admission.Request) admissio
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
m.log.Debugf("Pod mutator handler ran for pod '%s/%s'", pod.Namespace, pod.Name)
m.log.Debugf("Pod mutator handler ran for pod '%s/%s' (%s)", pod.Namespace, pod.Name, req.Namespace)

updatedPod := pod.DeepCopy()
if isQuarksStatefulSet(pod.GetLabels()) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/kube/util/reference/reconciles.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func SkipReconciles(ctx context.Context, client crc.Client, object apis.Object)

func listBOSHDeployments(ctx context.Context, client crc.Client, namespace string) (*bdv1.BOSHDeploymentList, error) {
result := &bdv1.BOSHDeploymentList{}
err := client.List(ctx, result)
err := client.List(ctx, result, crc.InNamespace(namespace))
if err != nil {
return nil, errors.Wrap(err, "failed to list BOSHDeployments")
}
Expand All @@ -185,7 +185,7 @@ func listBOSHDeployments(ctx context.Context, client crc.Client, namespace strin

func listQuarksStatefulSets(ctx context.Context, client crc.Client, namespace string) (*qstsv1a1.QuarksStatefulSetList, error) {
result := &qstsv1a1.QuarksStatefulSetList{}
err := client.List(ctx, result)
err := client.List(ctx, result, crc.InNamespace(namespace))
if err != nil {
return nil, errors.Wrap(err, "failed to list QuarksStatefulSets")
}
Expand Down

0 comments on commit 02fae54

Please sign in to comment.