Skip to content

Commit

Permalink
v3.0.0 CI Fixes (#131)
Browse files Browse the repository at this point in the history
* Use --short command when getting kustomize version for test

* Remove reference to deprecated exec plugin file name

* Strip ksops.v from kustomize version
  • Loading branch information
devstein authored Aug 29, 2021
1 parent 2a7a3e8 commit b2ffe87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ dockers:
- go.sum
- Makefile
- scripts/
- exec_plugin.go
- ksops.go
# include .git for version
- .git/
Expand Down Expand Up @@ -123,7 +122,6 @@ dockers:
- go.sum
- Makefile
- scripts/
- exec_plugin.go
- ksops.go
# include .git for version
- .git/
7 changes: 5 additions & 2 deletions ksops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestKSOPSPluginInstallation(t *testing.T) {

// run kustomize version to validate installation
// and get kustomize version
cmd := exec.Command("kustomize", "version")
cmd := exec.Command("kustomize", "version", "--short")
stdOut := bytes.Buffer{}
stdErr := bytes.Buffer{}
cmd.Stdout = &stdOut
Expand All @@ -80,7 +80,10 @@ func TestKSOPSPluginInstallation(t *testing.T) {
// assume v4 (latest at time of writing)
kustomizeVersion := "v4"

if strings.Contains(stdOut.String(), "v3") {
// get std out and strip "ksops.v" string to simplify version matching
versionOutput := strings.ReplaceAll(stdOut.String(), "ksops.v", "")

if strings.Contains(versionOutput, "v3") {
t.Log("detected kustomize v3")
kustomizeVersion = "v3"
}
Expand Down

0 comments on commit b2ffe87

Please sign in to comment.