Skip to content

Commit 36eb2d6

Browse files
committed
restored logs that are ununused by current npm (v2)
1 parent d603453 commit 36eb2d6

File tree

10 files changed

+135
-0
lines changed

10 files changed

+135
-0
lines changed

npm/pkg/controlplane/controllers/v1/nameSpaceController.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ func (nsc *NamespaceController) needSync(obj interface{}, event string) (string,
9393
return key, needSync
9494
}
9595

96+
klog.Infof("[NAMESPACE %s EVENT] for namespace [%s]", event, key)
97+
9698
needSync = true
9799
return key, needSync
98100
}
@@ -159,10 +161,14 @@ func (nsc *NamespaceController) Run(stopCh <-chan struct{}) {
159161
defer utilruntime.HandleCrash()
160162
defer nsc.workqueue.ShutDown()
161163

164+
klog.Info("Starting Namespace controller\n")
165+
klog.Info("Starting workers")
162166
// Launch workers to process namespace resources
163167
go wait.Until(nsc.runWorker, time.Second, stopCh)
164168

169+
klog.Info("Started workers")
165170
<-stopCh
171+
klog.Info("Shutting down workers")
166172
}
167173

168174
func (nsc *NamespaceController) runWorker() {
@@ -200,6 +206,7 @@ func (nsc *NamespaceController) processNextWorkItem() bool {
200206
// Finally, if no error occurs we Forget this item so it does not
201207
// get queued again until another change happens.
202208
nsc.workqueue.Forget(obj)
209+
klog.Infof("Successfully synced '%s'", key)
203210
return nil
204211
}(obj)
205212
if err != nil {
@@ -282,6 +289,7 @@ func (nsc *NamespaceController) syncNameSpace(key string) error {
282289
func (nsc *NamespaceController) syncAddNameSpace(nsObj *corev1.Namespace) error {
283290
var err error
284291
corev1NsName, corev1NsLabels := util.GetNSNameWithPrefix(nsObj.ObjectMeta.Name), nsObj.ObjectMeta.Labels
292+
klog.Infof("NAMESPACE CREATING: [%s/%v]", corev1NsName, corev1NsLabels)
285293

286294
// Create ipset for the namespace.
287295
if err = nsc.ipsMgr.CreateSet(corev1NsName, []string{util.IpsetNetHashFlag}); err != nil {
@@ -300,12 +308,14 @@ func (nsc *NamespaceController) syncAddNameSpace(nsObj *corev1.Namespace) error
300308
// Add the namespace to its label's ipset list.
301309
for nsLabelKey, nsLabelVal := range corev1NsLabels {
302310
labelIpsetName := util.GetNSNameWithPrefix(nsLabelKey)
311+
klog.Infof("Adding namespace %s to ipset list %s", corev1NsName, labelIpsetName)
303312
if err = nsc.ipsMgr.AddToList(labelIpsetName, corev1NsName); err != nil {
304313
metrics.SendErrorLogAndMetric(util.NSID, "[AddNamespace] Error: failed to add namespace %s to ipset list %s with err: %v", corev1NsName, labelIpsetName, err)
305314
return err
306315
}
307316

308317
labelIpsetName = util.GetNSNameWithPrefix(util.GetIpSetFromLabelKV(nsLabelKey, nsLabelVal))
318+
klog.Infof("Adding namespace %s to ipset list %s", corev1NsName, labelIpsetName)
309319
if err = nsc.ipsMgr.AddToList(labelIpsetName, corev1NsName); err != nil {
310320
metrics.SendErrorLogAndMetric(util.NSID, "[AddNamespace] Error: failed to add namespace %s to ipset list %s with err: %v", corev1NsName, labelIpsetName, err)
311321
return err
@@ -322,6 +332,7 @@ func (nsc *NamespaceController) syncAddNameSpace(nsObj *corev1.Namespace) error
322332
func (nsc *NamespaceController) syncUpdateNameSpace(newNsObj *corev1.Namespace) (metrics.OperationKind, error) {
323333
var err error
324334
newNsName, newNsLabel := util.GetNSNameWithPrefix(newNsObj.ObjectMeta.Name), newNsObj.ObjectMeta.Labels
335+
klog.Infof("NAMESPACE UPDATING:\n namespace: [%s/%v]", newNsName, newNsLabel)
325336

326337
// If previous syncAddNameSpace failed for some reasons
327338
// before caching npm namespace object or syncUpdateNameSpace is called due to namespace creation event,
@@ -343,6 +354,7 @@ func (nsc *NamespaceController) syncUpdateNameSpace(newNsObj *corev1.Namespace)
343354
// Delete the namespace from its label's ipset list.
344355
for _, nsLabelVal := range deleteFromIPSets {
345356
labelKey := util.GetNSNameWithPrefix(nsLabelVal)
357+
klog.Infof("Deleting namespace %s from ipset list %s", newNsName, labelKey)
346358
if err = nsc.ipsMgr.DeleteFromList(labelKey, newNsName); err != nil {
347359
metrics.SendErrorLogAndMetric(util.NSID, "[UpdateNamespace] Error: failed to delete namespace %s from ipset list %s with err: %v", newNsName, labelKey, err)
348360
return metrics.UpdateOp, fmt.Errorf("failed to delete namespace %s from ipset list %s with err: %w", newNsName, labelKey, err)
@@ -359,6 +371,7 @@ func (nsc *NamespaceController) syncUpdateNameSpace(newNsObj *corev1.Namespace)
359371
// Add the namespace to its label's ipset list.
360372
for _, nsLabelVal := range addToIPSets {
361373
labelKey := util.GetNSNameWithPrefix(nsLabelVal)
374+
klog.Infof("Adding namespace %s to ipset list %s", newNsName, labelKey)
362375
if err = nsc.ipsMgr.AddToList(labelKey, newNsName); err != nil {
363376
metrics.SendErrorLogAndMetric(util.NSID, "[UpdateNamespace] Error: failed to add namespace %s to ipset list %s with err: %v", newNsName, labelKey, err)
364377
return metrics.UpdateOp, fmt.Errorf("failed to add namespace %s to ipset list %s with err: %w", newNsName, labelKey, err)
@@ -382,21 +395,26 @@ func (nsc *NamespaceController) syncUpdateNameSpace(newNsObj *corev1.Namespace)
382395

383396
// cleanDeletedNamespace handles deleting namespace from ipset.
384397
func (nsc *NamespaceController) cleanDeletedNamespace(cachedNsKey string) error {
398+
klog.Infof("NAMESPACE DELETING: [%s]", cachedNsKey)
385399
cachedNsObj, exists := nsc.npmNamespaceCache.NsMap[cachedNsKey]
386400
if !exists {
387401
return nil
388402
}
389403

404+
klog.Infof("NAMESPACE DELETING cached labels: [%s/%v]", cachedNsKey, cachedNsObj.LabelsMap)
405+
390406
var err error
391407
// Delete the namespace from its label's ipset list.
392408
for nsLabelKey, nsLabelVal := range cachedNsObj.LabelsMap {
393409
labelIpsetName := util.GetNSNameWithPrefix(nsLabelKey)
410+
klog.Infof("Deleting namespace %s from ipset list %s", cachedNsKey, labelIpsetName)
394411
if err = nsc.ipsMgr.DeleteFromList(labelIpsetName, cachedNsKey); err != nil {
395412
metrics.SendErrorLogAndMetric(util.NSID, "[DeleteNamespace] Error: failed to delete namespace %s from ipset list %s with err: %v", cachedNsKey, labelIpsetName, err)
396413
return err
397414
}
398415

399416
labelIpsetName = util.GetNSNameWithPrefix(util.GetIpSetFromLabelKV(nsLabelKey, nsLabelVal))
417+
klog.Infof("Deleting namespace %s from ipset list %s", cachedNsKey, labelIpsetName)
400418
if err = nsc.ipsMgr.DeleteFromList(labelIpsetName, cachedNsKey); err != nil {
401419
metrics.SendErrorLogAndMetric(util.NSID, "[DeleteNamespace] Error: failed to delete namespace %s from ipset list %s with err: %v", cachedNsKey, labelIpsetName, err)
402420
return err

npm/pkg/controlplane/controllers/v1/nameSpaceController_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,26 +133,39 @@ func newNameSpace(name, rv string, labels map[string]string) *corev1.Namespace {
133133
}
134134

135135
func addNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace) {
136+
t.Logf("Calling add namespace event")
136137
f.nsController.addNamespace(nsObj)
137138
if f.nsController.workqueue.Len() == 0 {
139+
t.Logf("Add Namespace: worker queue length is 0 ")
138140
return
139141
}
140142
f.nsController.processNextWorkItem()
141143
}
142144

143145
func updateNamespace(t *testing.T, f *nameSpaceFixture, oldNsObj, newNsObj *corev1.Namespace) {
144146
addNamespace(t, f, oldNsObj)
147+
t.Logf("Complete add namespace event")
148+
149+
t.Logf("Updating kubeinformer namespace object")
145150
f.kubeInformer.Core().V1().Namespaces().Informer().GetIndexer().Update(newNsObj)
151+
152+
t.Logf("Calling update namespace event")
146153
f.nsController.updateNamespace(oldNsObj, newNsObj)
147154
if f.nsController.workqueue.Len() == 0 {
155+
t.Logf("Update Namespace: worker queue length is 0 ")
148156
return
149157
}
150158
f.nsController.processNextWorkItem()
151159
}
152160

153161
func deleteNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace, isDeletedFinalStateUnknownObject IsDeletedFinalStateUnknownObject) {
154162
addNamespace(t, f, nsObj)
163+
t.Logf("Complete add namespace event")
164+
165+
t.Logf("Updating kubeinformer namespace object")
155166
f.kubeInformer.Core().V1().Namespaces().Informer().GetIndexer().Delete(nsObj)
167+
168+
t.Logf("Calling delete namespace event")
156169
if isDeletedFinalStateUnknownObject {
157170
tombstone := cache.DeletedFinalStateUnknown{
158171
Key: nsObj.Name,
@@ -164,6 +177,7 @@ func deleteNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace,
164177
}
165178

166179
if f.nsController.workqueue.Len() == 0 {
180+
t.Logf("Delete Namespace: worker queue length is 0 ")
167181
return
168182
}
169183
f.nsController.processNextWorkItem()

npm/pkg/controlplane/controllers/v1/networkPolicyController.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,12 @@ func (c *NetworkPolicyController) Run(stopCh <-chan struct{}) {
177177
defer utilruntime.HandleCrash()
178178
defer c.workqueue.ShutDown()
179179

180+
klog.Infof("Starting Network Policy worker")
180181
go wait.Until(c.runWorker, time.Second, stopCh)
181182

183+
klog.Infof("Started Network Policy worker")
182184
<-stopCh
185+
klog.Info("Shutting down Network Policy workers")
183186
}
184187

185188
func (c *NetworkPolicyController) runWorker() {
@@ -216,6 +219,7 @@ func (c *NetworkPolicyController) processNextWorkItem() bool {
216219
// Finally, if no error occurs we Forget this item so it does not
217220
// get queued again until another change happens.
218221
c.workqueue.Forget(obj)
222+
klog.Infof("Successfully synced '%s'", key)
219223
return nil
220224
}(obj)
221225
if err != nil {
@@ -369,11 +373,13 @@ func (c *NetworkPolicyController) syncAddAndUpdateNetPol(netPolObj *networkingv1
369373

370374
sets, namedPorts, lists, ingressIPCidrs, egressIPCidrs, iptEntries := translatePolicy(netPolObj)
371375
for _, set := range sets {
376+
klog.Infof("Creating set: %v, hashedSet: %v", set, util.GetHashedName(set))
372377
if err = c.ipsMgr.CreateSetNoLock(set, []string{util.IpsetNetHashFlag}); err != nil {
373378
return operationKind, fmt.Errorf("[syncAddAndUpdateNetPol] Error: creating ipset %s with err: %w", set, err)
374379
}
375380
}
376381
for _, set := range namedPorts {
382+
klog.Infof("Creating set: %v, hashedSet: %v", set, util.GetHashedName(set))
377383
if err = c.ipsMgr.CreateSetNoLock(set, []string{util.IpsetIPPortHashFlag}); err != nil {
378384
return operationKind, fmt.Errorf("[syncAddAndUpdateNetPol] Error: creating ipset named port %s with err: %w", set, err)
379385
}
@@ -484,6 +490,7 @@ func (c *NetworkPolicyController) createCidrsRule(direction, policyName, ns stri
484490
continue
485491
}
486492
setName := policyName + "-in-ns-" + ns + "-" + strconv.Itoa(i) + direction
493+
klog.Infof("Creating set: %v, hashedSet: %v", setName, util.GetHashedName(setName))
487494
if err := c.ipsMgr.CreateSetNoLock(setName, spec); err != nil {
488495
return fmt.Errorf("[createCidrsRule] Error: creating ipset %s with err: %w", ipCidrSet, err)
489496
}
@@ -514,6 +521,7 @@ func (c *NetworkPolicyController) removeCidrsRule(direction, policyName, ns stri
514521
continue
515522
}
516523
setName := policyName + "-in-ns-" + ns + "-" + strconv.Itoa(i) + direction
524+
klog.Infof("Delete set: %v, hashedSet: %v", setName, util.GetHashedName(setName))
517525
if err := c.ipsMgr.DeleteSet(setName); err != nil {
518526
return fmt.Errorf("[removeCidrsRule] deleting ipset %s with err: %w", ipCidrSet, err)
519527
}

npm/pkg/controlplane/controllers/v1/podController.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ func (c *PodController) needSync(eventType string, obj interface{}) (string, boo
8989
return key, needSync
9090
}
9191

92+
klog.Infof("[POD %s EVENT] for %s in %s", eventType, podObj.Name, podObj.Namespace)
93+
9294
if !hasValidPodIP(podObj) {
9395
return key, needSync
9496
}
9597

9698
if isHostNetworkPod(podObj) {
99+
klog.Infof("[POD %s EVENT] HostNetwork POD IGNORED: [%s/%s/%s/%+v%s]",
100+
eventType, podObj.GetObjectMeta().GetUID(), podObj.Namespace, podObj.Name, podObj.Labels, podObj.Status.PodIP)
97101
return key, needSync
98102
}
99103

@@ -128,6 +132,7 @@ func (c *PodController) addPod(obj interface{}) {
128132
func (c *PodController) updatePod(old, newp interface{}) {
129133
key, needSync := c.needSync("UPDATE", newp)
130134
if !needSync {
135+
klog.Infof("[POD UPDATE EVENT] No need to sync this pod")
131136
return
132137
}
133138

@@ -138,6 +143,7 @@ func (c *PodController) updatePod(old, newp interface{}) {
138143
if oldPod.ResourceVersion == newPod.ResourceVersion {
139144
// Periodic resync will send update events for all known pods.
140145
// Two different versions of the same pods will always have different RVs.
146+
klog.Infof("[POD UPDATE EVENT] Two pods have the same RVs")
141147
return
142148
}
143149
}
@@ -164,7 +170,9 @@ func (c *PodController) deletePod(obj interface{}) {
164170
}
165171
}
166172

173+
klog.Infof("[POD DELETE EVENT] for %s in %s", podObj.Name, podObj.Namespace)
167174
if isHostNetworkPod(podObj) {
175+
klog.Infof("[POD DELETE EVENT] HostNetwork POD IGNORED: [%s/%s/%s/%+v%s]", podObj.UID, podObj.Namespace, podObj.Name, podObj.Labels, podObj.Status.PodIP)
168176
return
169177
}
170178

@@ -184,9 +192,12 @@ func (c *PodController) Run(stopCh <-chan struct{}) {
184192
defer utilruntime.HandleCrash()
185193
defer c.workqueue.ShutDown()
186194

195+
klog.Infof("Starting Pod worker")
187196
go wait.Until(c.runWorker, time.Second, stopCh)
188197

198+
klog.Info("Started Pod workers")
189199
<-stopCh
200+
klog.Info("Shutting down Pod workers")
190201
}
191202

192203
func (c *PodController) runWorker() {
@@ -224,6 +235,7 @@ func (c *PodController) processNextWorkItem() bool {
224235
// Finally, if no error occurs we Forget this item so it does not
225236
// get queued again until another change happens.
226237
c.workqueue.Forget(obj)
238+
klog.Infof("Successfully synced '%s'", key)
227239
return nil
228240
}(obj)
229241
if err != nil {
@@ -313,11 +325,14 @@ func (c *PodController) syncPod(key string) error {
313325
}
314326

315327
func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
328+
klog.Infof("POD CREATING: [%s%s/%s/%s%+v%s]", string(podObj.GetUID()), podObj.Namespace,
329+
podObj.Name, podObj.Spec.NodeName, podObj.Labels, podObj.Status.PodIP)
316330

317331
var err error
318332
podNs := util.GetNSNameWithPrefix(podObj.Namespace)
319333
podKey, _ := cache.MetaNamespaceKeyFunc(podObj)
320334
// Add the pod ip information into namespace's ipset.
335+
klog.Infof("Adding pod %s to ipset %s", podObj.Status.PodIP, podNs)
321336
if err = c.ipsMgr.AddToSet(podNs, podObj.Status.PodIP, util.IpsetNetHashFlag, podKey); err != nil {
322337
return fmt.Errorf("[syncAddedPod] Error: failed to add pod to namespace ipset with err: %w", err)
323338
}
@@ -328,18 +343,21 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
328343

329344
// Get lists of podLabelKey and podLabelKey + podLavelValue ,and then start adding them to ipsets.
330345
for labelKey, labelVal := range podObj.Labels {
346+
klog.Infof("Adding pod %s to ipset %s", npmPodObj.PodIP, labelKey)
331347
if err = c.ipsMgr.AddToSet(labelKey, npmPodObj.PodIP, util.IpsetNetHashFlag, podKey); err != nil {
332348
return fmt.Errorf("[syncAddedPod] Error: failed to add pod to label ipset with err: %w", err)
333349
}
334350

335351
podIPSetName := util.GetIpSetFromLabelKV(labelKey, labelVal)
352+
klog.Infof("Adding pod %s to ipset %s", npmPodObj.PodIP, podIPSetName)
336353
if err = c.ipsMgr.AddToSet(podIPSetName, npmPodObj.PodIP, util.IpsetNetHashFlag, podKey); err != nil {
337354
return fmt.Errorf("[syncAddedPod] Error: failed to add pod to label ipset with err: %w", err)
338355
}
339356
npmPodObj.AppendLabels(map[string]string{labelKey: labelVal}, common.AppendToExistingLabels)
340357
}
341358

342359
// Add pod's named ports from its ipset.
360+
klog.Infof("Adding named port ipsets")
343361
containerPorts := common.GetContainerPortList(podObj)
344362
if err = c.manageNamedPortIpsets(containerPorts, podKey, npmPodObj.PodIP, addNamedPort); err != nil {
345363
return fmt.Errorf("[syncAddedPod] Error: failed to add pod to named port ipset with err: %w", err)
@@ -378,6 +396,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
378396

379397
podKey, _ := cache.MetaNamespaceKeyFunc(newPodObj)
380398
cachedNpmPod, exists := c.podMap[podKey]
399+
klog.Infof("[syncAddAndUpdatePod] updating Pod with key %s", podKey)
381400
// No cached npmPod exists. start adding the pod in a cache
382401
if !exists {
383402
if err = c.syncAddedPod(newPodObj); err != nil {
@@ -396,10 +415,15 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
396415
// NPM should clean up existing references of cached pod obj and its IP.
397416
// then, re-add new pod obj.
398417
if cachedNpmPod.PodIP != newPodObj.Status.PodIP {
418+
klog.Infof("Pod (Namespace:%s, Name:%s, newUid:%s), has cachedPodIp:%s which is different from PodIp:%s",
419+
newPodObj.Namespace, newPodObj.Name, string(newPodObj.UID), cachedNpmPod.PodIP, newPodObj.Status.PodIP)
420+
421+
klog.Infof("Deleting cached Pod with key:%s first due to IP Mistmatch", podKey)
399422
if err = c.cleanUpDeletedPod(podKey); err != nil {
400423
return metrics.UpdateOp, err
401424
}
402425

426+
klog.Infof("Adding back Pod with key:%s after IP Mistmatch", podKey)
403427
if err = c.syncAddedPod(newPodObj); err != nil {
404428
return metrics.UpdateOp, err
405429
}
@@ -414,6 +438,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
414438

415439
// Delete the pod from its label's ipset.
416440
for _, podIPSetName := range deleteFromIPSets {
441+
klog.Infof("Deleting pod %s from ipset %s", cachedNpmPod.PodIP, podIPSetName)
417442
if err = c.ipsMgr.DeleteFromSet(podIPSetName, cachedNpmPod.PodIP, podKey); err != nil {
418443
return metrics.UpdateOp, fmt.Errorf("[syncAddAndUpdatePod] Error: failed to delete pod from label ipset with err: %w", err)
419444
}
@@ -427,6 +452,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
427452

428453
// Add the pod to its label's ipset.
429454
for _, addIPSetName := range addToIPSets {
455+
klog.Infof("Adding pod %s to ipset %s", newPodObj.Status.PodIP, addIPSetName)
430456
if err = c.ipsMgr.AddToSet(addIPSetName, newPodObj.Status.PodIP, util.IpsetNetHashFlag, podKey); err != nil {
431457
return metrics.UpdateOp, fmt.Errorf("[syncAddAndUpdatePod] Error: failed to add pod to label ipset with err: %w", err)
432458
}
@@ -469,6 +495,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
469495

470496
// cleanUpDeletedPod cleans up all ipset associated with this pod
471497
func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
498+
klog.Infof("[cleanUpDeletedPod] deleting Pod with key %s", cachedNpmPodKey)
472499
// If cached npmPod does not exist, return nil
473500
cachedNpmPod, exist := c.podMap[cachedNpmPodKey]
474501
if !exist {
@@ -484,11 +511,13 @@ func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
484511

485512
// Get lists of podLabelKey and podLabelKey + podLavelValue ,and then start deleting them from ipsets
486513
for labelKey, labelVal := range cachedNpmPod.Labels {
514+
klog.Infof("Deleting pod %s from ipset %s", cachedNpmPod.PodIP, labelKey)
487515
if err = c.ipsMgr.DeleteFromSet(labelKey, cachedNpmPod.PodIP, cachedNpmPodKey); err != nil {
488516
return fmt.Errorf("[cleanUpDeletedPod] Error: failed to delete pod from label ipset with err: %w", err)
489517
}
490518

491519
podIPSetName := util.GetIpSetFromLabelKV(labelKey, labelVal)
520+
klog.Infof("Deleting pod %s from ipset %s", cachedNpmPod.PodIP, podIPSetName)
492521
if err = c.ipsMgr.DeleteFromSet(podIPSetName, cachedNpmPod.PodIP, cachedNpmPodKey); err != nil {
493522
return fmt.Errorf("[cleanUpDeletedPod] Error: failed to delete pod from label ipset with err: %w", err)
494523
}
@@ -509,6 +538,7 @@ func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
509538
func (c *PodController) manageNamedPortIpsets(portList []corev1.ContainerPort, podKey string,
510539
podIP string, namedPortOperation NamedPortOperation) error {
511540
for _, port := range portList {
541+
klog.Infof("port is %+v", port)
512542
if port.Name == "" {
513543
continue
514544
}

npm/pkg/controlplane/controllers/v1/podController_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ func addPod(t *testing.T, f *podFixture, podObj *corev1.Pod) {
136136

137137
func deletePod(t *testing.T, f *podFixture, podObj *corev1.Pod, isDeletedFinalStateUnknownObject IsDeletedFinalStateUnknownObject) {
138138
addPod(t, f, podObj)
139+
t.Logf("Complete add pod event")
139140

140141
// simulate pod delete event and delete pod object from sharedInformer cache
141142
f.kubeInformer.Core().V1().Pods().Informer().GetIndexer().Delete(podObj)
@@ -162,6 +163,7 @@ func deletePod(t *testing.T, f *podFixture, podObj *corev1.Pod, isDeletedFinalSt
162163
// Need to make more cases - interestings..
163164
func updatePod(t *testing.T, f *podFixture, oldPodObj *corev1.Pod, newPodObj *corev1.Pod) {
164165
addPod(t, f, oldPodObj)
166+
t.Logf("Complete add pod event")
165167

166168
// simulate pod update event and update the pod to shared informer's cache
167169
f.kubeInformer.Core().V1().Pods().Informer().GetIndexer().Update(newPodObj)

0 commit comments

Comments
 (0)