Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#4995 from KnVerey/follow-up-fixes
Browse files Browse the repository at this point in the history
Follow up fixes
  • Loading branch information
k8s-ci-robot authored Jan 24, 2023
2 parents 96351a9 + 8b21844 commit 279ad3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions api/internal/git/repospec.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const (
refQuery = "?ref="
gitSuffix = ".git"
gitRootDelimiter = "_git/"
pathSeparator = string(filepath.Separator)
pathSeparator = "/" // do not use filepath.Separator, as this is a URL
)

// NewRepoSpecFromURL parses git-like urls.
Expand Down Expand Up @@ -198,8 +198,8 @@ func tryDefaultLengthSplit(n string, defaultSegmentLength int) (string, string,
}

func kustRootPathExitsRepo(kustRootPath string) bool {
cleanedPath := filepath.Clean(strings.TrimPrefix(kustRootPath, pathSeparator))
pathElements := strings.Split(cleanedPath, pathSeparator)
cleanedPath := filepath.Clean(strings.TrimPrefix(kustRootPath, string(filepath.Separator)))
pathElements := strings.Split(cleanedPath, string(filepath.Separator))
return len(pathElements) > 0 &&
pathElements[0] == filesys.ParentDir
}
Expand Down
4 changes: 0 additions & 4 deletions api/krusty/generatoroptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ metadata:
func TestGeneratorOptionsOverlayDisableNameSuffixHash(t *testing.T) {
th := kusttest_test.MakeHarness(t)
th.WriteK("base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
generatorOptions:
disableNameSuffixHash: false
labels:
Expand All @@ -106,8 +104,6 @@ configMapGenerator:
- foo=bar
`)
th.WriteK("overlay", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
generatorOptions:
Expand Down

0 comments on commit 279ad3e

Please sign in to comment.