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

New git datasource #661

Merged
merged 1 commit into from
Nov 12, 2019
Merged

New git datasource #661

merged 1 commit into from
Nov 12, 2019

Conversation

hairyhenderson
Copy link
Owner

Adds support for accessing datasources in git repos. Adds 5 new schemes:

  • git:// - the git server (as served by git daemon and others)
  • git+file:// - git repo on the local filesystem - supports bare repos as well
  • git+ssh:// - git over ssh
  • git+http://, git+https:// - git over http(s)

// is used to separate repo from path, like git+https://github.com/example/repo//path/to/file.yaml - the path here is /path/to/file.yaml. Directories are supported.

Signed-off-by: Dave Henderson dhenderson@gmail.com

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Found some fixes!

P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).

data/datasource_git.go Outdated Show resolved Hide resolved
@hairyhenderson hairyhenderson force-pushed the git-datasource branch 2 times, most recently from 859b2fc to b285c11 Compare November 10, 2019 03:37
@hairyhenderson hairyhenderson marked this pull request as ready for review November 10, 2019 03:47
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Comment on lines +59 to +71
func (g gitsource) parseArgURL(arg string) (u *url.URL, err error) {
if strings.HasPrefix(arg, "//") {
u, err = url.Parse(arg[1:])
u.Path = "/" + u.Path
} else {
u, err = url.Parse(arg)
}

if err != nil {
return nil, fmt.Errorf("failed to parse arg %s: %w", arg, err)
}
return u, err
}

Choose a reason for hiding this comment

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

This is 👍

@rossedman
Copy link

@hairyhenderson This looks really awesome, thanks for throwing this up. I like where it's heading.

@hairyhenderson
Copy link
Owner Author

Thanks @rossedman! 😄

@hairyhenderson hairyhenderson merged commit 677ea79 into master Nov 12, 2019
@hairyhenderson hairyhenderson deleted the git-datasource branch November 12, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants