Skip to content

Commit

Permalink
Adapt to changes in labels.NewRequirement
Browse files Browse the repository at this point in the history
  • Loading branch information
timebertt committed Jun 16, 2021
1 parent 025e822 commit eb8f950
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/utils/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1388,15 +1388,14 @@ var _ = Describe("kubernetes", func() {
MatchExpressions: []metav1.LabelSelectorRequirement{{Key: "foo", Operator: metav1.LabelSelectorOpIn, Values: []string{}}},
}},
}
rsError := fmt.Errorf("failed to convert the pod selector from ReplicaSet %s/%s: for 'in', 'notin' operators, values set can't be empty", rs.Namespace, rs.Name)

c.EXPECT().List(ctx, gomock.AssignableToTypeOf(&appsv1.ReplicaSetList{}), rsListOptions...).DoAndReturn(func(_ context.Context, list *appsv1.ReplicaSetList, _ ...client.ListOption) error {
*list = appsv1.ReplicaSetList{Items: []appsv1.ReplicaSet{*rs}}
return nil
})

pod, err := NewestPodForDeployment(ctx, c, deployment)
Expect(err).To(MatchError(rsError))
Expect(err).To(MatchError(ContainSubstring("for 'in', 'notin' operators, values set can't be empty")))
Expect(pod).To(BeNil())
})

Expand Down

0 comments on commit eb8f950

Please sign in to comment.