Skip to content

Commit

Permalink
Run taint removal only if Kubernetes API is available
Browse files Browse the repository at this point in the history
Signed-off-by: torredil <torredil@amazon.com>
  • Loading branch information
torredil committed Apr 22, 2024
1 parent 7df4dd6 commit a9902da
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ func NewNodeService(o *Options, md metadata.MetadataService, m mounter.Mounter,
region := os.Getenv("AWS_REGION")
klog.InfoS("regionFromSession Node service", "region", region)

// Remove taint from node to indicate driver startup success
// This is done at the last possible moment to prevent race conditions or false positive removals
time.AfterFunc(taintRemovalInitialDelay, func() {
removeTaintInBackground(k, taintRemovalBackoff, removeNotReadyTaint)
})
if k != nil {
// Remove taint from node to indicate driver startup success
// This is done at the last possible moment to prevent race conditions or false positive removals
time.AfterFunc(taintRemovalInitialDelay, func() {
removeTaintInBackground(k, taintRemovalBackoff, removeNotReadyTaint)
})
}

return &NodeService{
metadata: md,
Expand Down

0 comments on commit a9902da

Please sign in to comment.