Skip to content

Commit

Permalink
Avoid requiring CSI plugins to be redeployed after introducing StageP…
Browse files Browse the repository at this point in the history
…ublishDir
  • Loading branch information
ejweber committed Jul 25, 2022
1 parent 1eab7f5 commit 3448143
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/allocrunner/taskrunner/plugin_supervisor_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ func newCSIPluginSupervisorHook(config *csiPluginSupervisorHookConfig) *csiPlugi
socketMountPoint := filepath.Join(config.clientStateDirPath, "csi",
"plugins", config.runner.Alloc().ID)

// In v1.3.0, Nomad started instructing CSI plugins to stage and publish
// within /csi/local. Plugins deployed after the introduction of
// StagePublishDir default to StagePublishDir = /csi/local. However,
// plugins deployed between v1.3.0 and the introduction of
// StagePublishDir have StagePublishDir = "". Default to /csi/local here
// to avoid breaking plugins that aren't redeployed.
if task.CSIPluginConfig.StagePublishDir == "" {
task.CSIPluginConfig.StagePublishDir = filepath.Join("/local", "csi")
}

if task.CSIPluginConfig.HealthTimeout == 0 {
task.CSIPluginConfig.HealthTimeout = 30 * time.Second
}
Expand Down

0 comments on commit 3448143

Please sign in to comment.