-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: don't check limits on worker nodes #142
Conversation
We're checking the volume limit during the driver startup. However because the driver is used both for the controller and node part, it fails during the node startup because we're deploying the driver to the nodes without a token. The DO token is only needed by the controller. The `checkLimit()` function would therefore print when deployed to the nodes: ``` time="2019-01-14T20:13:52Z" level=warning msg="CSI plugin will not function correctly, please resolve volume limit" error="rpc error: code = Internal desc = couldn't get account information to check volume limit: GET https://api.digitalocean.com/v2/account: 401 Unable to authenticate you." ``` This PR fixes that to not to call `checkLimit` if the token is not passed, which is a valid case for drivers deployed to the worker nodes. supersedes #127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one optional suggestion.
driver/driver.go
Outdated
@@ -58,6 +58,7 @@ type Driver struct { | |||
nodeId string | |||
region string | |||
doTag string | |||
hasToken bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about calling this isController
? I think that would make the code a bit easier to understand and reduce the degree of comments we need below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, pushed some updates. I'll squash afterwards 👍
driver: don't check limits on worker nodes
driver: don't check limits on worker nodes
* Cherry-pick: Add tagging support for Volumes via the new `--do-tag` flag [[GH-130]](#130) * Cherry-pick: Fix support for volume snapshots by setting snapshot id on volume creation [[GH-129]](#129) * Cherry-pick: Goreportcard fixes (typos, exported variables, etc..) [[GH-121]](#121) * Cherry-pick: Rename the cluster role bindings for the `node-driver-registrar` to be consistent with the other role bindings. [[GH-118]](#118) * Cherry-pick: Remove the `--token` flag for the `csi-do-node` driver. Drivers running on the node don't need the token anymore. [[GH-118]](#118) * Cherry-pick: Don't check the volume limits on the worker nodes (worker nodes are not able to talk to DigitalOcean API) [[GH-142]](#142) * Cherry-pick: Update `godo` (DigitalOcean API package) version to v1.13.0 [[GH-143]](#143) * Cherry-pick: Fix race in snapshot integration test. [[GH-146]](#146) * Cherry-pick: Add tagging support for Volume snapshots via the new `--do-tag` flag [[GH-145]](#145)
* Cherry-pick: Add tagging support for Volumes via the new `--do-tag` flag [[GH-130]](#130) * Cherry-pick: Fix support for volume snapshots by setting snapshot id on volume creation [[GH-129]](#129) * Cherry-pick: Goreportcard fixes (typos, exported variables, etc..) [[GH-121]](#121) * Cherry-pick: Rename the cluster role bindings for the `node-driver-registrar` to be consistent with the other role bindings. [[GH-118]](#118) * Cherry-pick: Remove the `--token` flag for the `csi-do-node` driver. Drivers running on the node don't need the token anymore. [[GH-118]](#118) * Cherry-pick: Don't check the volume limits on the worker nodes (worker nodes are not able to talk to DigitalOcean API) [[GH-142]](#142) * Cherry-pick: Update `godo` (DigitalOcean API package) version to v1.13.0 [[GH-143]](#143) * Cherry-pick: Fix race in snapshot integration test. [[GH-146]](#146) * Cherry-pick: Add tagging support for Volume snapshots via the new `--do-tag` flag [[GH-145]](#145)
We're checking the volume limit during the driver startup. However
because the driver is used both for the controller and node part, it
fails during the node startup because we're deploying the driver to the
nodes without a token. The DO token is only needed by the controller.
The
checkLimit()
function would therefore print when deployed to thenodes:
This PR fixes that to not to call
checkLimit
if the token is notpassed, which is a valid case for drivers deployed to the worker nodes.
supersedes #127