mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Merge pull request #1515 from yujunz/plugin/go-getter
plugin/go-getter: support urls including `:`
This commit is contained in:
@@ -28,7 +28,7 @@ function parseYaml {
|
|||||||
local file=$1
|
local file=$1
|
||||||
while read -r line
|
while read -r line
|
||||||
do
|
do
|
||||||
local k=${line%:*}
|
local k=${line%%:*}
|
||||||
local v=${line#*:}
|
local v=${line#*:}
|
||||||
local t=${v#"${v%%[![:space:]]*}"} # trim leading space
|
local t=${v#"${v%%[![:space:]]*}"} # trim leading space
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
func TestGoGetterCommand(t *testing.T) {
|
||||||
tc := plugins_test.NewEnvForTest(t).Set()
|
tc := plugins_test.NewEnvForTest(t).Set()
|
||||||
defer tc.Reset()
|
defer tc.Reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user