Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config management with viper #395

Merged
merged 2 commits into from
Jul 7, 2023
Merged

Add config management with viper #395

merged 2 commits into from
Jul 7, 2023

Conversation

alexmasi
Copy link
Contributor

@alexmasi alexmasi commented Jul 6, 2023

No description provided.

@alexmasi alexmasi requested a review from bormanp July 6, 2023 20:02
@alexmasi
Copy link
Contributor Author

alexmasi commented Jul 6, 2023

/gcbrun

@coveralls
Copy link

coveralls commented Jul 6, 2023

Pull Request Test Coverage Report for Build 5481146700

  • 9 of 59 (15.25%) changed or added relevant lines in 3 files are covered.
  • 25 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.7%) to 65.47%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/deploy/deploy.go 2 4 50.0%
cmd/topology/topology.go 7 9 77.78%
cmd/root.go 0 46 0.0%
Files with Coverage Reduction New Missed Lines %
cmd/root.go 25 5.52%
Totals Coverage Status
Change from base Build 5418025002: -0.7%
Covered Lines: 3665
Relevant Lines: 5598

💛 - Coveralls

d, err := newDeployment(args[0], false)
if err != nil {
return err
}
if err := d.Deploy(cmd.Context(), kubecfg); err != nil {
d.Progress = viper.GetBool("progress")
if err := d.Deploy(cmd.Context(), viper.GetString("kubecfg")); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the GetString returns ""? It would be nice if this (and possibly other) values could be sanity checked prior to running these functions as then you don't have to worry about checking the values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same behavior as the current implementation, if the flag was the empty string then the function call would handle it as before. in the case of kubecfg the empty string is completely valid as an argument if the user wants to fallback to the in cluster config.

kne_cli/main.go Outdated
@@ -45,7 +45,8 @@ func main() {
}
}
flags.Import()
err := cmd.ExecuteContext(context.Background())
root := cmd.New()
err := root.ExecuteContext(context.Background())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just say cmd.New().ExecuteContext(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@alexmasi
Copy link
Contributor Author

alexmasi commented Jul 6, 2023

/gcbrun

@alexmasi alexmasi merged commit 8daec69 into main Jul 7, 2023
@alexmasi alexmasi deleted the viper branch July 7, 2023 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants