mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Merge pull request #10848 from ggriffiths/listsnapshot_secrets
CSI Listsnapshot secrets support
This commit is contained in:
@@ -333,6 +333,19 @@ func (s *HTTPServer) csiSnapshotList(resp http.ResponseWriter, req *http.Request
|
||||
|
||||
query := req.URL.Query()
|
||||
args.PluginID = query.Get("plugin_id")
|
||||
querySecrets := query["secrets"]
|
||||
|
||||
// Parse comma separated secrets only when provided
|
||||
if len(querySecrets) >= 1 {
|
||||
secrets := strings.Split(querySecrets[0], ",")
|
||||
args.Secrets = make(structs.CSISecrets)
|
||||
for _, raw := range secrets {
|
||||
secret := strings.Split(raw, "=")
|
||||
if len(secret) == 2 {
|
||||
args.Secrets[secret[0]] = secret[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var out structs.CSISnapshotListResponse
|
||||
if err := s.agent.RPC("CSIVolume.ListSnapshots", &args, &out); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user