-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pass device path on publish from controller
When the node plugin receives a publish (== mount) call, it needs to know what device needs to be mounted. Up to now, this was done by an API request to LINSTOR. With the introduction of more aggressive caching, this often meant the request would end in a 404 if multiple volumes where mounted in short succession. To fix this, we move the retrieval of the device path out of the node plugin entirely. We can simply pass the device path from the ControllerPublish() call down using the publish context. We also remove the request for the device path from the NodeExpand() call: we have to look at the local mount table so we get the device name from there. With this change, the node plugin should no longer need to request LINSTOR API outside the node/storage pool information, which is not affected by this caching issue. Signed-off-by: Moritz Wanzenböck <[email protected]>
- Loading branch information
Showing
8 changed files
with
123 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package driver | ||
|
||
import ( | ||
"github.com/piraeusdatastore/linstor-csi/pkg/linstor" | ||
) | ||
|
||
const ( | ||
PublishContextMarker = linstor.ParameterNamespace + "/uses-publish-context" | ||
DevicePath = linstor.ParameterNamespace + "/device-path" | ||
) | ||
|
||
type PublishContext struct { | ||
DevicePath string | ||
} | ||
|
||
func PublishContextFromMap(ctx map[string]string) *PublishContext { | ||
_, ok := ctx[PublishContextMarker] | ||
if !ok { | ||
return nil | ||
} | ||
|
||
return &PublishContext{ | ||
DevicePath: ctx[DevicePath], | ||
} | ||
} | ||
|
||
func (p *PublishContext) ToMap() map[string]string { | ||
return map[string]string{ | ||
PublishContextMarker: "true", | ||
DevicePath: p.DevicePath, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters