Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Add SafeURL helper method to GitRemoteConfig #2549

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/fluxctl/sync_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ func (opts *syncOpts) RunE(cmd *cobra.Command, args []string) error {
case git.RepoReady:
break
default:
return fmt.Errorf("git repository %s is not ready to sync (status: %s)", gitConfig.Remote.URL, string(gitConfig.Status))
return fmt.Errorf("git repository %s is not ready to sync (status: %s)", gitConfig.Remote.SafeURL(), string(gitConfig.Status))
}

fmt.Fprintf(cmd.OutOrStderr(), "Synchronizing with %s\n", gitConfig.Remote.URL)
fmt.Fprintf(cmd.OutOrStderr(), "Synchronizing with %s\n", gitConfig.Remote.SafeURL())

updateSpec := update.Spec{
Type: update.Sync,
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v6/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type ControllerStatus struct {
// --- config types

type GitRemoteConfig struct {
URL string `json:"url"`
git.Remote
Branch string `json:"branch"`
Path string `json:"path"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ func (d *Daemon) GitRepoConfig(ctx context.Context, regenerate bool) (v6.GitConf
}
return v6.GitConfig{
Remote: v6.GitRemoteConfig{
URL: origin.URL,
Remote: origin,
Branch: d.GitConfig.Branch,
Path: path,
},
Expand Down
3 changes: 2 additions & 1 deletion pkg/git/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (

// Remote points at a git repo somewhere.
type Remote struct {
URL string // clone from here
// URL is where we clone from
URL string `json:"url"`
}

func (r Remote) SafeURL() string {
Expand Down