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

enable file transfer for the sake of testing #4851

Closed
Closed
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
14 changes: 14 additions & 0 deletions api/krusty/remoteloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"sigs.k8s.io/kustomize/kyaml/yaml"
)

const XdgConfigHome = "XDG_CONFIG_HOME"

func TestRemoteLoad_LocalProtocol(t *testing.T) {
type testRepos struct {
root string
Expand Down Expand Up @@ -58,6 +60,13 @@ export GIT_AUTHOR_EMAIL=nobody@kustomize.io
export GIT_AUTHOR_NAME=Nobody
export GIT_COMMITTER_EMAIL=nobody@kustomize.io
export GIT_COMMITTER_NAME=Nobody
export XDG_CONFIG_HOME="$ROOT"

mkdir $XDG_CONFIG_HOME/git
cat <<GitConfig > $XDG_CONFIG_HOME/git/config
[protocol "file"]
allow=always
GitConfig

cp -r testdata/remoteload/simple $ROOT/simple.git
(
Expand Down Expand Up @@ -264,6 +273,9 @@ resources:
},
}

xdgConfigHome := os.Getenv(XdgConfigHome)
os.Setenv(XdgConfigHome, repos.root)

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if test.skip {
Expand All @@ -287,6 +299,8 @@ resources:
}
})
}

os.Setenv(XdgConfigHome, xdgConfigHome)
}

func TestRemoteLoad_RemoteProtocols(t *testing.T) {
Expand Down