kubernetes/pkg/controller
Jean-Francois Remy f1717baaaa Fix nodes volumesAttached status not updated
The UpdateNodeStatuses code stops too early in case there is
an error when calling updateNodeStatus. It will return immediately
which means any remaining node won't have its update status put back
to true.

Looking at the call sites for UpdateNodeStatuses, it appears this is
not the only issue. If the lister call fails with anything but a Not Found
error, it's silently ignored which is wrong in the detach path.
Also the reconciler detach path calls UpdateNodeStatuses but the real intent
is to only update the node currently processed in the loop and not proceed
with the detach call if there is an error updating that specifi node volumesAttached
property. With the current implementation, it will not proceed if there is
an error updating another node (which is not completely bad but not ideal) and
worse it will proceed if there is a lister error on that node which means the
node volumesAttached property won't have been updated.

To fix those issues, introduce the following changes:
- [node_status_updater] introduce UpdateNodeStatusForNode which does what
  UpdateNodeStatuses does but only for the provided node
- [node_status_updater] if the node lister call fails for anything but a Not
  Found error, we will return an error, not ignore it
- [node_status_updater] if the update of a node volumesAttached properties fails
  we continue processing the other nodes
- [actual_state_of_world] introduce GetVolumesToReportAttachedForNode which
  does what GetVolumesToReportAttached but for the node whose name is provided
  it returns a bool which indicates if the node in question needs an update as
  well as the volumesAttached list. It is used by UpdateNodeStatusForNode
- [actual_state_of_world] use write lock in updateNodeStatusUpdateNeeded, we're
  modifying the map content
- [reconciler] use UpdateNodeStatusForNode in the detach loop
2022-02-22 12:20:53 -08:00
..
apis/config OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
bootstrap Merge pull request #105510 from damemi/wire-contexts-bootstrap 2021-11-02 14:27:42 -07:00
certificates fix curent to current 2021-12-17 03:33:22 +09:00
clusterroleaggregation Wire contexts to RBAC controllers 2021-10-07 15:04:49 -04:00
cronjob Optimize cronjob controller status updates 2022-01-27 17:09:47 +08:00
daemon OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
deployment Handle invalid selectors properly 2022-01-14 12:11:02 -05:00
disruption Wire contexts to Disruption controllers 2022-02-04 10:32:04 -05:00
endpoint Remove tolerate-unready-endpoints annotation 2022-02-09 17:17:29 +08:00
endpointslice endpointslice: don't try to update topology cache if node informer error 2022-02-11 12:14:01 +01:00
endpointslicemirroring Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
garbagecollector allocate a unique scheme for each test to fix concurrent usage issue 2022-02-02 15:22:59 +08:00
history Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
job OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
namespace allocate a unique scheme for each test to fix concurrent usage issue 2022-02-02 15:22:59 +08:00
nodeipam OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
nodelifecycle Merge pull request #107293 from dims/jan-1-owners-cleanup 2022-01-13 10:30:30 -08:00
podautoscaler Remove selflink references in different testing-related files 2022-01-14 12:58:05 +01:00
podgc OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
replicaset Merge pull request #102330 from tnqn/replicaset-optimization 2022-02-10 10:15:46 -08:00
replication OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
resourcequota Merge pull request #107293 from dims/jan-1-owners-cleanup 2022-01-13 10:30:30 -08:00
serviceaccount Merge pull request #102636 from charlesxsh/svcacct-ctrl-test 2022-01-05 21:12:27 -08:00
statefulset Merge pull request #107443 from mattcary/no-watch 2022-01-19 01:28:18 -08:00
storageversiongc Wire contexts to Core controllers 2021-11-01 10:29:00 -04:00
testutil Migrate to k8s.io/utils/clock in pkg/controller 2021-09-10 11:42:32 +02:00
ttl Wire contexts to Core controllers 2021-11-01 10:29:00 -04:00
ttlafterfinished OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00
util Fix incorrect parameters in EndpointsEqualBeyondHash 2022-02-15 21:30:28 +08:00
volume Fix nodes volumesAttached status not updated 2022-02-22 12:20:53 -08:00
controller_ref_manager_test.go Merge pull request #101250 from evertrain/master 2021-11-10 09:19:26 -08:00
controller_ref_manager.go Wire contexts to Batch controllers (#105491) 2021-11-10 14:56:46 -08:00
controller_utils_test.go Wire contexts to Batch controllers (#105491) 2021-11-10 14:56:46 -08:00
controller_utils.go should omit comparison to bool constant in pkg/controller/controller_utils.go 2021-11-13 17:15:25 +08:00
doc.go
lookup_cache.go
OWNERS add myself as approver to pkg/controller 2022-01-12 19:33:02 -05:00