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

fix depth subpath bug #16

Merged
merged 3 commits into from
Feb 17, 2020
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
6 changes: 6 additions & 0 deletions Furyfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ bases:
- name: monitoring
- name: logging
version: master
- name: dr/velero/velero-base
version: feature/deprecate-and-update
- name: dr/velero/velero-aws
version: feature/deprecate-and-update
- name: dr/velero/velero-restic
version: feature/deprecate-and-update

provider:
roles: {}
Expand Down
11 changes: 8 additions & 3 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package cmd
import (
"fmt"
"log"
"path"
"strings"
)

Expand Down Expand Up @@ -235,10 +236,14 @@ func (n *URLSpec) strategy() string {

func (n *URLSpec) getURLfromCompanyRepos() string {
var url string
if len(n.Blocks) == 2 {
url = fmt.Sprintf("%s-%s%s//%s/%s?ref=%s", n.Prefix, n.Blocks[0], n.DotGitParticle, n.Kind, n.Blocks[1], n.Version)
} else if len(n.Blocks) == 1 {
if len(n.Blocks) == 1 {
url = fmt.Sprintf("%s-%s%s//%s?ref=%s", n.Prefix, n.Blocks[0], n.DotGitParticle, n.Kind, n.Version)
} else if len(n.Blocks) >= 2 {
var remainingBlocks string
for i := 1; i < len(n.Blocks); i++ {
remainingBlocks = path.Join(remainingBlocks, n.Blocks[i])
}
url = fmt.Sprintf("%s-%s%s//%s/%s?ref=%s", n.Prefix, n.Blocks[0], n.DotGitParticle, n.Kind, remainingBlocks, n.Version)
}
return url
}