-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added gen subcmd to config cmd Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> add test for aws regions option list Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> refactored based on main hadeployconfig model Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> prompt moved Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> on-prem flow completed Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> custom certs added to ha onprem Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> fix the config change based on main branch Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added password and paragraph support in prompt Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> hardware cal added Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> aws flow added and cert via file added Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added AWS Provision Config Gen with few tests Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> aws ha deployment working Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> fix custom certs Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> regex fix Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> fix fqdn regex Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> regex made common Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added test for aws cidr managed flow Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> changed ioutil to os in config.go cmd Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added test for AWS config gen flow Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> unit tests added Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> pg and os limit set to min 3 Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added more unit test Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> fix complexity Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> fix code smells Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added tests Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> fix pipeline Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added more unit tests Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> revendor fix .bldr.toml Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> simplified code Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> removed not used code from prompt lib Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> increased unit test coverage Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> added unit tests for Init func in hadeployconfig Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> make config gen command visible Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> code review comment fix Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> PR comment change Signed-off-by: Vivek Yadav <vivek.yadav@progress.com> removed comment Signed-off-by: Vivek Yadav <vivek.yadav@progress.com>
- Loading branch information
1 parent
dfe7fd2
commit 3d7b667
Showing
31 changed files
with
8,175 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/chef/automate/components/automate-cli/pkg/docs" | ||
"github.com/chef/automate/components/automate-cli/pkg/status" | ||
"github.com/chef/automate/lib/hardwarecal" | ||
"github.com/chef/automate/lib/io/fileutils" | ||
"github.com/chef/automate/lib/pmt" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
RootCmd.AddCommand(hardwareCalCmd()) | ||
} | ||
|
||
func hardwareCalCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "hardware-cal COMMAND", | ||
Short: "Estimate Hardware Requirements for given inputs, this calculator is for Chef Automate HA", | ||
Long: "Estimate Hardware Requirements for given inputs, this calculator is for Chef Automate HA", | ||
Annotations: map[string]string{ | ||
docs.Tag: docs.BastionHost, | ||
}, | ||
Hidden: true, | ||
} | ||
|
||
run := &cobra.Command{ | ||
Use: "run", | ||
Short: "This will trigger the hardware calculator to ask input values, based on which it will provide hardware requirements for Chef Automate HA", | ||
Long: "This will trigger the hardware calculator to ask input values, based on which it will provide hardware requirements for Chef Automate HA", | ||
RunE: runCal, | ||
Annotations: map[string]string{ | ||
docs.Tag: docs.BastionHost, | ||
}, | ||
Hidden: true, | ||
} | ||
|
||
cmd.AddCommand(run) | ||
return cmd | ||
} | ||
|
||
func runCal(*cobra.Command, []string) error { | ||
cw := writer | ||
fsu := &fileutils.FileSystemUtils{} | ||
p := pmt.PromptFactory(os.Stdin, os.Stdout, fsu) | ||
hc := hardwarecal.NewHardwareCalPrompt(p, cw) | ||
err := hc.Run() | ||
if err != nil { | ||
return status.Wrap( | ||
err, | ||
status.HardwareCalError, | ||
"Failed to Estimate Hardware Requirements", | ||
) | ||
} | ||
|
||
cw.Println("* These numbers are just for estimation, based on our test environment conditions. \n* Please do your performance analysis based on your environment and usages.") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package genconfig | ||
|
||
import ( | ||
"github.com/chef/automate/lib/toml" | ||
) | ||
|
||
type AutomateHaConfig struct { | ||
Fqdn string `json:"fqdn,omitempty" toml:"fqdn,omitempty" mapstructure:"fqdn,omitempty"` | ||
} | ||
|
||
func AutomateHaConfigFactory() *AutomateHaConfig { | ||
return &AutomateHaConfig{} | ||
} | ||
|
||
func (c *AutomateHaConfig) Toml() (tomlBytes []byte, err error) { | ||
return toml.Marshal(c) | ||
} | ||
|
||
func (c *AutomateHaConfig) Prompts() (err error) { | ||
return | ||
} |
Oops, something went wrong.