@@ -721,86 +721,6 @@ func (r *runners) promptForPreflightPathsWithCharts(charts []tools.ChartConfig,
721721 return preflights , nil
722722}
723723
724- func (r * runners ) promptForPreflightValues (preflightPath string , charts []tools.ChartConfig ) (string , error ) {
725- if len (charts ) == 0 {
726- // No charts configured, just ask if they want to specify a custom path
727- addValuesPath := promptui.Select {
728- Label : fmt .Sprintf ("Does '%s' use Helm chart values?" , filepath .Base (preflightPath )),
729- Items : []string {"No" , "Yes - specify path" },
730- }
731- _ , result , err := addValuesPath .Run ()
732- if err != nil {
733- if err == promptui .ErrInterrupt {
734- return "" , errors .New ("cancelled" )
735- }
736- return "" , errors .Wrap (err , "failed to read values option" )
737- }
738-
739- if result == "Yes - specify path" {
740- valuesPathPrompt := promptui.Prompt {
741- Label : "Values file path" ,
742- Default : "" ,
743- }
744- valuesPath , err := valuesPathPrompt .Run ()
745- if err != nil {
746- if err == promptui .ErrInterrupt {
747- return "" , errors .New ("cancelled" )
748- }
749- return "" , errors .Wrap (err , "failed to read values path" )
750- }
751- return valuesPath , nil
752- }
753- return "" , nil
754- }
755-
756- // Charts are configured, offer them as options
757- options := []string {"No" }
758- for _ , chart := range charts {
759- options = append (options , fmt .Sprintf ("Yes - use %s" , chart .Path ))
760- }
761- options = append (options , "Yes - other path" )
762-
763- valuesPrompt := promptui.Select {
764- Label : fmt .Sprintf ("Does '%s' use Helm chart values?" , filepath .Base (preflightPath )),
765- Items : options ,
766- }
767- _ , result , err := valuesPrompt .Run ()
768- if err != nil {
769- if err == promptui .ErrInterrupt {
770- return "" , errors .New ("cancelled" )
771- }
772- return "" , errors .Wrap (err , "failed to read values option" )
773- }
774-
775- if result == "No" {
776- return "" , nil
777- }
778-
779- if result == "Yes - other path" {
780- valuesPathPrompt := promptui.Prompt {
781- Label : "Values file path" ,
782- Default : "" ,
783- }
784- valuesPath , err := valuesPathPrompt .Run ()
785- if err != nil {
786- if err == promptui .ErrInterrupt {
787- return "" , errors .New ("cancelled" )
788- }
789- return "" , errors .Wrap (err , "failed to read values path" )
790- }
791- return valuesPath , nil
792- }
793-
794- // Extract the chart path from the selection
795- for _ , chart := range charts {
796- if result == fmt .Sprintf ("Yes - use %s" , chart .Path ) {
797- return chart .Path , nil
798- }
799- }
800-
801- return "" , nil
802- }
803-
804724func (r * runners ) promptForManifests () ([]string , error ) {
805725 var manifests []string
806726
0 commit comments