mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-21 23:21:48 +00:00
Merge pull request #1222 from fluxcd/fix-git-http
Fix create source git auth for non-HTTPS repos
This commit is contained in:
commit
fffe40fbd4
3 changed files with 10 additions and 0 deletions
|
|
@ -240,6 +240,10 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
secretOpts.Username = sourceGitArgs.username
|
secretOpts.Username = sourceGitArgs.username
|
||||||
secretOpts.Password = sourceGitArgs.password
|
secretOpts.Password = sourceGitArgs.password
|
||||||
secretOpts.CAFilePath = sourceGitArgs.caFile
|
secretOpts.CAFilePath = sourceGitArgs.caFile
|
||||||
|
case "http":
|
||||||
|
logger.Warningf("insecure configuration: credentials configured for an HTTP URL")
|
||||||
|
secretOpts.Username = sourceGitArgs.username
|
||||||
|
secretOpts.Password = sourceGitArgs.password
|
||||||
}
|
}
|
||||||
secret, err := sourcesecret.Generate(secretOpts)
|
secret, err := sourcesecret.Generate(secretOpts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@ func (l stderrLogger) Successf(format string, a ...interface{}) {
|
||||||
fmt.Fprintln(l.stderr, `✔`, fmt.Sprintf(format, a...))
|
fmt.Fprintln(l.stderr, `✔`, fmt.Sprintf(format, a...))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l stderrLogger) Warningf(format string, a ...interface{}) {
|
||||||
|
fmt.Fprintln(l.stderr, `⚠️`, fmt.Sprintf(format, a...))
|
||||||
|
}
|
||||||
|
|
||||||
func (l stderrLogger) Failuref(format string, a ...interface{}) {
|
func (l stderrLogger) Failuref(format string, a ...interface{}) {
|
||||||
fmt.Fprintln(l.stderr, `✗`, fmt.Sprintf(format, a...))
|
fmt.Fprintln(l.stderr, `✗`, fmt.Sprintf(format, a...))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ type Logger interface {
|
||||||
Waitingf(format string, a ...interface{})
|
Waitingf(format string, a ...interface{})
|
||||||
// Successf logs a formatted success message.
|
// Successf logs a formatted success message.
|
||||||
Successf(format string, a ...interface{})
|
Successf(format string, a ...interface{})
|
||||||
|
// Warningf logs a formatted warning message.
|
||||||
|
Warningf(format string, a ...interface{})
|
||||||
// Failuref logs a formatted failure message.
|
// Failuref logs a formatted failure message.
|
||||||
Failuref(format string, a ...interface{})
|
Failuref(format string, a ...interface{})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue