Added prompt for addon paths and urls
@@ -148,6 +148,16 @@ func clusterConfig(ctx *cli.Context) error {
}
cluster.Services = *serviceConfig
+ //Get addon manifests
+ addonsInclude, err := getAddonManifests(reader)
+ if err != nil {
+ return err
+ }
+
+ if len(addonsInclude) > 0 {
+ cluster.AddonsInclude = append(cluster.AddonsInclude, addonsInclude...)
+ }
+
return writeConfig(&cluster, configFile, print)
}
@@ -337,3 +347,39 @@ func getNetworkConfig(reader *bufio.Reader) (*v3.NetworkConfig, error) {
networkConfig.Plugin = networkPlugin
return &networkConfig, nil
}
+
+func getAddonManifests(reader *bufio.Reader) ([]string, error) {
+ var addonSlice []string
+ var resume = true
+
+ includeAddons, err := getConfig(reader, "Add addon manifest urls or yaml files", "no")
+
+ if err != nil {
+ return nil, err
+ }
+
+ if strings.ContainsAny(includeAddons, "Yes YES Y yes y") {
+ for resume {
+ addonPath, err := getConfig(reader, "Enter the Path or URL for the manifest", "")
+ if err != nil {
+ return nil, err
+ }
+
+ addonSlice = append(addonSlice, addonPath)
+
+ cont, err := getConfig(reader, "Add another addon", "no")
+ if err != nil {
+ return nil, err
+ }
+
+ if strings.ContainsAny(cont, "Yes y Y yes YES") {
+ resume = true
+ } else {
+ resume = false
+ }
+
+ }
+ }
+
+ return addonSlice, nil
+}
