mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 18:40:55 +00:00
Compare commits
33 Commits
api/v0.17.
...
api/v0.17.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cc25a511c | ||
|
|
f6ad718ee6 | ||
|
|
da14e76359 | ||
|
|
7424956ccf | ||
|
|
e244b83844 | ||
|
|
f9838461af | ||
|
|
49a645f05d | ||
|
|
e7a15496dd | ||
|
|
0d7d830236 | ||
|
|
e676d056b2 | ||
|
|
0e649599d0 | ||
|
|
a68f40738a | ||
|
|
72d95b5f41 | ||
|
|
671de1662d | ||
|
|
2e6171a9ea | ||
|
|
7f99cebdc6 | ||
|
|
5d127e4138 | ||
|
|
bcb1a367aa | ||
|
|
ed09399cd1 | ||
|
|
82ee768212 | ||
|
|
116b307b88 | ||
|
|
fb9f45ebe0 | ||
|
|
536c1c0a8b | ||
|
|
e20e438d05 | ||
|
|
42873c8d2a | ||
|
|
277da9ed21 | ||
|
|
2b00d887fd | ||
|
|
08d0593c3e | ||
|
|
31706fd7fd | ||
|
|
e862612703 | ||
|
|
3f921e159b | ||
|
|
7b1eaf1e4f | ||
|
|
5c7f8b8d73 |
2
Makefile
2
Makefile
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Makefile for kustomize CLI and API.
|
||||
|
||||
LATEST_RELEASE=v5.3.0
|
||||
LATEST_RELEASE=v5.4.1
|
||||
|
||||
SHELL := /usr/bin/env bash
|
||||
GOOS = $(shell go env GOOS)
|
||||
|
||||
15
api/Makefile
15
api/Makefile
@@ -11,3 +11,18 @@ build:
|
||||
|
||||
generate: $(MYGOBIN)/k8scopy $(MYGOBIN)/stringer
|
||||
go generate ./...
|
||||
|
||||
lint: lint-api-static
|
||||
|
||||
## lint-api-static runs the linter on the API module
|
||||
## with build-tag kustomize_disable_go_plugin_support
|
||||
## this aims to catch any issues with the API module
|
||||
## that would prevent the API module from being used
|
||||
## when the go plugin support is disabled.
|
||||
lint-api-static:
|
||||
$(MYGOBIN)/golangci-lint cache clean # Workaround for https://github.com/golangci/golangci-lint/issues/3228
|
||||
$(MYGOBIN)/golangci-lint \
|
||||
-c $$KUSTOMIZE_ROOT/.golangci.yml \
|
||||
--build-tags kustomize_disable_go_plugin_support \
|
||||
--path-prefix api \
|
||||
run ./...
|
||||
|
||||
@@ -10,7 +10,7 @@ require (
|
||||
go.uber.org/goleak v1.3.0
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ require (
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
@@ -71,8 +71,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -93,7 +93,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -144,7 +144,7 @@ func loadCrdIntoConfig(
|
||||
}
|
||||
_, label := property.Extensions.GetString(xLabelSelector)
|
||||
if label {
|
||||
err = theConfig.AddLabelFieldSpec(
|
||||
err = theConfig.AddCommonLabelsFieldSpec(
|
||||
makeFs(theGvk, append(path, propName)))
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -590,7 +590,7 @@ func TestNameReferenceUnhappyRun(t *testing.T) {
|
||||
func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
||||
rf := provider.NewDefaultDepProvider().GetResourceFactory()
|
||||
|
||||
v1 := rf.FromMapWithName(
|
||||
v1, err := rf.FromMapWithName(
|
||||
"volume1",
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
@@ -599,7 +599,10 @@ func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
||||
"name": "someprefix-volume1",
|
||||
},
|
||||
})
|
||||
c1 := rf.FromMapWithName(
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get new instance with given name: %v", err)
|
||||
}
|
||||
c1, err := rf.FromMapWithName(
|
||||
"claim1",
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
@@ -612,9 +615,11 @@ func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
||||
"volumeName": "volume1",
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get new instance with given name: %v", err)
|
||||
}
|
||||
v2 := v1.DeepCopy()
|
||||
c2 := rf.FromMapWithName(
|
||||
c2, err := rf.FromMapWithName(
|
||||
"claim1",
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
@@ -627,6 +632,9 @@ func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
||||
"volumeName": "someprefix-volume1",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get new instance with given name: %v", err)
|
||||
}
|
||||
|
||||
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(v1).AddR(c1).ResMap()
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ func makeResAccumulator(t *testing.T) *ResAccumulator {
|
||||
"name": "backendTwo",
|
||||
}}).ResMap())
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
t.Fatalf("failed to append resources: %v", err)
|
||||
}
|
||||
return ra
|
||||
}
|
||||
@@ -143,22 +143,26 @@ func expectLog(t *testing.T, log bytes.Buffer, expect string) {
|
||||
func TestResolveVarsVarNeedsDisambiguation(t *testing.T) {
|
||||
ra := makeResAccumulator(t)
|
||||
rm0 := resmap.New()
|
||||
err := rm0.Append(
|
||||
provider.NewDefaultDepProvider().GetResourceFactory().FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Service",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "backendOne",
|
||||
"namespace": "fooNamespace",
|
||||
},
|
||||
}))
|
||||
|
||||
r, err := provider.NewDefaultDepProvider().GetResourceFactory().FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Service",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "backendOne",
|
||||
"namespace": "fooNamespace",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
t.Fatalf("failed to get instance of resources: %v", err)
|
||||
}
|
||||
err = rm0.Append(r)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to append a resource to ResMap: %v", err)
|
||||
}
|
||||
err = ra.AppendAll(rm0)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
t.Fatalf("failed to append a resource to ResAccumulator: %v", err)
|
||||
}
|
||||
|
||||
err = ra.MergeVars([]types.Var{
|
||||
@@ -227,7 +231,11 @@ func TestResolveVarConflicts(t *testing.T) {
|
||||
// create accumulators holding apparently conflicting vars that are not
|
||||
// actually in conflict because they point to the same concrete value.
|
||||
rm0 := resmap.New()
|
||||
err := rm0.Append(rf.FromMap(fooAws))
|
||||
r0, err0 := rf.FromMap(fooAws)
|
||||
if err0 != nil {
|
||||
t.Fatalf("failed to get instance of resources: %v", err0)
|
||||
}
|
||||
err := rm0.Append(r0)
|
||||
require.NoError(t, err)
|
||||
ac0 := MakeEmptyAccumulator()
|
||||
err = ac0.AppendAll(rm0)
|
||||
@@ -236,7 +244,11 @@ func TestResolveVarConflicts(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
rm1 := resmap.New()
|
||||
err = rm1.Append(rf.FromMap(barAws))
|
||||
r1, err1 := rf.FromMap(barAws)
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get instance of resources: %v", err1)
|
||||
}
|
||||
err = rm1.Append(r1)
|
||||
require.NoError(t, err)
|
||||
ac1 := MakeEmptyAccumulator()
|
||||
err = ac1.AppendAll(rm1)
|
||||
@@ -255,7 +267,11 @@ func TestResolveVarConflicts(t *testing.T) {
|
||||
// two above (because it contains a variable whose name is used in the other
|
||||
// accumulators AND whose concrete values are different).
|
||||
rm2 := resmap.New()
|
||||
err = rm2.Append(rf.FromMap(barGcp))
|
||||
r2, err2 := rf.FromMap(barGcp)
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get instance of resources: %v", err2)
|
||||
}
|
||||
err = rm2.Append(r2)
|
||||
require.NoError(t, err)
|
||||
ac2 := MakeEmptyAccumulator()
|
||||
err = ac2.AppendAll(rm2)
|
||||
|
||||
@@ -74,34 +74,16 @@ func (p *SortOrderTransformerPlugin) Transform(m resmap.ResMap) (err error) {
|
||||
|
||||
// Sort
|
||||
if p.SortOptions.Order == types.LegacySortOrder {
|
||||
s := newLegacyIDSorter(m.AllIds(), p.SortOptions.LegacySortOptions)
|
||||
s := newLegacyIDSorter(m.Resources(), p.SortOptions.LegacySortOptions)
|
||||
sort.Sort(s)
|
||||
err = applyOrdering(m, s.resids)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// applyOrdering takes resources (given in ResMap) and a desired ordering given
|
||||
// as a sequence of ResIds, and updates the ResMap's resources to match the
|
||||
// ordering.
|
||||
func applyOrdering(m resmap.ResMap, ordering []resid.ResId) error {
|
||||
var err error
|
||||
resources := make([]*resource.Resource, m.Size())
|
||||
// Clear and refill with the correct order
|
||||
for i, id := range ordering {
|
||||
resources[i], err = m.GetByCurrentId(id)
|
||||
if err != nil {
|
||||
return errors.WrapPrefixf(err, "expected match for sorting")
|
||||
}
|
||||
}
|
||||
m.Clear()
|
||||
for _, r := range resources {
|
||||
err = m.Append(r)
|
||||
if err != nil {
|
||||
return errors.WrapPrefixf(err, "SortOrderTransformer: Failed to append to resources")
|
||||
// Clear the map and re-add the resources in the sorted order.
|
||||
m.Clear()
|
||||
for _, r := range s.resources {
|
||||
err := m.Append(r)
|
||||
if err != nil {
|
||||
return errors.WrapPrefixf(err, "SortOrderTransformer: Failed to append to resources")
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -117,12 +99,17 @@ func applyOrdering(m resmap.ResMap, ordering []resid.ResId) error {
|
||||
type legacyIDSorter struct {
|
||||
// resids only stores the metadata of the object. This is an optimization as
|
||||
// it's expensive to compute these again and again during ordering.
|
||||
resids []resid.ResId
|
||||
resids []resid.ResId
|
||||
// Initially, we sorted the metadata (ResId) of each object and then called GetByCurrentId on each to construct the final list.
|
||||
// The problem is that GetByCurrentId is inefficient and does a linear scan in a list every time we do that.
|
||||
// So instead, we sort resources alongside the ResIds.
|
||||
resources []*resource.Resource
|
||||
|
||||
typeOrders map[string]int
|
||||
}
|
||||
|
||||
func newLegacyIDSorter(
|
||||
resids []resid.ResId,
|
||||
resources []*resource.Resource,
|
||||
options *types.LegacySortOptions) *legacyIDSorter {
|
||||
// Precalculate a resource ranking based on the priority lists.
|
||||
var typeOrders = func() map[string]int {
|
||||
@@ -135,10 +122,13 @@ func newLegacyIDSorter(
|
||||
}
|
||||
return m
|
||||
}()
|
||||
return &legacyIDSorter{
|
||||
resids: resids,
|
||||
typeOrders: typeOrders,
|
||||
|
||||
ret := &legacyIDSorter{typeOrders: typeOrders}
|
||||
for _, res := range resources {
|
||||
ret.resids = append(ret.resids, res.CurId())
|
||||
ret.resources = append(ret.resources, res)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
var _ sort.Interface = legacyIDSorter{}
|
||||
@@ -146,6 +136,7 @@ var _ sort.Interface = legacyIDSorter{}
|
||||
func (a legacyIDSorter) Len() int { return len(a.resids) }
|
||||
func (a legacyIDSorter) Swap(i, j int) {
|
||||
a.resids[i], a.resids[j] = a.resids[j], a.resids[i]
|
||||
a.resources[i], a.resources[j] = a.resources[j], a.resources[i]
|
||||
}
|
||||
func (a legacyIDSorter) Less(i, j int) bool {
|
||||
if !a.resids[i].Gvk.Equals(a.resids[j].Gvk) {
|
||||
|
||||
@@ -381,7 +381,7 @@ func (lc *localizer) localizeFileWithContent(path string, content []byte) (strin
|
||||
// 2. avoid paths that temporarily traverse outside the current root,
|
||||
// i.e. ../../../scope/target/current-root. The localized file will be surrounded by
|
||||
// different directories than its source, and so an uncleaned path may no longer be valid.
|
||||
locPath = cleanFilePath(lc.fSys, lc.root, path)
|
||||
locPath = cleanedRelativePath(lc.fSys, lc.root, path)
|
||||
}
|
||||
absPath := filepath.Join(lc.dst, locPath)
|
||||
if err := lc.fSys.MkdirAll(filepath.Dir(absPath)); err != nil {
|
||||
|
||||
@@ -296,8 +296,10 @@ func TestLocalizeFileCleaned(t *testing.T) {
|
||||
kind: Kustomization
|
||||
patches:
|
||||
- path: ../gamma/../../../alpha/beta/./gamma/patch.yaml
|
||||
- path: /alpha/beta/../beta/./gamma/patch2.yaml
|
||||
`,
|
||||
"patch.yaml": podConfiguration,
|
||||
"patch.yaml": podConfiguration,
|
||||
"patch2.yaml": podConfiguration,
|
||||
}
|
||||
expected, actual := makeFileSystems(t, "/alpha/beta/gamma", kustAndPatch)
|
||||
|
||||
@@ -307,8 +309,10 @@ patches:
|
||||
kind: Kustomization
|
||||
patches:
|
||||
- path: patch.yaml
|
||||
- path: patch2.yaml
|
||||
`,
|
||||
"patch.yaml": podConfiguration,
|
||||
"patch.yaml": podConfiguration,
|
||||
"patch2.yaml": podConfiguration,
|
||||
})
|
||||
checkFSys(t, expected, actual)
|
||||
}
|
||||
@@ -1194,19 +1198,40 @@ func TestLocalizeResources(t *testing.T) {
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- pod.yaml
|
||||
- /a/b/pod2.yaml
|
||||
- ../../alpha
|
||||
`,
|
||||
"pod.yaml": podConfiguration,
|
||||
"pod.yaml": podConfiguration,
|
||||
"pod2.yaml": podConfiguration,
|
||||
"../../alpha/kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namePrefix: my-
|
||||
`,
|
||||
}
|
||||
expected, actual := makeFileSystems(t, "/a/b", kustAndResources)
|
||||
|
||||
checkRun(t, actual, "/a/b", "/", "/localized-b")
|
||||
addFiles(t, expected, "/localized-b/a/b", kustAndResources)
|
||||
checkFSys(t, expected, actual)
|
||||
// Absolute path of `/a/b/pod2.yaml` is expected to be converted to a path
|
||||
// relative to the kustomization root.
|
||||
expectedKustAndResources := map[string]string{
|
||||
"kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- pod.yaml
|
||||
- pod2.yaml
|
||||
- ../../alpha
|
||||
`,
|
||||
"pod.yaml": podConfiguration,
|
||||
"pod2.yaml": podConfiguration,
|
||||
"../../alpha/kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namePrefix: my-
|
||||
`,
|
||||
}
|
||||
|
||||
expectedFs, actualFs := makeFileSystems(t, "/a/b", kustAndResources)
|
||||
|
||||
checkRun(t, actualFs, "/a/b", "/", "/localized-b")
|
||||
addFiles(t, expectedFs, "/localized-b/a/b", expectedKustAndResources)
|
||||
checkFSys(t, expectedFs, actualFs)
|
||||
}
|
||||
|
||||
func TestLocalizePathError(t *testing.T) {
|
||||
|
||||
@@ -89,11 +89,8 @@ func (ll *Loader) Load(path string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "invalid file reference")
|
||||
}
|
||||
if filepath.IsAbs(path) {
|
||||
return nil, errors.Errorf("absolute paths not yet supported in alpha: file path %q is absolute", path)
|
||||
}
|
||||
if !loader.IsRemoteFile(path) && ll.local {
|
||||
cleanPath := cleanFilePath(ll.fSys, filesys.ConfirmedDir(ll.Root()), path)
|
||||
cleanPath := cleanedRelativePath(ll.fSys, filesys.ConfirmedDir(ll.Root()), path)
|
||||
cleanAbs := filepath.Join(ll.Root(), cleanPath)
|
||||
dir := filesys.ConfirmedDir(filepath.Dir(cleanAbs))
|
||||
// target cannot reference newDir, as this load would've failed prior to localize;
|
||||
|
||||
@@ -276,11 +276,11 @@ func TestLoadFails(t *testing.T) {
|
||||
checkNewLoader(req, ldr, &args, "/a", "/a", "/a/newDir", fSys)
|
||||
|
||||
cases := map[string]string{
|
||||
"absolute path": "/a/pod.yaml",
|
||||
"directory": "b",
|
||||
"non-existent file": "kubectl.yaml",
|
||||
"file outside root": "../alpha/beta/gamma/delta/deployment.yaml",
|
||||
"inside dst": "newDir/pod.yaml",
|
||||
"directory": "b",
|
||||
"non-existent file": "kubectl.yaml",
|
||||
"file outside root": "../alpha/beta/gamma/delta/deployment.yaml",
|
||||
"inside dst": "newDir/pod.yaml",
|
||||
"winding inside dst": "/a/test/../newDir/pod.yaml",
|
||||
}
|
||||
for name, file := range cases {
|
||||
file := file
|
||||
@@ -291,8 +291,6 @@ func TestLoadFails(t *testing.T) {
|
||||
ldr, _, err := NewLoader("./a/../a", "/a/../a", "/a/newDir", fSys)
|
||||
req.NoError(err)
|
||||
|
||||
req.NoError(fSys.WriteFile("/a/newDir/pod.yaml", []byte(podConfiguration)))
|
||||
|
||||
_, err = ldr.Load(file)
|
||||
req.Error(err)
|
||||
})
|
||||
|
||||
@@ -112,9 +112,13 @@ func hasRef(repoURL string) bool {
|
||||
return repoSpec.Ref != ""
|
||||
}
|
||||
|
||||
// cleanFilePath returns file cleaned, where file is a relative path to root on fSys
|
||||
func cleanFilePath(fSys filesys.FileSystem, root filesys.ConfirmedDir, file string) string {
|
||||
abs := root.Join(file)
|
||||
// cleanedRelativePath returns a cleaned relative path of file to root on fSys
|
||||
func cleanedRelativePath(fSys filesys.FileSystem, root filesys.ConfirmedDir, file string) string {
|
||||
abs := file
|
||||
if !filepath.IsAbs(file) {
|
||||
abs = root.Join(file)
|
||||
}
|
||||
|
||||
dir, f, err := fSys.CleanedAbs(abs)
|
||||
if err != nil {
|
||||
log.Fatalf("cannot clean validated file path %q: %s", abs, err)
|
||||
|
||||
@@ -301,3 +301,26 @@ func TestLocRootPath_SymlinkPath(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expected, actual)
|
||||
}
|
||||
|
||||
func TestCleanedRelativePath(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
require.NoError(t, fSys.MkdirAll("/root/test"))
|
||||
require.NoError(t, fSys.WriteFile("/root/test/file.yaml", []byte("")))
|
||||
require.NoError(t, fSys.WriteFile("/root/filetwo.yaml", []byte("")))
|
||||
|
||||
// Absolute path is cleaned to relative path
|
||||
cleanedPath := cleanedRelativePath(fSys, "/root/", "/root/test/file.yaml")
|
||||
require.Equal(t, "test/file.yaml", cleanedPath)
|
||||
|
||||
// Winding absolute path is cleaned to relative path
|
||||
cleanedPath = cleanedRelativePath(fSys, "/root/", "/root/test/../filetwo.yaml")
|
||||
require.Equal(t, "filetwo.yaml", cleanedPath)
|
||||
|
||||
// Already clean relative path stays the same
|
||||
cleanedPath = cleanedRelativePath(fSys, "/root/", "test/file.yaml")
|
||||
require.Equal(t, "test/file.yaml", cleanedPath)
|
||||
|
||||
// Winding relative path is cleaned
|
||||
cleanedPath = cleanedRelativePath(fSys, "/root/", "test/../filetwo.yaml")
|
||||
require.Equal(t, "filetwo.yaml", cleanedPath)
|
||||
}
|
||||
|
||||
@@ -70,30 +70,3 @@ namoPrefix:
|
||||
t.Fatalf("expected error %s, but got %s", errMsg, err)
|
||||
}
|
||||
}
|
||||
|
||||
// please remove this failing test after implements the labels support
|
||||
func TestLoadDefaultConfigsFromFilesWithMissingFieldsLabels(t *testing.T) {
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
filePathContainsTypo := "config_contains_typo.yaml"
|
||||
if err := fSys.WriteFile(filePathContainsTypo, []byte(`
|
||||
labels:
|
||||
- path: spec/podTemplate/metadata/labels
|
||||
create: true
|
||||
kind: FlinkDeployment
|
||||
`)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ldr, err := loader.NewLoader(
|
||||
loader.RestrictionRootOnly, filesys.Separator, fSys)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
errMsg := "error unmarshaling JSON: while decoding JSON: json: unknown field"
|
||||
_, err = loadDefaultConfig(ldr, []string{filePathContainsTypo})
|
||||
if err == nil {
|
||||
t.Fatalf("expected to fail unmarshal yaml, but got nil %s", filePathContainsTypo)
|
||||
}
|
||||
if !strings.Contains(err.Error(), errMsg) {
|
||||
t.Fatalf("expected error %s, but got %s", errMsg, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ type TransformerConfig struct {
|
||||
NameSuffix types.FsSlice `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"`
|
||||
NameSpace types.FsSlice `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
CommonLabels types.FsSlice `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
|
||||
Labels types.FsSlice `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
TemplateLabels types.FsSlice `json:"templateLabels,omitempty" yaml:"templateLabels,omitempty"`
|
||||
CommonAnnotations types.FsSlice `json:"commonAnnotations,omitempty" yaml:"commonAnnotations,omitempty"`
|
||||
NameReference nbrSlice `json:"nameReference,omitempty" yaml:"nameReference,omitempty"`
|
||||
@@ -41,6 +42,7 @@ func (t *TransformerConfig) DeepCopy() *TransformerConfig {
|
||||
NameSuffix: t.NameSuffix.DeepCopy(),
|
||||
NameSpace: t.NameSpace.DeepCopy(),
|
||||
CommonLabels: t.CommonLabels.DeepCopy(),
|
||||
Labels: t.Labels.DeepCopy(),
|
||||
TemplateLabels: t.TemplateLabels.DeepCopy(),
|
||||
CommonAnnotations: t.CommonAnnotations.DeepCopy(),
|
||||
NameReference: t.NameReference.DeepCopy(),
|
||||
@@ -94,6 +96,7 @@ func (t *TransformerConfig) sortFields() {
|
||||
sort.Sort(t.NameSuffix)
|
||||
sort.Sort(t.NameSpace)
|
||||
sort.Sort(t.CommonLabels)
|
||||
sort.Sort(t.Labels)
|
||||
sort.Sort(t.TemplateLabels)
|
||||
sort.Sort(t.CommonAnnotations)
|
||||
sort.Sort(t.NameReference)
|
||||
@@ -114,12 +117,18 @@ func (t *TransformerConfig) AddSuffixFieldSpec(fs types.FieldSpec) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// AddLabelFieldSpec adds a FieldSpec to CommonLabels
|
||||
func (t *TransformerConfig) AddLabelFieldSpec(fs types.FieldSpec) (err error) {
|
||||
// AddCommonLabelsFieldSpec adds a FieldSpec to CommonLabels
|
||||
func (t *TransformerConfig) AddCommonLabelsFieldSpec(fs types.FieldSpec) (err error) {
|
||||
t.CommonLabels, err = t.CommonLabels.MergeOne(fs)
|
||||
return err
|
||||
}
|
||||
|
||||
// AddLabelsFieldSpec adds a FieldSpec to Labels
|
||||
func (t *TransformerConfig) AddLabelsFieldSpec(fs types.FieldSpec) (err error) {
|
||||
t.Labels, err = t.Labels.MergeOne(fs)
|
||||
return err //nolint:wrapcheck
|
||||
}
|
||||
|
||||
// AddAnnotationFieldSpec adds a FieldSpec to CommonAnnotations
|
||||
func (t *TransformerConfig) AddAnnotationFieldSpec(fs types.FieldSpec) (err error) {
|
||||
t.CommonAnnotations, err = t.CommonAnnotations.MergeOne(fs)
|
||||
@@ -162,6 +171,10 @@ func (t *TransformerConfig) Merge(input *TransformerConfig) (
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "failed to merge CommonLabels fieldSpec")
|
||||
}
|
||||
merged.Labels, err = t.Labels.MergeAll(input.Labels)
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "failed to merge Labels fieldSpec")
|
||||
}
|
||||
merged.TemplateLabels, err = t.TemplateLabels.MergeAll(input.TemplateLabels)
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "failed to merge TemplateLabels fieldSpec")
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
package builtinconfig_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
. "sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
|
||||
"sigs.k8s.io/kustomize/api/types"
|
||||
"sigs.k8s.io/kustomize/kyaml/resid"
|
||||
@@ -35,13 +36,8 @@ func TestAddNamereferenceFieldSpec(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := cfg.AddNamereferenceFieldSpec(nbrs)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
if len(cfg.NameReference) != 1 {
|
||||
t.Fatal("failed to add namereference FieldSpec")
|
||||
}
|
||||
require.NoError(t, cfg.AddNamereferenceFieldSpec(nbrs))
|
||||
require.Len(t, cfg.NameReference, 1, "failed to add namereference FieldSpec")
|
||||
}
|
||||
|
||||
func TestAddFieldSpecs(t *testing.T) {
|
||||
@@ -53,34 +49,14 @@ func TestAddFieldSpecs(t *testing.T) {
|
||||
CreateIfNotPresent: true,
|
||||
}
|
||||
|
||||
err := cfg.AddPrefixFieldSpec(fieldSpec)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
if len(cfg.NamePrefix) != 1 {
|
||||
t.Fatalf("failed to add nameprefix FieldSpec")
|
||||
}
|
||||
err = cfg.AddSuffixFieldSpec(fieldSpec)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
if len(cfg.NameSuffix) != 1 {
|
||||
t.Fatalf("failed to add namesuffix FieldSpec")
|
||||
}
|
||||
err = cfg.AddLabelFieldSpec(fieldSpec)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
if len(cfg.CommonLabels) != 1 {
|
||||
t.Fatalf("failed to add nameprefix FieldSpec")
|
||||
}
|
||||
err = cfg.AddAnnotationFieldSpec(fieldSpec)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
if len(cfg.CommonAnnotations) != 1 {
|
||||
t.Fatalf("failed to add nameprefix FieldSpec")
|
||||
}
|
||||
require.NoError(t, cfg.AddPrefixFieldSpec(fieldSpec))
|
||||
require.Len(t, cfg.NamePrefix, 1, "failed to add nameprefix FieldSpec")
|
||||
require.NoError(t, cfg.AddSuffixFieldSpec(fieldSpec))
|
||||
require.Len(t, cfg.NameSuffix, 1, "failed to add namesuffix FieldSpec")
|
||||
require.NoError(t, cfg.AddCommonLabelsFieldSpec(fieldSpec))
|
||||
require.Len(t, cfg.CommonLabels, 1, "failed to add labels FieldSpec")
|
||||
require.NoError(t, cfg.AddAnnotationFieldSpec(fieldSpec))
|
||||
require.Len(t, cfg.CommonAnnotations, 1, "failed to add nameprefix FieldSpec")
|
||||
}
|
||||
|
||||
func TestMerge(t *testing.T) {
|
||||
@@ -127,51 +103,43 @@ func TestMerge(t *testing.T) {
|
||||
},
|
||||
}
|
||||
cfga := &TransformerConfig{}
|
||||
cfga.AddNamereferenceFieldSpec(nameReference[0])
|
||||
cfga.AddPrefixFieldSpec(fieldSpecs[0])
|
||||
cfga.AddSuffixFieldSpec(fieldSpecs[0])
|
||||
require.NoError(t, cfga.AddNamereferenceFieldSpec(nameReference[0]))
|
||||
require.NoError(t, cfga.AddPrefixFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, cfga.AddSuffixFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, cfga.AddCommonLabelsFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, cfga.AddLabelsFieldSpec(fieldSpecs[0]))
|
||||
|
||||
cfgb := &TransformerConfig{}
|
||||
cfgb.AddNamereferenceFieldSpec(nameReference[1])
|
||||
cfgb.AddPrefixFieldSpec(fieldSpecs[1])
|
||||
cfga.AddSuffixFieldSpec(fieldSpecs[1])
|
||||
require.NoError(t, cfgb.AddNamereferenceFieldSpec(nameReference[1]))
|
||||
require.NoError(t, cfgb.AddPrefixFieldSpec(fieldSpecs[1]))
|
||||
require.NoError(t, cfgb.AddSuffixFieldSpec(fieldSpecs[1]))
|
||||
require.NoError(t, cfgb.AddCommonLabelsFieldSpec(fieldSpecs[1]))
|
||||
require.NoError(t, cfgb.AddLabelsFieldSpec(fieldSpecs[1]))
|
||||
|
||||
actual, err := cfga.Merge(cfgb)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
|
||||
if len(actual.NamePrefix) != 2 {
|
||||
t.Fatal("merge failed for namePrefix FieldSpec")
|
||||
}
|
||||
|
||||
if len(actual.NameSuffix) != 2 {
|
||||
t.Fatal("merge failed for nameSuffix FieldSpec")
|
||||
}
|
||||
|
||||
if len(actual.NameReference) != 1 {
|
||||
t.Fatal("merge failed for namereference FieldSpec")
|
||||
}
|
||||
require.NoError(t, err)
|
||||
require.Len(t, actual.NamePrefix, 2, "merge failed for namePrefix FieldSpec")
|
||||
require.Len(t, actual.NameSuffix, 2, "merge failed for nameSuffix FieldSpec")
|
||||
require.Len(t, actual.NameReference, 1, "merge failed for nameReference FieldSpec")
|
||||
require.Len(t, actual.Labels, 2, "merge failed for labels FieldSpec")
|
||||
require.Len(t, actual.CommonLabels, 2, "merge failed for commonLabels FieldSpec")
|
||||
|
||||
expected := &TransformerConfig{}
|
||||
expected.AddNamereferenceFieldSpec(nameReference[0])
|
||||
expected.AddNamereferenceFieldSpec(nameReference[1])
|
||||
expected.AddPrefixFieldSpec(fieldSpecs[0])
|
||||
expected.AddPrefixFieldSpec(fieldSpecs[1])
|
||||
expected.AddSuffixFieldSpec(fieldSpecs[0])
|
||||
expected.AddSuffixFieldSpec(fieldSpecs[1])
|
||||
|
||||
if !reflect.DeepEqual(actual, expected) {
|
||||
t.Fatalf("expected: %v\n but got: %v\n", expected, actual)
|
||||
}
|
||||
require.NoError(t, expected.AddNamereferenceFieldSpec(nameReference[0]))
|
||||
require.NoError(t, expected.AddNamereferenceFieldSpec(nameReference[1]))
|
||||
require.NoError(t, expected.AddPrefixFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, expected.AddPrefixFieldSpec(fieldSpecs[1]))
|
||||
require.NoError(t, expected.AddSuffixFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, expected.AddSuffixFieldSpec(fieldSpecs[1]))
|
||||
require.NoError(t, expected.AddCommonLabelsFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, expected.AddCommonLabelsFieldSpec(fieldSpecs[1]))
|
||||
require.NoError(t, expected.AddLabelsFieldSpec(fieldSpecs[0]))
|
||||
require.NoError(t, expected.AddLabelsFieldSpec(fieldSpecs[1]))
|
||||
require.Equal(t, expected, actual)
|
||||
|
||||
actual, err = cfga.Merge(nil)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(actual, cfga) {
|
||||
t.Fatalf("expected: %v\n but got: %v\n", cfga, actual)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, cfga, actual)
|
||||
}
|
||||
|
||||
func TestMakeDefaultConfig_mutation(t *testing.T) {
|
||||
@@ -182,9 +150,7 @@ func TestMakeDefaultConfig_mutation(t *testing.T) {
|
||||
a.NameReference = a.NameReference[:1]
|
||||
|
||||
clean := MakeDefaultConfig()
|
||||
if clean.NameReference[0].Kind == "mutated" {
|
||||
t.Errorf("MakeDefaultConfig() did not return a clean copy: %+v", clean.NameReference)
|
||||
}
|
||||
assert.NotEqualf(t, "mutated", clean.NameReference[0].Kind, "MakeDefaultConfig() did not return a clean copy: %+v", clean.NameReference)
|
||||
}
|
||||
|
||||
func BenchmarkMakeDefaultConfig(b *testing.B) {
|
||||
|
||||
@@ -41,7 +41,7 @@ s/$BAR/bar baz/g
|
||||
}
|
||||
pvd := provider.NewDefaultDepProvider()
|
||||
rf := resmap.NewFactory(pvd.GetResourceFactory())
|
||||
pluginConfig := rf.RF().FromMap(
|
||||
pluginConfig, err := rf.RF().FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "someteam.example.com/v1",
|
||||
"kind": "SedTransformer",
|
||||
@@ -51,6 +51,9 @@ s/$BAR/bar baz/g
|
||||
"argsOneLiner": "one two 'foo bar'",
|
||||
"argsFromFile": "sed-input.txt",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to writes the data to a file: %v", err)
|
||||
}
|
||||
|
||||
pluginConfig.RemoveBuildAnnotations()
|
||||
pc := types.DisabledPluginConfig()
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
package loader
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"sigs.k8s.io/kustomize/api/resmap"
|
||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||
"sigs.k8s.io/kustomize/kyaml/resid"
|
||||
)
|
||||
|
||||
func (l *Loader) loadGoPlugin(_ resid.ResId, _ string) (resmap.Configurable, error) {
|
||||
return nil, errors.New("plugin load is disabled")
|
||||
return nil, fmt.Errorf("plugin load is disabled")
|
||||
}
|
||||
|
||||
@@ -32,11 +32,14 @@ func TestDeterminePluginSrcRoot(t *testing.T) {
|
||||
}
|
||||
|
||||
func makeConfigMap(rf *resource.Factory, name, behavior string, hashValue *string) *resource.Resource {
|
||||
r := rf.FromMap(map[string]interface{}{
|
||||
r, err := rf.FromMap(map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{"name": name},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
annotations := map[string]string{}
|
||||
if behavior != "" {
|
||||
annotations[BehaviorAnnotation] = behavior
|
||||
|
||||
@@ -275,13 +275,25 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
||||
if len(kt.kustomization.Labels) == 0 && len(kt.kustomization.CommonLabels) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
type labelStruct struct {
|
||||
Labels map[string]string
|
||||
FieldSpecs []types.FieldSpec
|
||||
}
|
||||
|
||||
for _, label := range kt.kustomization.Labels {
|
||||
var c struct {
|
||||
Labels map[string]string
|
||||
FieldSpecs []types.FieldSpec
|
||||
}
|
||||
var c labelStruct
|
||||
|
||||
c.Labels = label.Pairs
|
||||
fss := types.FsSlice(label.FieldSpecs)
|
||||
|
||||
// merge labels specified in the label section of transformer configs
|
||||
// these apply to selectors and templates
|
||||
fss, err := fss.MergeAll(tc.Labels)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to merge labels: %w", err)
|
||||
}
|
||||
|
||||
// merge the custom fieldSpecs with the default
|
||||
if label.IncludeSelectors {
|
||||
fss, err = fss.MergeAll(tc.CommonLabels)
|
||||
@@ -297,7 +309,7 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
||||
fss, err = fss.MergeOne(types.FieldSpec{Path: "metadata/labels", CreateIfNotPresent: true})
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("failed to merge labels: %w", err)
|
||||
}
|
||||
c.FieldSpecs = fss
|
||||
p := f()
|
||||
@@ -307,10 +319,9 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
||||
}
|
||||
result = append(result, p)
|
||||
}
|
||||
var c struct {
|
||||
Labels map[string]string
|
||||
FieldSpecs []types.FieldSpec
|
||||
}
|
||||
|
||||
var c labelStruct
|
||||
|
||||
c.Labels = kt.kustomization.CommonLabels
|
||||
c.FieldSpecs = tc.CommonLabels
|
||||
p := f()
|
||||
|
||||
@@ -191,13 +191,67 @@ metadata:
|
||||
|
||||
pvd := provider.NewDefaultDepProvider()
|
||||
resFactory := pvd.GetResourceFactory()
|
||||
name0 := "dply1"
|
||||
|
||||
resources := []*resource.Resource{
|
||||
resFactory.FromMapWithName("dply1", map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
r0, err := resFactory.FromMapWithName(name0, map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-dply1-bar",
|
||||
"namespace": "ns1",
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
"annotations": map[string]interface{}{
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
},
|
||||
"spec": map[string]interface{}{
|
||||
"replica": "3",
|
||||
"selector": map[string]interface{}{
|
||||
"matchLabels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
},
|
||||
"template": map[string]interface{}{
|
||||
"metadata": map[string]interface{}{
|
||||
"annotations": map[string]interface{}{
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get instance with given name %v: %v", name0, err)
|
||||
}
|
||||
name1 := "ns1"
|
||||
r1, err := resFactory.FromMapWithName(name1, map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Namespace",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "ns1",
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
"annotations": map[string]interface{}{
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get instance with given name %v: %v", name1, err)
|
||||
}
|
||||
|
||||
r2, _ := resFactory.FromMapWithName("literalConfigMap",
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-dply1-bar",
|
||||
"name": "foo-literalConfigMap-bar-g5f6t456f5",
|
||||
"namespace": "ns1",
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
@@ -206,30 +260,20 @@ metadata:
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
},
|
||||
"spec": map[string]interface{}{
|
||||
"replica": "3",
|
||||
"selector": map[string]interface{}{
|
||||
"matchLabels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
},
|
||||
"template": map[string]interface{}{
|
||||
"metadata": map[string]interface{}{
|
||||
"annotations": map[string]interface{}{
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
},
|
||||
},
|
||||
"data": map[string]interface{}{
|
||||
"DB_USERNAME": "admin",
|
||||
"DB_PASSWORD": "somepw",
|
||||
},
|
||||
}),
|
||||
resFactory.FromMapWithName("ns1", map[string]interface{}{
|
||||
})
|
||||
|
||||
name2 := "secret"
|
||||
r3, err := resFactory.FromMapWithName(name2,
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Namespace",
|
||||
"kind": "Secret",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "ns1",
|
||||
"name": "foo-secret-bar-82c2g5f8f6",
|
||||
"namespace": "ns1",
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
@@ -237,53 +281,21 @@ metadata:
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
},
|
||||
}),
|
||||
resFactory.FromMapWithName("literalConfigMap",
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-literalConfigMap-bar-g5f6t456f5",
|
||||
"namespace": "ns1",
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
"annotations": map[string]interface{}{
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
},
|
||||
"data": map[string]interface{}{
|
||||
"DB_USERNAME": "admin",
|
||||
"DB_PASSWORD": "somepw",
|
||||
},
|
||||
}),
|
||||
resFactory.FromMapWithName("secret",
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Secret",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-secret-bar-82c2g5f8f6",
|
||||
"namespace": "ns1",
|
||||
"labels": map[string]interface{}{
|
||||
"app": "nginx",
|
||||
},
|
||||
"annotations": map[string]interface{}{
|
||||
"note": "This is a test annotation",
|
||||
},
|
||||
},
|
||||
"type": ifc.SecretTypeOpaque,
|
||||
"data": map[string]interface{}{
|
||||
"DB_USERNAME": base64.StdEncoding.EncodeToString([]byte("admin")),
|
||||
"DB_PASSWORD": base64.StdEncoding.EncodeToString([]byte("somepw")),
|
||||
},
|
||||
}),
|
||||
"type": ifc.SecretTypeOpaque,
|
||||
"data": map[string]interface{}{
|
||||
"DB_USERNAME": base64.StdEncoding.EncodeToString([]byte("admin")),
|
||||
"DB_PASSWORD": base64.StdEncoding.EncodeToString([]byte("somepw")),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get instance with given name %v: %v", name2, err)
|
||||
}
|
||||
|
||||
resources := []*resource.Resource{r0, r1, r2, r3}
|
||||
|
||||
expected := resmap.New()
|
||||
for _, r := range resources {
|
||||
if err := expected.Append(r); err != nil {
|
||||
t.Fatalf("unexpected error %v", err)
|
||||
}
|
||||
require.NoError(t, expected.Append(r), "failed to append resource: %v")
|
||||
}
|
||||
expected.RemoveBuildAnnotations()
|
||||
expYaml, err := expected.AsYaml()
|
||||
@@ -354,31 +366,43 @@ metadata:
|
||||
pvd := provider.NewDefaultDepProvider()
|
||||
resFactory := pvd.GetResourceFactory()
|
||||
|
||||
resources := []*resource.Resource{
|
||||
resFactory.FromMapWithName("deployment1", map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-deployment1-bar",
|
||||
"namespace": "ns1",
|
||||
},
|
||||
}), resFactory.FromMapWithName("config", map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "config-bar",
|
||||
"namespace": "ns1",
|
||||
},
|
||||
}), resFactory.FromMapWithName("secret", map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Secret",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-secret",
|
||||
"namespace": "ns1",
|
||||
},
|
||||
}),
|
||||
name0 := "deployment1"
|
||||
r0, err0 := resFactory.FromMapWithName(name0, map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-deployment1-bar",
|
||||
"namespace": "ns1",
|
||||
},
|
||||
})
|
||||
if err0 != nil {
|
||||
t.Fatalf("failed to get instance with given name %v: %v", name0, err0)
|
||||
}
|
||||
|
||||
name1 := "config"
|
||||
r1, err1 := resFactory.FromMapWithName(name1, map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "config-bar",
|
||||
"namespace": "ns1",
|
||||
},
|
||||
})
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get instance with given name %v: %v", name1, err1)
|
||||
}
|
||||
name2 := "secret"
|
||||
r2, err2 := resFactory.FromMapWithName(name2, map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Secret",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "foo-secret",
|
||||
"namespace": "ns1",
|
||||
},
|
||||
})
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get instance with given name %v: %v", name2, err2)
|
||||
}
|
||||
var resources = []*resource.Resource{r0, r1, r2}
|
||||
expected := resmap.New()
|
||||
for _, r := range resources {
|
||||
err := expected.Append(r)
|
||||
|
||||
@@ -31,6 +31,20 @@ spec:
|
||||
- port: 7002
|
||||
`
|
||||
|
||||
const invalidResource = `apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kapacitor
|
||||
labels:
|
||||
app.kubernetes.io/name: tick-kapacitor
|
||||
spec:
|
||||
selector:
|
||||
app.kubernetes.io/name: tick-kapacitor
|
||||
- name: http
|
||||
port: 9092
|
||||
protocol: TCP
|
||||
type: ClusterIP`
|
||||
|
||||
func TestTargetMustHaveKustomizationFile(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
th.WriteF("service.yaml", `
|
||||
@@ -302,6 +316,14 @@ resources:
|
||||
// know resource is file.
|
||||
errDir: `new root '%s' cannot be absolute`,
|
||||
},
|
||||
{
|
||||
name: "malformed yaml yields an error",
|
||||
resource: "service.yaml",
|
||||
files: map[string]string{
|
||||
"service.yaml": invalidResource,
|
||||
},
|
||||
errFile: "MalformedYAMLError",
|
||||
},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
if test.resourceFunc != nil {
|
||||
@@ -338,5 +360,4 @@ resources:
|
||||
// TODO(annasong): add tests that check accumulateResources errors for
|
||||
// - repos
|
||||
// - local directories
|
||||
// - files that yield malformed yaml errors
|
||||
}
|
||||
|
||||
@@ -335,3 +335,400 @@ spec:
|
||||
location: Arizona
|
||||
`)
|
||||
}
|
||||
|
||||
func TestLabelTransformerConfig(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
kustomization string
|
||||
transformerConfig string
|
||||
expectedResult string
|
||||
}{
|
||||
{
|
||||
name: "includeSelectors=false, includeTemplates=false, include template via transformerConfig",
|
||||
kustomization: `configurations:
|
||||
- config/configurations.yaml
|
||||
|
||||
labels:
|
||||
- includeSelectors: false
|
||||
includeTemplates: false
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/deployment.yaml
|
||||
`,
|
||||
transformerConfig: `labels:
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: Deployment
|
||||
`,
|
||||
expectedResult: `apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-deploy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sample-deploy
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
spec:
|
||||
containers:
|
||||
- image: hello-world:latest
|
||||
name: hello-world
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "includeSelectors=true, includeTemplates=false, include template via transformerConfig",
|
||||
kustomization: `configurations:
|
||||
- config/configurations.yaml
|
||||
|
||||
labels:
|
||||
- includeSelectors: true
|
||||
includeTemplates: false
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/deployment.yaml
|
||||
`,
|
||||
transformerConfig: `labels:
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: Deployment
|
||||
`,
|
||||
expectedResult: `apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-deploy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
spec:
|
||||
containers:
|
||||
- image: hello-world:latest
|
||||
name: hello-world
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "includeSelectors=false, includeTemplates=true, no transformerConfig",
|
||||
kustomization: `labels:
|
||||
- includeSelectors: false
|
||||
includeTemplates: true
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/deployment.yaml
|
||||
`,
|
||||
expectedResult: `apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-deploy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sample-deploy
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
spec:
|
||||
containers:
|
||||
- image: hello-world:latest
|
||||
name: hello-world
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "includeSelectors=false, includeTemplates=false, no transformerConfig",
|
||||
kustomization: `labels:
|
||||
- includeSelectors: false
|
||||
includeTemplates: false
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/deployment.yaml
|
||||
`,
|
||||
expectedResult: `apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-deploy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sample-deploy
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
spec:
|
||||
containers:
|
||||
- image: hello-world:latest
|
||||
name: hello-world
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
th.WriteK(".", tc.kustomization)
|
||||
th.WriteF("resources/deployment.yaml",
|
||||
`apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
name: sample-deploy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sample-deploy
|
||||
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: sample-deploy
|
||||
spec:
|
||||
containers:
|
||||
- image: hello-world:latest
|
||||
name: hello-world
|
||||
`)
|
||||
if tc.transformerConfig != "" {
|
||||
th.WriteF("config/configurations.yaml", tc.transformerConfig)
|
||||
}
|
||||
|
||||
output := th.Run(".", th.MakeDefaultOptions())
|
||||
|
||||
th.AssertActualEqualsExpected(output, tc.expectedResult)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestLabelTransformerConfigWithCustomResources(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
kustomization string
|
||||
transformerConfig string
|
||||
expectedResult string
|
||||
}{
|
||||
{
|
||||
name: "include template via transformerConfig",
|
||||
kustomization: `configurations:
|
||||
- config/configurations.yaml
|
||||
|
||||
labels:
|
||||
- includeSelectors: false
|
||||
includeTemplates: false
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/custom-resource.yaml
|
||||
`,
|
||||
transformerConfig: `labels:
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: SampleResource
|
||||
`,
|
||||
expectedResult: `apiVersion: custom.example.org/v1
|
||||
kind: SampleResource
|
||||
metadata:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-resource
|
||||
namespace: sample-namespace
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: VARIABLE
|
||||
value: value
|
||||
image: index.docker.io/library/hello-world
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "include selector via transformerConfig",
|
||||
kustomization: `configurations:
|
||||
- config/configurations.yaml
|
||||
|
||||
labels:
|
||||
- includeSelectors: false
|
||||
includeTemplates: false
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/custom-resource.yaml
|
||||
`,
|
||||
transformerConfig: `labels:
|
||||
- path: spec/selectors/labels
|
||||
create: true
|
||||
kind: SampleResource
|
||||
`,
|
||||
expectedResult: `apiVersion: custom.example.org/v1
|
||||
kind: SampleResource
|
||||
metadata:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-resource
|
||||
namespace: sample-namespace
|
||||
spec:
|
||||
selectors:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: VARIABLE
|
||||
value: value
|
||||
image: index.docker.io/library/hello-world
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "include selectors and labels via transformerConfig",
|
||||
kustomization: `configurations:
|
||||
- config/configurations.yaml
|
||||
|
||||
labels:
|
||||
- includeSelectors: false
|
||||
includeTemplates: false
|
||||
pairs:
|
||||
location: planet-earth
|
||||
environment: dev
|
||||
|
||||
resources:
|
||||
- resources/custom-resource.yaml
|
||||
`,
|
||||
transformerConfig: `
|
||||
labels:
|
||||
- path: spec/selectors/labels
|
||||
create: true
|
||||
kind: SampleResource
|
||||
- path: spec/template/metadata/labels
|
||||
create: true
|
||||
kind: SampleResource
|
||||
`,
|
||||
expectedResult: `apiVersion: custom.example.org/v1
|
||||
kind: SampleResource
|
||||
metadata:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
name: sample-resource
|
||||
namespace: sample-namespace
|
||||
spec:
|
||||
selectors:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
environment: dev
|
||||
location: planet-earth
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: VARIABLE
|
||||
value: value
|
||||
image: index.docker.io/library/hello-world
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
th.WriteK(".", tc.kustomization)
|
||||
th.WriteF("resources/custom-resource.yaml",
|
||||
`apiVersion: custom.example.org/v1
|
||||
kind: SampleResource
|
||||
metadata:
|
||||
name: sample-resource
|
||||
namespace: sample-namespace
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: index.docker.io/library/hello-world
|
||||
env:
|
||||
- name: VARIABLE
|
||||
value: value
|
||||
`)
|
||||
|
||||
th.WriteF("config/configurations.yaml", tc.transformerConfig)
|
||||
|
||||
output := th.Run(".", th.MakeDefaultOptions())
|
||||
|
||||
th.AssertActualEqualsExpected(output, tc.expectedResult)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,14 +67,22 @@ func GetProvenance() Provenance {
|
||||
|
||||
for _, dep := range info.Deps {
|
||||
if dep != nil && dep.Path == "sigs.k8s.io/kustomize/kustomize/v5" {
|
||||
p.Version = GetMostRecentTag(*dep)
|
||||
if dep.Version != "devel" {
|
||||
continue
|
||||
}
|
||||
v, err := GetMostRecentTag(*dep)
|
||||
if err != nil {
|
||||
fmt.Printf("failed to get most recent tag for %s: %v\n", dep.Path, err)
|
||||
continue
|
||||
}
|
||||
p.Version = v
|
||||
}
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
func GetMostRecentTag(m debug.Module) string {
|
||||
func GetMostRecentTag(m debug.Module) (string, error) {
|
||||
for m.Replace != nil {
|
||||
m = *m.Replace
|
||||
}
|
||||
@@ -83,13 +91,13 @@ func GetMostRecentTag(m debug.Module) string {
|
||||
sv, err := semver.Parse(strings.TrimPrefix(split[0], "v"))
|
||||
|
||||
if err != nil {
|
||||
return "unknown"
|
||||
return "", fmt.Errorf("failed to parse version %s: %w", m.Version, err)
|
||||
}
|
||||
|
||||
if len(split) > 1 && sv.Patch > 0 {
|
||||
sv.Patch -= 1
|
||||
}
|
||||
return fmt.Sprintf("v%s", sv.FinalizeVersion())
|
||||
return fmt.Sprintf("v%s", sv.FinalizeVersion()), nil
|
||||
}
|
||||
|
||||
// Short returns the shortened provenance stamp.
|
||||
|
||||
@@ -59,6 +59,7 @@ func TestGetMostRecentTag(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
module debug.Module
|
||||
isError bool
|
||||
expectedTag string
|
||||
}{
|
||||
{
|
||||
@@ -72,9 +73,9 @@ func TestGetMostRecentTag(t *testing.T) {
|
||||
expectedTag: "v0.0.0",
|
||||
},
|
||||
{
|
||||
name: "Invalid semver string",
|
||||
module: mockModule("invalid-version"),
|
||||
expectedTag: "unknown",
|
||||
name: "Invalid semver string",
|
||||
module: mockModule("invalid-version"),
|
||||
isError: true,
|
||||
},
|
||||
{
|
||||
name: "Valid semver with patch increment and pre-release info",
|
||||
@@ -90,8 +91,14 @@ func TestGetMostRecentTag(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tag := provenance.GetMostRecentTag(tt.module)
|
||||
assert.Equal(t, tt.expectedTag, tag)
|
||||
tag, err := provenance.GetMostRecentTag(tt.module)
|
||||
if err != nil {
|
||||
if !tt.isError {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
} else {
|
||||
assert.Equal(t, tt.expectedTag, tag)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ func doRemove(t *testing.T, w ResMap, id resid.ResId) {
|
||||
|
||||
// Make a resource with a predictable name.
|
||||
func makeCm(i int) *resource.Resource {
|
||||
return rf.FromMap(
|
||||
r, err := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -81,6 +81,10 @@ func makeCm(i int) *resource.Resource {
|
||||
"name": fmt.Sprintf("cm%03d", i),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// Maintain the class invariant that no two
|
||||
@@ -229,7 +233,7 @@ metadata:
|
||||
func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
cmap := resid.NewGvk("", "v1", "ConfigMap")
|
||||
|
||||
r1 := rf.FromMap(
|
||||
r1, err1 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -237,7 +241,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
"name": "alice",
|
||||
},
|
||||
})
|
||||
r2 := rf.FromMap(
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err1)
|
||||
}
|
||||
r2, err2 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -245,7 +252,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
"name": "bob",
|
||||
},
|
||||
})
|
||||
r3 := rf.FromMap(
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err2)
|
||||
}
|
||||
r3, err3 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -254,7 +264,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
r4 := rf.FromMap(
|
||||
if err3 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err3)
|
||||
}
|
||||
r4, err4 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -263,7 +276,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
r5 := rf.FromMap(
|
||||
if err4 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err4)
|
||||
}
|
||||
r5, err5 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Deployment",
|
||||
@@ -272,6 +288,9 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
if err5 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err5)
|
||||
}
|
||||
|
||||
m := resmaptest_test.NewRmBuilder(t, rf).
|
||||
AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap()
|
||||
@@ -367,7 +386,7 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
r1 := rf.FromMap(
|
||||
r1, err1 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -380,7 +399,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
r2 := rf.FromMap(
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err1)
|
||||
}
|
||||
r2, err2 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -393,7 +415,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
r3 := rf.FromMap(
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err2)
|
||||
}
|
||||
r3, err3 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -407,7 +432,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
r4 := rf.FromMap(
|
||||
if err3 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err3)
|
||||
}
|
||||
r4, err4 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -421,7 +449,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
r5 := rf.FromMap(
|
||||
if err4 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err4)
|
||||
}
|
||||
r5, err5 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Deployment",
|
||||
@@ -430,6 +461,9 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
if err5 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err5)
|
||||
}
|
||||
|
||||
m := resmaptest_test.NewRmBuilder(t, rf).
|
||||
AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap()
|
||||
@@ -498,7 +532,7 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
r1 := rf.FromMap(
|
||||
r1, err1 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -506,7 +540,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"name": "alice",
|
||||
},
|
||||
})
|
||||
r2 := rf.FromMap(
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err1)
|
||||
}
|
||||
r2, err2 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -514,7 +551,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"name": "bob",
|
||||
},
|
||||
})
|
||||
r3 := rf.FromMap(
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err2)
|
||||
}
|
||||
r3, err3 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -523,7 +563,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
r4 := rf.FromMap(
|
||||
if err3 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err3)
|
||||
}
|
||||
r4, err4 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
@@ -532,7 +575,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
r5 := rf.FromMap(
|
||||
if err4 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err4)
|
||||
}
|
||||
r5, err5 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -541,8 +587,11 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
if err5 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err5)
|
||||
}
|
||||
r5.AddNamePrefix("little-")
|
||||
r6 := rf.FromMap(
|
||||
r6, err6 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
@@ -551,8 +600,11 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"namespace": "happy",
|
||||
},
|
||||
})
|
||||
if err6 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err6)
|
||||
}
|
||||
r6.AddNamePrefix("little-")
|
||||
r7 := rf.FromMap(
|
||||
r7, err7 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "rbac.authorization.k8s.io/v1",
|
||||
"kind": "ClusterRoleBinding",
|
||||
@@ -560,6 +612,9 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||
"name": "meh",
|
||||
},
|
||||
})
|
||||
if err7 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err7)
|
||||
}
|
||||
|
||||
tests := map[string]struct {
|
||||
filter *resource.Resource
|
||||
@@ -639,7 +694,7 @@ func TestDeepCopy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestErrorIfNotEqualSets(t *testing.T) {
|
||||
r1 := rf.FromMap(
|
||||
r1, err1 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -647,7 +702,10 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
||||
"name": "cm1",
|
||||
},
|
||||
})
|
||||
r2 := rf.FromMap(
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err1)
|
||||
}
|
||||
r2, err2 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -655,7 +713,10 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
||||
"name": "cm2",
|
||||
},
|
||||
})
|
||||
r3 := rf.FromMap(
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err2)
|
||||
}
|
||||
r3, err3 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -664,6 +725,9 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
||||
"namespace": "system",
|
||||
},
|
||||
})
|
||||
if err3 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err3)
|
||||
}
|
||||
|
||||
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(r1).AddR(r2).AddR(r3).ResMap()
|
||||
if err := m1.ErrorIfNotEqualSets(m1); err != nil {
|
||||
@@ -712,7 +776,7 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestErrorIfNotEqualLists(t *testing.T) {
|
||||
r1 := rf.FromMap(
|
||||
r1, err1 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -720,7 +784,10 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
||||
"name": "cm1",
|
||||
},
|
||||
})
|
||||
r2 := rf.FromMap(
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err1)
|
||||
}
|
||||
r2, err2 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -728,7 +795,10 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
||||
"name": "cm2",
|
||||
},
|
||||
})
|
||||
r3 := rf.FromMap(
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err2)
|
||||
}
|
||||
r3, err3 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
@@ -737,6 +807,9 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
||||
"namespace": "system",
|
||||
},
|
||||
})
|
||||
if err3 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err3)
|
||||
}
|
||||
|
||||
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(r1).AddR(r2).AddR(r3).ResMap()
|
||||
if err := m1.ErrorIfNotEqualLists(m1); err != nil {
|
||||
@@ -780,7 +853,7 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAppendAll(t *testing.T) {
|
||||
r1 := rf.FromMap(
|
||||
r1, err1 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
@@ -788,8 +861,11 @@ func TestAppendAll(t *testing.T) {
|
||||
"name": "foo-deploy1",
|
||||
},
|
||||
})
|
||||
if err1 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err1)
|
||||
}
|
||||
input1 := rmF.FromResource(r1)
|
||||
r2 := rf.FromMap(
|
||||
r2, err2 := rf.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "StatefulSet",
|
||||
@@ -797,6 +873,9 @@ func TestAppendAll(t *testing.T) {
|
||||
"name": "bar-stateful",
|
||||
},
|
||||
})
|
||||
if err2 != nil {
|
||||
t.Fatalf("failed to get new instance: %v", err2)
|
||||
}
|
||||
input2 := rmF.FromResource(r2)
|
||||
|
||||
expected := New()
|
||||
|
||||
@@ -41,28 +41,26 @@ func (rf *Factory) Hasher() ifc.KustHasher {
|
||||
}
|
||||
|
||||
// FromMap returns a new instance of Resource.
|
||||
func (rf *Factory) FromMap(m map[string]interface{}) *Resource {
|
||||
func (rf *Factory) FromMap(m map[string]interface{}) (*Resource, error) {
|
||||
res, err := rf.FromMapAndOption(m, nil)
|
||||
if err != nil {
|
||||
// TODO: return err instead of log.
|
||||
log.Fatalf("failed to create resource from map: %v", err)
|
||||
return nil, fmt.Errorf("failed to create resource from map: %w", err)
|
||||
}
|
||||
return res
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// FromMapWithName returns a new instance with the given "original" name.
|
||||
func (rf *Factory) FromMapWithName(n string, m map[string]interface{}) *Resource {
|
||||
func (rf *Factory) FromMapWithName(n string, m map[string]interface{}) (*Resource, error) {
|
||||
return rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m)
|
||||
}
|
||||
|
||||
// FromMapWithNamespaceAndName returns a new instance with the given "original" namespace.
|
||||
func (rf *Factory) FromMapWithNamespaceAndName(ns string, n string, m map[string]interface{}) *Resource {
|
||||
func (rf *Factory) FromMapWithNamespaceAndName(ns string, n string, m map[string]interface{}) (*Resource, error) {
|
||||
r, err := rf.FromMapAndOption(m, nil)
|
||||
if err != nil {
|
||||
// TODO: return err instead of log.
|
||||
log.Fatalf("failed to create resource from map: %v", err)
|
||||
return nil, fmt.Errorf("failed to create resource from map: %w", err)
|
||||
}
|
||||
return r.setPreviousId(ns, n, r.GetKind())
|
||||
return r.setPreviousId(ns, n, r.GetKind()), nil
|
||||
}
|
||||
|
||||
// FromMapAndOption returns a new instance of Resource with given options.
|
||||
|
||||
@@ -274,24 +274,32 @@ kind: List
|
||||
},
|
||||
},
|
||||
}
|
||||
testDeploymentA := factory.FromMap(
|
||||
deploymentA := "deployment-a"
|
||||
testDeploymentA, errA := factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "deployment-a",
|
||||
"name": deploymentA,
|
||||
},
|
||||
"spec": testDeploymentSpec,
|
||||
})
|
||||
testDeploymentB := factory.FromMap(
|
||||
if errA != nil {
|
||||
t.Fatalf("failed to create new instance with %v: %v", deploymentA, errA)
|
||||
}
|
||||
deploymentB := "deployment-b"
|
||||
testDeploymentB, errB := factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "deployment-b",
|
||||
"name": deploymentB,
|
||||
},
|
||||
"spec": testDeploymentSpec,
|
||||
})
|
||||
if errB != nil {
|
||||
t.Fatalf("failed to create new instance with %v: %v", deploymentB, errB)
|
||||
}
|
||||
|
||||
fSys := filesys.MakeFsInMemory()
|
||||
fSys.WriteFile(string(patchGood1), []byte(patch1))
|
||||
@@ -308,6 +316,16 @@ kind: List
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test deployment: %v", err)
|
||||
}
|
||||
|
||||
tc, err := createTestConfigMap()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test config: %v", err)
|
||||
}
|
||||
|
||||
tests := map[string]struct {
|
||||
input []types.PatchStrategicMerge
|
||||
expectedOut []*Resource
|
||||
@@ -315,7 +333,7 @@ kind: List
|
||||
}{
|
||||
"happy": {
|
||||
input: []types.PatchStrategicMerge{patchGood1, patchGood2},
|
||||
expectedOut: []*Resource{testDeployment, testConfigMap},
|
||||
expectedOut: []*Resource{td, tc},
|
||||
expectedErr: false,
|
||||
},
|
||||
"badFileName": {
|
||||
@@ -330,7 +348,7 @@ kind: List
|
||||
},
|
||||
"listOfPatches": {
|
||||
input: []types.PatchStrategicMerge{patchList},
|
||||
expectedOut: []*Resource{testDeployment, testConfigMap},
|
||||
expectedOut: []*Resource{td, tc},
|
||||
expectedErr: false,
|
||||
},
|
||||
"listWithAnchorReference": {
|
||||
|
||||
@@ -12,21 +12,45 @@ import (
|
||||
|
||||
func TestIdSet_Empty(t *testing.T) {
|
||||
s := MakeIdSet([]*Resource{})
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create test deployment: %v", err)
|
||||
}
|
||||
tc, err := createTestConfigMap()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create test config: %v", err)
|
||||
}
|
||||
assert.Equal(t, 0, s.Size())
|
||||
assert.False(t, s.Contains(testDeployment.CurId()))
|
||||
assert.False(t, s.Contains(testConfigMap.CurId()))
|
||||
assert.False(t, s.Contains(td.CurId()))
|
||||
assert.False(t, s.Contains(tc.CurId()))
|
||||
}
|
||||
|
||||
func TestIdSet_One(t *testing.T) {
|
||||
s := MakeIdSet([]*Resource{testDeployment})
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test deployment: %v", err)
|
||||
}
|
||||
tc, err := createTestConfigMap()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test config: %v", err)
|
||||
}
|
||||
s := MakeIdSet([]*Resource{td})
|
||||
assert.Equal(t, 1, s.Size())
|
||||
assert.True(t, s.Contains(testDeployment.CurId()))
|
||||
assert.False(t, s.Contains(testConfigMap.CurId()))
|
||||
assert.True(t, s.Contains(td.CurId()))
|
||||
assert.False(t, s.Contains(tc.CurId()))
|
||||
}
|
||||
|
||||
func TestIdSet_Two(t *testing.T) {
|
||||
s := MakeIdSet([]*Resource{testDeployment, testConfigMap})
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test Deployment: %v", err)
|
||||
}
|
||||
tc, err := createTestConfigMap()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test Config: %v", err)
|
||||
}
|
||||
s := MakeIdSet([]*Resource{td, tc})
|
||||
assert.Equal(t, 2, s.Size())
|
||||
assert.True(t, s.Contains(testDeployment.CurId()))
|
||||
assert.True(t, s.Contains(testConfigMap.CurId()))
|
||||
assert.True(t, s.Contains(td.CurId()))
|
||||
assert.True(t, s.Contains(tc.CurId()))
|
||||
}
|
||||
|
||||
@@ -20,27 +20,39 @@ import (
|
||||
|
||||
var factory = provider.NewDefaultDepProvider().GetResourceFactory()
|
||||
|
||||
var testConfigMap = factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "winnie",
|
||||
"namespace": "hundred-acre-wood",
|
||||
},
|
||||
})
|
||||
func createTestConfigMap() (*Resource, error) {
|
||||
res, err := factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMap",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "winnie",
|
||||
"namespace": "hundred-acre-wood",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create test config: %w", err)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
//nolint:gosec
|
||||
const configMapAsString = `{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"winnie","namespace":"hundred-acre-wood"}}`
|
||||
|
||||
var testDeployment = factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "pooh",
|
||||
},
|
||||
})
|
||||
func createTestDeployment() (*Resource, error) {
|
||||
res, err := factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
"metadata": map[string]interface{}{
|
||||
"name": "pooh",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create Deployment: %w", err)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
const deploymentAsString = `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"pooh"}}`
|
||||
|
||||
@@ -50,9 +62,13 @@ kind: Deployment
|
||||
metadata:
|
||||
name: pooh
|
||||
`
|
||||
yaml, err := testDeployment.AsYAML()
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Fatalf("failed to create test deployment: %s", err)
|
||||
}
|
||||
yaml, err := td.AsYAML()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get yaml: %s", err)
|
||||
}
|
||||
if string(yaml) != expected {
|
||||
t.Fatalf("--- expected\n%s\n--- got\n%s\n", expected, string(yaml))
|
||||
@@ -60,16 +76,24 @@ metadata:
|
||||
}
|
||||
|
||||
func TestResourceString(t *testing.T) {
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test deployment: %v", err)
|
||||
}
|
||||
tc, err := createTestConfigMap()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test config: %v", err)
|
||||
}
|
||||
tests := []struct {
|
||||
in *Resource
|
||||
s string
|
||||
}{
|
||||
{
|
||||
in: testConfigMap,
|
||||
in: tc,
|
||||
s: configMapAsString,
|
||||
},
|
||||
{
|
||||
in: testDeployment,
|
||||
in: td,
|
||||
s: deploymentAsString,
|
||||
},
|
||||
}
|
||||
@@ -79,18 +103,26 @@ func TestResourceString(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResourceId(t *testing.T) {
|
||||
td, err := createTestDeployment()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test deployment: %v", err)
|
||||
}
|
||||
tc, err := createTestConfigMap()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test config: %v", err)
|
||||
}
|
||||
tests := []struct {
|
||||
in *Resource
|
||||
id resid.ResId
|
||||
}{
|
||||
{
|
||||
in: testConfigMap,
|
||||
in: tc,
|
||||
id: resid.NewResIdWithNamespace(
|
||||
resid.NewGvk("", "v1", "ConfigMap"),
|
||||
"winnie", "hundred-acre-wood"),
|
||||
},
|
||||
{
|
||||
in: testDeployment,
|
||||
in: td,
|
||||
id: resid.NewResId(
|
||||
resid.NewGvk("apps", "v1", "Deployment"), "pooh"),
|
||||
},
|
||||
@@ -103,7 +135,7 @@ func TestResourceId(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeepCopy(t *testing.T) {
|
||||
r := factory.FromMap(
|
||||
r, err := factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "apps/v1",
|
||||
"kind": "Deployment",
|
||||
@@ -111,6 +143,9 @@ func TestDeepCopy(t *testing.T) {
|
||||
"name": "pooh",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create test config: %v", err)
|
||||
}
|
||||
r.AppendRefBy(resid.NewResId(resid.Gvk{Group: "somegroup", Kind: "MyKind"}, "random"))
|
||||
|
||||
var1 := types.Var{
|
||||
|
||||
@@ -41,7 +41,11 @@ func NewSeededRmBuilderDefault(t *testing.T, m resmap.ResMap) *rmBuilder {
|
||||
}
|
||||
|
||||
func (rm *rmBuilder) Add(m map[string]interface{}) *rmBuilder {
|
||||
return rm.AddR(rm.rf.FromMap(m))
|
||||
r, err := rm.rf.FromMap(m)
|
||||
if err != nil {
|
||||
rm.t.Fatalf("test setup failure: %v", err)
|
||||
}
|
||||
return rm.AddR(r)
|
||||
}
|
||||
|
||||
func (rm *rmBuilder) AddR(r *resource.Resource) *rmBuilder {
|
||||
@@ -53,7 +57,11 @@ func (rm *rmBuilder) AddR(r *resource.Resource) *rmBuilder {
|
||||
}
|
||||
|
||||
func (rm *rmBuilder) AddWithName(n string, m map[string]interface{}) *rmBuilder {
|
||||
err := rm.m.Append(rm.rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m))
|
||||
r, err := rm.rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m)
|
||||
if err != nil {
|
||||
rm.t.Fatalf("test setup failure: %v", err)
|
||||
}
|
||||
err = rm.m.Append(r)
|
||||
if err != nil {
|
||||
rm.t.Fatalf("test setup failure: %v", err)
|
||||
}
|
||||
@@ -61,7 +69,11 @@ func (rm *rmBuilder) AddWithName(n string, m map[string]interface{}) *rmBuilder
|
||||
}
|
||||
|
||||
func (rm *rmBuilder) AddWithNsAndName(ns string, n string, m map[string]interface{}) *rmBuilder {
|
||||
err := rm.m.Append(rm.rf.FromMapWithNamespaceAndName(ns, n, m))
|
||||
r, err := rm.rf.FromMapWithNamespaceAndName(ns, n, m)
|
||||
if err != nil {
|
||||
rm.t.Fatalf("test setup failure: %v", err)
|
||||
}
|
||||
err = rm.m.Append(r)
|
||||
if err != nil {
|
||||
rm.t.Fatalf("test setup failure: %v", err)
|
||||
}
|
||||
@@ -69,7 +81,7 @@ func (rm *rmBuilder) AddWithNsAndName(ns string, n string, m map[string]interfac
|
||||
}
|
||||
|
||||
func (rm *rmBuilder) ReplaceResource(m map[string]interface{}) *rmBuilder {
|
||||
r := rm.rf.FromMap(m)
|
||||
r, _ := rm.rf.FromMap(m)
|
||||
_, err := rm.m.Replace(r)
|
||||
if err != nil {
|
||||
rm.t.Fatalf("test setup failure: %v", err)
|
||||
|
||||
@@ -6,12 +6,12 @@ package types
|
||||
type Label struct {
|
||||
// Pairs contains the key-value pairs for labels to add
|
||||
Pairs map[string]string `json:"pairs,omitempty" yaml:"pairs,omitempty"`
|
||||
// IncludeSelectors inidicates should transformer include the
|
||||
// IncludeSelectors indicates whether the transformer should include the
|
||||
// fieldSpecs for selectors. Custom fieldSpecs specified by
|
||||
// FieldSpecs will be merged with builtin fieldSpecs if this
|
||||
// is true.
|
||||
IncludeSelectors bool `json:"includeSelectors,omitempty" yaml:"includeSelectors,omitempty"`
|
||||
// IncludeTemplates inidicates should transformer include the
|
||||
// IncludeTemplates indicates whether the transformer should include the
|
||||
// spec/template/metadata fieldSpec. Custom fieldSpecs specified by
|
||||
// FieldSpecs will be merged with spec/template/metadata fieldSpec if this
|
||||
// is true. If IncludeSelectors is true, IncludeTemplates is not needed.
|
||||
|
||||
@@ -7,7 +7,7 @@ require (
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/stretchr/testify v1.8.4
|
||||
gopkg.in/inf.v0 v0.9.1
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -26,7 +26,7 @@ require (
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -71,8 +71,8 @@ github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -93,7 +93,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.21
|
||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
@@ -20,7 +20,7 @@ require (
|
||||
github.com/spf13/cobra v1.8.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -67,8 +67,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.21
|
||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
@@ -20,7 +20,7 @@ require (
|
||||
github.com/spf13/cobra v1.8.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -67,8 +67,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.21
|
||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
@@ -20,7 +20,7 @@ require (
|
||||
github.com/spf13/cobra v1.8.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -67,8 +67,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.21
|
||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
@@ -20,7 +20,7 @@ require (
|
||||
github.com/spf13/cobra v1.8.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -67,8 +67,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
|
||||
@@ -44,10 +44,10 @@ require (
|
||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||
github.com/spf13/cobra v1.8.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
golang.org/x/net v0.21.0 // indirect
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
golang.org/x/oauth2 v0.12.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/term v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/term v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/tools v0.18.0 // indirect
|
||||
|
||||
@@ -432,8 +432,8 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -477,10 +477,10 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
|
||||
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -28,7 +28,7 @@ require (
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
|
||||
@@ -324,8 +324,8 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -5,12 +5,12 @@ go 1.21
|
||||
require (
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/stretchr/testify v1.8.4
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
@@ -26,7 +26,7 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
||||
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
@@ -77,8 +77,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee33
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -98,7 +98,7 @@ k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSn
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -35,7 +35,7 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/net v0.21.0 // indirect
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
golang.org/x/oauth2 v0.12.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
|
||||
@@ -662,8 +662,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -748,11 +748,11 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
|
||||
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
|
||||
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -10,7 +10,7 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-logr/logr v1.3.0 // indirect
|
||||
@@ -36,8 +36,8 @@ require (
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/net v0.21.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
@@ -131,8 +131,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -143,8 +143,8 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.21
|
||||
require sigs.k8s.io/kustomize/kyaml v0.13.7
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
|
||||
@@ -46,9 +46,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.21
|
||||
require sigs.k8s.io/kustomize/kyaml v0.13.7
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
|
||||
@@ -46,9 +46,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
|
||||
@@ -37,7 +37,7 @@ require (
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
@@ -559,8 +559,8 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -178,6 +178,7 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IU
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
|
||||
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/aws/aws-sdk-go-v2/service/kms v1.5.0 h1:10e9mzaaYIIePEuxUzW5YJ8LKHNG/NX63evcvS3ux9U=
|
||||
github.com/aws/aws-sdk-go-v2/service/kms v1.5.0/go.mod h1:w7JuP9Oq1IKMFQPkNe3V6s9rOssXzOVEMNEqK1L1bao=
|
||||
github.com/aws/aws-sdk-go-v2/service/kms v1.24.1 h1:zDmx9yZjSYDaeakQVN16qfsLxhBeAxgclioB0+rOCDM=
|
||||
@@ -500,18 +501,17 @@ golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqR
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
|
||||
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
|
||||
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
|
||||
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
|
||||
@@ -522,28 +522,25 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ=
|
||||
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
|
||||
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
|
||||
@@ -337,17 +337,17 @@ require (
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.24.0 // indirect
|
||||
gocloud.dev v0.34.0 // indirect
|
||||
golang.org/x/crypto v0.19.0 // indirect
|
||||
golang.org/x/crypto v0.21.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9 // indirect
|
||||
golang.org/x/image v0.13.0 // indirect
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
|
||||
golang.org/x/mod v0.15.0 // indirect
|
||||
golang.org/x/net v0.21.0 // indirect
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
golang.org/x/oauth2 v0.12.0 // indirect
|
||||
golang.org/x/sync v0.6.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/term v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/term v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
google.golang.org/api v0.143.0 // indirect
|
||||
|
||||
16
hack/go.sum
16
hack/go.sum
@@ -1120,8 +1120,8 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
|
||||
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -1222,8 +1222,8 @@ golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -1320,8 +1320,8 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@@ -1330,8 +1330,8 @@ golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
|
||||
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -113,7 +114,7 @@ func runCreate(opts createFlags, fSys filesys.FileSystem, rf *resource.Factory)
|
||||
return err
|
||||
}
|
||||
for _, resource := range detected {
|
||||
if kustfile.StringInSlice(resource, resources) {
|
||||
if slices.Contains(resources, resource) {
|
||||
continue
|
||||
}
|
||||
resources = append(resources, resource)
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||
@@ -64,7 +66,7 @@ func (o *addBaseOptions) RunAddBase(fSys filesys.FileSystem) error {
|
||||
if !fSys.Exists(path) {
|
||||
return errors.New(path + " does not exist")
|
||||
}
|
||||
if kustfile.StringInSlice(path, m.Resources) {
|
||||
if slices.Contains(m.Resources, path) {
|
||||
return fmt.Errorf("base %s already in kustomization file", path)
|
||||
}
|
||||
m.Resources = append(m.Resources, path)
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
package add
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
testutils_test "sigs.k8s.io/kustomize/kustomize/v5/commands/internal/testutils"
|
||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||
)
|
||||
@@ -57,7 +57,7 @@ func TestAddBaseAlreadyThere(t *testing.T) {
|
||||
for _, base := range bases {
|
||||
msg := "base " + base + " already in kustomization file"
|
||||
expectedErrors = append(expectedErrors, msg)
|
||||
assert.True(t, kustfile.StringInSlice(msg, expectedErrors))
|
||||
assert.True(t, slices.Contains(expectedErrors, msg))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ package add
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
@@ -60,7 +61,7 @@ func (o *addBuildMetadataOptions) RunAddBuildMetadata(fSys filesys.FileSystem) e
|
||||
return err
|
||||
}
|
||||
for _, opt := range o.buildMetadataOptions {
|
||||
if kustfile.StringInSlice(opt, m.BuildMetadata) {
|
||||
if slices.Contains(m.BuildMetadata, opt) {
|
||||
return fmt.Errorf("buildMetadata option %s already in kustomization file", opt)
|
||||
}
|
||||
m.BuildMetadata = append(m.BuildMetadata, opt)
|
||||
|
||||
@@ -6,6 +6,7 @@ package add
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/api/pkg/loader"
|
||||
@@ -69,7 +70,7 @@ func (o *addComponentOptions) RunAddComponent(fSys filesys.FileSystem) error {
|
||||
|
||||
for _, component := range components {
|
||||
if mf.GetPath() != component {
|
||||
if kustfile.StringInSlice(component, m.Components) {
|
||||
if slices.Contains(m.Components, component) {
|
||||
log.Printf("component %s already in kustomization file", component)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ package add
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
@@ -62,7 +63,7 @@ func (o *addGeneratorOptions) RunAddGenerator(fSys filesys.FileSystem) error {
|
||||
return err
|
||||
}
|
||||
for _, t := range o.generatorFilePaths {
|
||||
if kustfile.StringInSlice(t, m.Generators) {
|
||||
if slices.Contains(m.Generators, t) {
|
||||
log.Printf("generator %s already in kustomization file", t)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ package add
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
ldrhelper "sigs.k8s.io/kustomize/api/pkg/loader"
|
||||
@@ -73,7 +74,7 @@ func (o *addResourceOptions) RunAddResource(fSys filesys.FileSystem) error {
|
||||
|
||||
for _, resource := range resources {
|
||||
if mf.GetPath() != resource {
|
||||
if kustfile.StringInSlice(resource, m.Resources) {
|
||||
if slices.Contains(m.Resources, resource) {
|
||||
log.Printf("resource %s already in kustomization file", resource)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ package add
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
@@ -62,7 +63,7 @@ func (o *addTransformerOptions) RunAddTransformer(fSys filesys.FileSystem) error
|
||||
return err
|
||||
}
|
||||
for _, t := range o.transformerFilePaths {
|
||||
if kustfile.StringInSlice(t, m.Transformers) {
|
||||
if slices.Contains(m.Transformers, t) {
|
||||
log.Printf("transformer %s already in kustomization file", t)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"path"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -55,11 +56,11 @@ func filesTouchedByKustomize(k *types.Kustomization, filepath string, fSys files
|
||||
files, err := fSys.ReadDir(r)
|
||||
if err == nil && len(files) > 0 {
|
||||
for _, file := range files {
|
||||
if !stringInSlice(file, []string{
|
||||
if !slices.Contains([]string{
|
||||
"kustomization.yaml",
|
||||
"kustomization.yml",
|
||||
"Kustomization",
|
||||
}) {
|
||||
}, file) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -223,7 +224,7 @@ func constructFieldOptions(value string, varString string) ([]*types.FieldOption
|
||||
return nil, fmt.Errorf("cannot convert all vars to replacements; %s is not delimited", varString)
|
||||
}
|
||||
delimiter = pre
|
||||
index = indexOf(varString, strings.Split(value, delimiter))
|
||||
index = slices.Index(strings.Split(value, delimiter), varString)
|
||||
if index == -1 {
|
||||
// this should never happen
|
||||
return nil, fmt.Errorf("internal error: could not get index of var %s", varString)
|
||||
@@ -327,21 +328,3 @@ func setPlaceholderValue(varName string, files []string, fSys filesys.FileSystem
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func stringInSlice(elem string, slice []string) bool {
|
||||
for i := range slice {
|
||||
if slice[i] == elem {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func indexOf(varName string, slice []string) int {
|
||||
for i := range slice {
|
||||
if slice[i] == varName {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
package remove
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/util"
|
||||
@@ -59,7 +61,7 @@ func (o *removeBuildMetadataOptions) RunRemoveBuildMetadata(fSys filesys.FileSys
|
||||
}
|
||||
var newOptions []string
|
||||
for _, opt := range m.BuildMetadata {
|
||||
if !kustfile.StringInSlice(opt, o.buildMetadataOptions) {
|
||||
if !slices.Contains(o.buildMetadataOptions, opt) {
|
||||
newOptions = append(newOptions, opt)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -88,7 +89,7 @@ func (o *removeConfigMapOptions) RunRemoveConfigMap(fSys filesys.FileSystem) err
|
||||
remainingConfigMaps := make([]types.ConfigMapArgs, 0, len(m.ConfigMapGenerator))
|
||||
|
||||
for _, currentConfigMap := range m.ConfigMapGenerator {
|
||||
if kustfile.StringInSlice(currentConfigMap.Name, o.configMapNamesToRemove) &&
|
||||
if slices.Contains(o.configMapNamesToRemove, currentConfigMap.Name) &&
|
||||
util.NamespaceEqual(currentConfigMap.Namespace, o.namespace) {
|
||||
foundConfigMaps[currentConfigMap.Name] = struct{}{}
|
||||
continue
|
||||
|
||||
@@ -6,6 +6,7 @@ package remove
|
||||
import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/api/konfig"
|
||||
@@ -73,7 +74,7 @@ func (o *removeResourceOptions) RunRemoveResource(fSys filesys.FileSystem) error
|
||||
|
||||
newResources := make([]string, 0, len(m.Resources))
|
||||
for _, resource := range m.Resources {
|
||||
if kustfile.StringInSlice(resource, resources) {
|
||||
if slices.Contains(resources, resource) {
|
||||
continue
|
||||
}
|
||||
newResources = append(newResources, resource)
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -89,7 +90,7 @@ func (o *removeSecretOptions) RunRemoveSecret(fSys filesys.FileSystem) error {
|
||||
remainingSecrets := make([]types.SecretArgs, 0, len(m.SecretGenerator))
|
||||
|
||||
for _, currentSecret := range m.SecretGenerator {
|
||||
if kustfile.StringInSlice(currentSecret.Name, o.secretNamesToRemove) &&
|
||||
if slices.Contains(o.secretNamesToRemove, currentSecret.Name) &&
|
||||
util.NamespaceEqual(currentSecret.Namespace, o.namespace) {
|
||||
foundSecrets[currentSecret.Name] = struct{}{}
|
||||
continue
|
||||
|
||||
@@ -5,6 +5,7 @@ package remove
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sigs.k8s.io/kustomize/api/konfig"
|
||||
@@ -72,7 +73,7 @@ func (o *removeTransformerOptions) RunRemoveTransformer(fSys filesys.FileSystem)
|
||||
|
||||
newTransformers := make([]string, 0, len(m.Transformers))
|
||||
for _, transformer := range m.Transformers {
|
||||
if kustfile.StringInSlice(transformer, transformers) {
|
||||
if slices.Contains(transformers, transformer) {
|
||||
continue
|
||||
}
|
||||
newTransformers = append(newTransformers, transformer)
|
||||
|
||||
@@ -189,16 +189,6 @@ func (mf *kustomizationFile) Write(kustomization *types.Kustomization) error {
|
||||
return mf.fSys.WriteFile(mf.path, data)
|
||||
}
|
||||
|
||||
// StringInSlice returns true if the string is in the slice.
|
||||
func StringInSlice(str string, list []string) bool {
|
||||
for _, v := range list {
|
||||
if v == str {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (mf *kustomizationFile) parseCommentedFields(content []byte) error {
|
||||
buffer := bytes.NewBuffer(content)
|
||||
var comments [][]byte
|
||||
|
||||
@@ -6,10 +6,10 @@ package util
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"sigs.k8s.io/kustomize/api/types"
|
||||
"sigs.k8s.io/kustomize/kustomize/v5/commands/internal/kustfile"
|
||||
)
|
||||
|
||||
type BuildMetadataValidator struct{}
|
||||
@@ -23,7 +23,7 @@ func (b *BuildMetadataValidator) Validate(args []string) ([]string, error) {
|
||||
}
|
||||
opts := strings.Split(args[0], ",")
|
||||
for _, opt := range opts {
|
||||
if !kustfile.StringInSlice(opt, types.BuildMetadataOptions) {
|
||||
if !slices.Contains(types.BuildMetadataOptions, opt) {
|
||||
return nil, fmt.Errorf("invalid buildMetadata option: %s", opt)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ require (
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.8.4
|
||||
golang.org/x/text v0.14.0
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/cmd/config v0.14.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/kustomize/cmd/config v0.14.1
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
|
||||
@@ -77,8 +77,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@@ -100,9 +100,9 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/cmd/config v0.14.0 h1:TMKWBtk0Ox1EUwafT9hncg7EFrvrBlqDDHXmBHm51U8=
|
||||
sigs.k8s.io/kustomize/cmd/config v0.14.0/go.mod h1:J+ukok4u7k8esCzEhRTygTW7dzDKYbC0kCDkpBK3VfI=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/cmd/config v0.14.1 h1:r1gRhgfPmnt7VYf4uxO8M27GX406n9kOOeScOH9IQds=
|
||||
sigs.k8s.io/kustomize/cmd/config v0.14.1/go.mod h1:Sw1cPsFqh4uYczCWKlidPgMrsffLPCAB+7ytYLlauY4=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -13,14 +13,14 @@ require (
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/xlab/treeprint v1.2.0
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5
|
||||
golang.org/x/sys v0.17.0
|
||||
golang.org/x/sys v0.18.0
|
||||
google.golang.org/protobuf v1.33.0
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.22.4 // indirect
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
@@ -77,8 +77,8 @@ github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/annotationstransformer
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -25,12 +25,12 @@ require (
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/configmapgenerator
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -25,12 +25,12 @@ require (
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -2,7 +2,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/hashtransformer
|
||||
|
||||
go 1.21
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.16.0
|
||||
require sigs.k8s.io/kustomize/api v0.17.1
|
||||
|
||||
require (
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
@@ -22,12 +22,12 @@ require (
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
)
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -4,8 +4,8 @@ go 1.21
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.8.4
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ require (
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
@@ -71,8 +71,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -93,7 +93,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/iampolicygenerator
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -19,11 +19,11 @@ require (
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -63,8 +63,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee33
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -82,7 +82,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/imagetagtransformer
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -25,12 +25,12 @@ require (
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/labeltransformer
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -25,12 +25,12 @@ require (
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -4,8 +4,8 @@ go 1.21
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.8.4
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -4,8 +4,8 @@ go 1.21
|
||||
|
||||
require (
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0
|
||||
sigs.k8s.io/kustomize/api v0.16.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0
|
||||
sigs.k8s.io/kustomize/api v0.17.1
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ require (
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||
golang.org/x/sys v0.17.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
|
||||
@@ -69,8 +69,8 @@ go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0H
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
@@ -88,7 +88,7 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0 h1:G2bWs03V9Ur2PinHLzTUJ8Ded+30SzXZKiO92SRDs3c=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.0/go.mod h1:6lxkYF1Cv9Ic8g/N7I86cvxNc5iinUo/P2vKsHNmpyE=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1 h1:TnxYQxFXzbmNG6gOINgGWQt09GghzgTP6mIurOgrLCQ=
|
||||
sigs.k8s.io/kustomize/kyaml v0.17.1/go.mod h1:9V0mCjIEYjlXuCdYsSXvyoy2BTsLESH7TlGV81S282U=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user