Skip to content

Commit 34e99ef

Browse files
committed
chore: pass SourceConfigFile path as public var
1 parent 41c3dfa commit 34e99ef

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pkg/sourceconfigs/helpers.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import (
1717
)
1818

1919
var info = termcolor.ColorInfo
20+
var SourceConfigFile = filepath.Join(".jx", "gitops", v1alpha1.SourceConfigFileName)
2021

2122
// LoadSourceConfig loads the source config and optionally adds the default vlaues
2223
func LoadSourceConfig(dir string, applyDefaults bool) (*v1alpha1.SourceConfig, error) {
2324
config := &v1alpha1.SourceConfig{}
24-
path := filepath.Join(dir, ".jx", "gitops", v1alpha1.SourceConfigFileName)
25+
path := filepath.Join(dir, SourceConfigFile)
2526

2627
exists, err := files.FileExists(path)
2728
if err != nil {

pkg/variablefinders/requirements.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ func GetSettings(g gitclient.Interface, jxClient jxc.Interface, ns, dir, owner,
9191
return nil, "", errors.New("failed to find a dev environment source url on development environment resource")
9292
}
9393
}
94-
// Note: attempt to sparsely clone the cluster repo to get the source-config.yaml file
95-
// If sparse clone is not supported, we will fall back to a shallow clone
96-
clusterDir, err := requirements.PartialCloneClusterRepo(g, gitURL, true, ".jx/gitops/source-config.yaml")
94+
clusterDir, err := requirements.PartialCloneClusterRepo(g, gitURL, true, sourceconfigs.SourceConfigFile)
9795
if err != nil {
9896
return nil, "", err
9997
}

0 commit comments

Comments
 (0)