mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
csi: fix volume registration error (#26642)
This commit is contained in:
committed by
GitHub
parent
5f34867420
commit
485356c3d3
3
.changelog/26642.txt
Normal file
3
.changelog/26642.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
csi: fix EOF error when registering volumes
|
||||
```
|
||||
@@ -503,6 +503,7 @@ type CSIVolumeRegisterRequest struct {
|
||||
type CSIVolumeRegisterResponse struct {
|
||||
Volumes []*CSIVolume
|
||||
Warnings string
|
||||
QueryMeta
|
||||
}
|
||||
|
||||
type CSIVolumeDeregisterRequest struct {
|
||||
|
||||
@@ -146,7 +146,7 @@ func (s *HTTPServer) csiVolumeRegister(resp http.ResponseWriter, req *http.Reque
|
||||
|
||||
setMeta(resp, &out.QueryMeta)
|
||||
|
||||
return nil, nil
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (s *HTTPServer) csiVolumeCreate(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
||||
|
||||
@@ -35,9 +35,11 @@ func (c *VolumeRegisterCommand) csiRegister(client *api.Client, ast *ast.File, o
|
||||
fmt.Sprintf("[bold][yellow]Volume Warnings:\n%s[reset]\n", resp.Warnings)))
|
||||
}
|
||||
|
||||
vol = resp.Volumes[0] // note: the command only ever returns 1 volume from the API
|
||||
|
||||
for _, vol := range resp.Volumes {
|
||||
// note: the command only ever returns 1 volume from the API
|
||||
c.Ui.Output(fmt.Sprintf("Volume %q registered", vol.ID))
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -371,6 +371,7 @@ func (v *CSIVolume) Register(args *structs.CSIVolumeRegisterRequest, reply *stru
|
||||
return err
|
||||
}
|
||||
|
||||
reply.Volumes = args.Volumes
|
||||
reply.Index = index
|
||||
v.srv.setQueryMeta(&reply.QueryMeta)
|
||||
return nil
|
||||
|
||||
@@ -879,9 +879,10 @@ type CSIVolumeRegisterRequest struct {
|
||||
}
|
||||
|
||||
type CSIVolumeRegisterResponse struct {
|
||||
Volumes []*CSIVolume
|
||||
|
||||
// Warnings are non-fatal messages from Enterprise policy enforcement
|
||||
Warnings string
|
||||
|
||||
QueryMeta
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user