plugin/go-getter: support urls including :

This commit is contained in:
Yujun Zhang
2019-09-09 15:39:45 +08:00
parent 9ee35c9afb
commit 4cb883863f
2 changed files with 31 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ function parseYaml {
local file=$1
while read -r line
do
local k=${line%:*}
local k=${line%%:*}
local v=${line#*:}
local t=${v#"${v%%[![:space:]]*}"} # trim leading space

View File

@@ -44,6 +44,36 @@ metadata:
`)
}
func TestGoGetterUrl(t *testing.T) {
tc := plugins_test.NewEnvForTest(t).Set()
defer tc.Reset()
tc.BuildExecPlugin(
"someteam.example.com", "v1", "GoGetter")
th := kusttest_test.NewKustTestPluginHarness(t, "/app")
m := th.LoadAndRunGenerator(`
apiVersion: someteam.example.com/v1
kind: GoGetter
metadata:
name: example
url: https://github.com/kustless/kustomize-examples/archive/master.zip
subPath: kustomize-examples-master
`)
th.AssertActualEqualsExpected(m, `
apiVersion: v1
data:
altGreeting: Good Morning!
enableRisky: "false"
kind: ConfigMap
metadata:
name: remote-cm
`)
}
func TestGoGetterCommand(t *testing.T) {
tc := plugins_test.NewEnvForTest(t).Set()
defer tc.Reset()