Skip to content

Commit dcd4dcd

Browse files
committed
Update: comments, searching for secrets in lists
1 parent 07e3c46 commit dcd4dcd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/e2e/common/secrets.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
159159
framework.ExpectNoError(err, "failed to create secret")
160160

161161
ginkgo.By("listing secrets in all namespaces to ensure that there are more than zero")
162-
// list all secrets in all namespaces
162+
// list all secrets in all namespaces to ensure endpoint coverage
163163
secretsList, err := f.ClientSet.CoreV1().Secrets("").List(metav1.ListOptions{
164164
LabelSelector: "testsecret-constant=true",
165165
})
@@ -169,9 +169,10 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
169169
foundCreatedSecret := false
170170
var secretCreatedName string
171171
for _, val := range secretsList.Items {
172-
if val.ObjectMeta.Name == secretTestName && string(val.Data["key"]) == "value" {
172+
if val.ObjectMeta.Name == secretTestName && val.ObjectMeta.Namespace == f.Namespace.Name {
173173
foundCreatedSecret = true
174174
secretCreatedName = val.ObjectMeta.Name
175+
break
175176
}
176177
}
177178
framework.ExpectEqual(foundCreatedSecret, true, "unable to find secret by its value")
@@ -214,6 +215,7 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
214215
for _, val := range secretsList.Items {
215216
if val.ObjectMeta.Name == secretTestName && val.ObjectMeta.Namespace == f.Namespace.Name {
216217
foundCreatedSecret = true
218+
break
217219
}
218220
}
219221
framework.ExpectEqual(foundCreatedSecret, false, "secret was not deleted successfully")

0 commit comments

Comments
 (0)