@@ -159,7 +159,7 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
159
159
framework .ExpectNoError (err , "failed to create secret" )
160
160
161
161
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
163
163
secretsList , err := f .ClientSet .CoreV1 ().Secrets ("" ).List (metav1.ListOptions {
164
164
LabelSelector : "testsecret-constant=true" ,
165
165
})
@@ -169,9 +169,10 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
169
169
foundCreatedSecret := false
170
170
var secretCreatedName string
171
171
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 {
173
173
foundCreatedSecret = true
174
174
secretCreatedName = val .ObjectMeta .Name
175
+ break
175
176
}
176
177
}
177
178
framework .ExpectEqual (foundCreatedSecret , true , "unable to find secret by its value" )
@@ -214,6 +215,7 @@ var _ = ginkgo.Describe("[sig-api-machinery] Secrets", func() {
214
215
for _ , val := range secretsList .Items {
215
216
if val .ObjectMeta .Name == secretTestName && val .ObjectMeta .Namespace == f .Namespace .Name {
216
217
foundCreatedSecret = true
218
+ break
217
219
}
218
220
}
219
221
framework .ExpectEqual (foundCreatedSecret , false , "secret was not deleted successfully" )
0 commit comments