Skip to content

Commit

Permalink
Merge pull request #1515 from yujunz/plugin/go-getter
Browse files Browse the repository at this point in the history
plugin/go-getter: support urls including `:`
  • Loading branch information
k8s-ci-robot committed Sep 9, 2019
2 parents 9ee35c9 + 4cb8838 commit cd0187e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/someteam.example.com/v1/gogetter/GoGetter
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 30 additions & 0 deletions plugin/someteam.example.com/v1/gogetter/GoGetter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cd0187e

Please sign in to comment.