@@ -29,7 +29,6 @@ import (
2929var (
3030 validEnvName = regexp .MustCompile (`^[A-Z0-9-_]+$` )
3131 validName = regexp .MustCompile (`^[a-z][a-z0-9-_]*$` )
32- validPath = regexp .MustCompile (`^(/[a-zA-Z0-9-_]+)+$` )
3332)
3433
3534type optionsFunc func (* lade.Client ) (* orderedmap.OrderedMap , error )
@@ -165,41 +164,6 @@ func getAddonOptions(client *lade.Client) (*orderedmap.OrderedMap, error) {
165164 return options , nil
166165}
167166
168- func getDiskOptions (appName string ) optionsFunc {
169- return func (client * lade.Client ) (* orderedmap.OrderedMap , error ) {
170- disks , err := client .Disk .List (appName )
171- if err != nil {
172- return nil , err
173- }
174- if len (disks ) == 0 {
175- return nil , errors .New ("There are no disks available" )
176- }
177- options := orderedmap .New ()
178- for _ , disk := range disks {
179- options .Set (disk .Name , disk .Name )
180- }
181- options .SortKeys (sort .Strings )
182- return options , nil
183- }
184- }
185-
186- func getDiskPlanOptions (id string ) optionsFunc {
187- return func (client * lade.Client ) (* orderedmap.OrderedMap , error ) {
188- plans , err := client .Plan .User (id , "disk" )
189- if err != nil {
190- return nil , err
191- }
192- if len (plans ) == 0 {
193- return nil , errors .New ("There are no plans available" )
194- }
195- options := orderedmap .New ()
196- for _ , plan := range plans {
197- options .Set (plan .ID , plan .ID )
198- }
199- return options , nil
200- }
201- }
202-
203167func getDomainOptions (appName string ) optionsFunc {
204168 return func (client * lade.Client ) (* orderedmap.OrderedMap , error ) {
205169 domains , err := client .Domain .List (appName )
@@ -236,7 +200,7 @@ func getKeyOptions(appName string) optionsFunc {
236200
237201func getPlanOptions (id string ) optionsFunc {
238202 return func (client * lade.Client ) (* orderedmap.OrderedMap , error ) {
239- plans , err := client .Plan .User (id , "" )
203+ plans , err := client .Plan .User (id )
240204 if err != nil {
241205 return nil , err
242206 }
@@ -435,12 +399,6 @@ func validateAppName(client *lade.Client) survey.Validator {
435399 }))
436400}
437401
438- func validateDiskName (client * lade.Client , appName string ) survey.Validator {
439- return survey .ComposeValidators (survey .Required , validateUniqueName (func (name string ) error {
440- return client .Disk .Head (appName , name )
441- }))
442- }
443-
444402func validateDomainName (client * lade.Client , appName string ) survey.Validator {
445403 return survey .ComposeValidators (survey .Required , validateUniqueName (func (name string ) error {
446404 return client .Domain .Head (appName , name )
@@ -477,13 +435,6 @@ func validateName(val interface{}) error {
477435 return nil
478436}
479437
480- func validatePath (val interface {}) error {
481- if ! validPath .MatchString (val .(string )) {
482- return errors .New ("Path must be valid absolute directory" )
483- }
484- return nil
485- }
486-
487438func validateUniqueName (fn func (string ) error ) survey.Validator {
488439 return func (val interface {}) error {
489440 err := fn (val .(string ))
0 commit comments