Skip to content

Commit b260f4c

Browse files
committed
Remove Prints and change to logs
1 parent ea67681 commit b260f4c

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

pkg/authz/filter.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,18 @@ func filterWatch(ctx context.Context, client v1.PermissionsServiceClient, watchC
177177
OptionalObjectTypes: []string{filter.Rel.ResourceType},
178178
})
179179
if err != nil {
180-
fmt.Println(err)
180+
klog.V(3).ErrorS(err, "error on filterWatch")
181181
return
182182
}
183+
183184
for {
184185
resp, err := watchResource.Recv()
185186
if errors.Is(err, io.EOF) {
186187
break
187188
}
188189

189190
if err != nil {
190-
fmt.Println(err)
191+
klog.V(3).ErrorS(err, "error on watchResource.Recv")
191192
return
192193
}
193194

@@ -211,7 +212,7 @@ func filterWatch(ctx context.Context, client v1.PermissionsServiceClient, watchC
211212
},
212213
})
213214
if err != nil {
214-
fmt.Println(err)
215+
klog.V(3).ErrorS(err, "error on CheckPermission")
215216
return
216217
}
217218

@@ -225,32 +226,30 @@ func filterWatch(ctx context.Context, client v1.PermissionsServiceClient, watchC
225226
fmt.Println(err)
226227
return
227228
}
228-
fmt.Println(data)
229-
fmt.Println("RESPONSE", string(byteIn))
230229

231230
name, err := filter.Name.Search(data)
232231
if err != nil {
233-
fmt.Println(err)
232+
klog.V(3).ErrorS(err, "error on filter.Name.Search")
234233
return
235234
}
236-
fmt.Println("GOT NAME", name)
235+
237236
if name == nil || len(name.(string)) == 0 {
238237
return
239238
}
239+
240240
namespace, err := filter.Namespace.Search(data)
241241
if err != nil {
242-
fmt.Println(err)
242+
klog.V(3).ErrorS(err, "error on filter.Namespace.Search")
243243
return
244244
}
245-
fmt.Println("GOT NAMESPACE", namespace)
246245
if namespace == nil {
247246
namespace = ""
248247
}
248+
249249
nn := types.NamespacedName{Name: name.(string), Namespace: namespace.(string)}
250250

251251
// TODO: this should really be over a single channel to prevent
252252
// races on add/remove
253-
fmt.Println(u.Relationship.Resource.ObjectId, cr.Permissionship)
254253
if cr.Permissionship == v1.CheckPermissionResponse_PERMISSIONSHIP_HAS_PERMISSION {
255254
authzData.allowedNNC <- nn
256255
} else {

0 commit comments

Comments
 (0)