Skip to content

Commit

Permalink
Merge pull request #134 from willthames/update-resid
Browse files Browse the repository at this point in the history
Update kustomize dependencies
  • Loading branch information
pst authored Oct 1, 2021
2 parents 64446a3 + 0f26b21 commit f90ba7f
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 334 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ require (
k8s.io/apimachinery v0.20.2
k8s.io/client-go v0.20.2
k8s.io/kubectl v0.20.2
sigs.k8s.io/kustomize/api v0.6.9
sigs.k8s.io/kustomize/kyaml v0.10.7
sigs.k8s.io/kustomize/api v0.10.0
sigs.k8s.io/kustomize/kyaml v0.12.0
)
317 changes: 18 additions & 299 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions kustomize/data_source_kustomization.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/krusty"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/resid"
)

func getIDFromResources(rm resmap.ResMap) (s string, err error) {
Expand Down Expand Up @@ -84,9 +84,9 @@ func runKustomizeBuild(fSys filesys.FileSystem, path string, kOpts *schema.Resou

opts := getKustomizeOptions(kOpts)

k := krusty.MakeKustomizer(fSys, opts)
k := krusty.MakeKustomizer(opts)

rm, err = k.Run(path)
rm, err = k.Run(fSys, path)
if err != nil {
return nil, fmt.Errorf("Kustomizer Run for path '%s' failed: %s", path, err)
}
Expand Down
6 changes: 5 additions & 1 deletion kustomize/data_source_kustomization_overlay_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path/filepath"

"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/kyaml/filesys"
)

var KFILENAME string = "Kustomization"
Expand Down Expand Up @@ -60,6 +60,10 @@ func (ofs overlayFileSystem) RemoveAll(name string) error {
return ofs.fs.RemoveAll(name)
}

func (ofs overlayFileSystem) ReadDir(name string) ([]string, error) {
return ofs.fs.ReadDir(name)
}

func (ofs overlayFileSystem) Open(name string) (filesys.File, error) {
return ofs.fs.Open(name)
}
Expand Down
4 changes: 2 additions & 2 deletions kustomize/data_source_kustomization_overlay_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func TestOverlayFileSystemTwoDataSources(t *testing.T) {
{
Config: testOverlayFileSystemTwoDataSourcesConfig(),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckOutput("check1", "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"test-overlay1\"}}\n"),
resource.TestCheckOutput("check2", "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"test-overlay2\"}}\n"),
resource.TestCheckOutput("check1", "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"test-overlay1\"}}"),
resource.TestCheckOutput("check2", "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"test-overlay2\"}}"),
),
},
},
Expand Down
46 changes: 23 additions & 23 deletions kustomize/data_source_kustomization_overlay_test.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kustomize/data_source_kustomization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/kyaml/resid"
)

func TestDeterminePrefix(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion kustomize/resource_kustomization.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"

"sigs.k8s.io/kustomize/api/resid"
"sigs.k8s.io/kustomize/kyaml/resid"

k8serrors "k8s.io/apimachinery/pkg/api/errors"
k8smeta "k8s.io/apimachinery/pkg/api/meta"
Expand Down
4 changes: 2 additions & 2 deletions kustomize/structures_kustomization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
func TestFlattenKustomizationIDs(t *testing.T) {
fSys := filesys.MakeFsOnDisk()
opts := krusty.MakeDefaultOptions()
k := krusty.MakeKustomizer(fSys, opts)
k := krusty.MakeKustomizer(opts)

rm, err := k.Run("test_kustomizations/basic/initial")
rm, err := k.Run(fSys, "test_kustomizations/basic/initial")
assert.Equal(t, err, nil, nil)

ids, idsPrio := flattenKustomizationIDs(rm)
Expand Down

0 comments on commit f90ba7f

Please sign in to comment.