k8s-controller-core-resource icon indicating copy to clipboard operation
k8s-controller-core-resource copied to clipboard

ObjectCreated and ObjectDeleted work, ObjectUpdated doesnt.

Open cgetzen opened this issue 6 years ago • 0 comments

This function is never called from the controller.

	// if the item doesn't exist then it was deleted and we need to fire off the handler's
	// ObjectDeleted method. but if the object does exist that indicates that the object
	// was created (or updated) so run the ObjectCreated method
	//
	// after both instances, we want to forget the key from the queue, as this indicates
	// a code path of successful queue key processing
	if !exists {
		c.logger.Infof("Controller.processNextItem: object deleted detected: %s", keyRaw)
		c.handler.ObjectDeleted(item)
		c.queue.Forget(key)
	} else {
		c.logger.Infof("Controller.processNextItem: object created detected: %s", keyRaw)
		c.handler.ObjectCreated(item)
		c.queue.Forget(key)
	}

cgetzen avatar Apr 03 '19 17:04 cgetzen