Skip to content

Commit

Permalink
Merge pull request #2015 from torredil/k8s-interface-82361
Browse files Browse the repository at this point in the history
Run taint removal only if Kubernetes API is available
  • Loading branch information
k8s-ci-robot authored Apr 22, 2024
2 parents 7df4dd6 + a9902da commit 957a5f1
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 957a5f1

Please sign in to comment.