From aefc258ccddb1d853fa0d408c0b16bd8e01a7814 Mon Sep 17 00:00:00 2001 From: gman Date: Tue, 20 Mar 2018 15:51:27 +0100 Subject: [PATCH] cephfs/volumeptions: modified fields, updated validation --- pkg/cephfs/volumeoptions.go | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pkg/cephfs/volumeoptions.go b/pkg/cephfs/volumeoptions.go index 4b15fedb3..31818138c 100644 --- a/pkg/cephfs/volumeoptions.go +++ b/pkg/cephfs/volumeoptions.go @@ -19,11 +19,9 @@ package cephfs import "errors" type volumeOptions struct { - Monitor string `json:"monitor"` - Pool string `json:"pool"` - ClusterName string `json:"clusterName"` - AdminId string `json:"adminID"` - AdminSecret string `json:"adminSecret"` + Monitors string `json:"monitors"` + RootPath string `json:"rootPath"` + User string `json:"user"` } func extractOption(dest *string, optionLabel string, options map[string]string) error { @@ -38,23 +36,15 @@ func extractOption(dest *string, optionLabel string, options map[string]string) func newVolumeOptions(volOptions map[string]string) (*volumeOptions, error) { var opts volumeOptions - if err := extractOption(&opts.AdminId, "adminID", volOptions); err != nil { + if err := extractOption(&opts.Monitors, "monitors", volOptions); err != nil { return nil, err } - if err := extractOption(&opts.AdminSecret, "adminSecret", volOptions); err != nil { + if err := extractOption(&opts.RootPath, "rootPath", volOptions); err != nil { return nil, err } - if err := extractOption(&opts.Monitor, "monitor", volOptions); err != nil { - return nil, err - } - - if err := extractOption(&opts.Pool, "pool", volOptions); err != nil { - return nil, err - } - - if err := extractOption(&opts.ClusterName, "clusterName", volOptions); err != nil { + if err := extractOption(&opts.User, "user", volOptions); err != nil { return nil, err }