-
Notifications
You must be signed in to change notification settings - Fork 153
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
go-git implementation #233
Conversation
@@ -15,22 +13,6 @@ import ( | |||
|
|||
// Status provides the implementation for the wego status application command | |||
func Status(allParams AddParamSet) error { | |||
// verify the app is in the wego apps folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the ability to let the user know the possibility of an unexcited app.
maybe a bit more coverage ? 😬 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VERY much cleaner overall!
@@ -42,7 +44,19 @@ func init() { | |||
|
|||
func runCmd(cmd *cobra.Command, args []string) { | |||
params.Namespace, _ = cmd.Parent().Flags().GetString("namespace") | |||
if err := cmdimpl.Add(args, params); err != nil { | |||
|
|||
authMethod, err := ssh.NewPublicKeysFromFile("git", params.PrivateKey, params.PrivateKeyPass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this taking a password on the command line? That's usually frowned on since it's available in /proc
. Normally, it's considered good practice to either pull from an environment variable or prompt for a password.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Just took the same approach flux does, but we can change it. Do you mind if I do it in another PR? I'd like to get this one merged asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. No problem
pkg/cmdimpl/add.go
Outdated
@@ -314,79 +333,63 @@ func Add(args []string, allParams AddParamSet) error { | |||
fmt.Printf("%s\n\n", clusterStatus) | |||
|
|||
if clusterStatus == status.Unmodified { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're in here, could you make this a switch
and add a check for status.Unknown
? Iftikhar ran into this yesterday. We should exit at this point if we can't talk to the cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What changed?
Moving all git cli calls to
go-git
library.Why?
It'll make it easier to mock and maintain the code
How did you test it?
Release notes
Documentation Changes