mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
Update Issue 1264 Reproduction Test
This commit is contained in:
@@ -5,7 +5,6 @@ package target_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"sigs.k8s.io/kustomize/v3/pkg/kusttest"
|
"sigs.k8s.io/kustomize/v3/pkg/kusttest"
|
||||||
"strings"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -51,19 +50,46 @@ resources:
|
|||||||
- role.yaml
|
- role.yaml
|
||||||
`)
|
`)
|
||||||
|
|
||||||
_, err := th.MakeKustTarget().MakeCustomizedResMap()
|
m, err := th.MakeKustTarget().MakeCustomizedResMap()
|
||||||
// TODO: Fix #1044
|
// This validates Fix #1444. This should not be an error anymore -
|
||||||
// This should not be an error -
|
|
||||||
// the secrets have the same name but are in different namespaces.
|
// the secrets have the same name but are in different namespaces.
|
||||||
// The ClusterRole (by def) is not in a namespace,
|
// The ClusterRole (by def) is not in a namespace,
|
||||||
// an in this case applies to *any* Secret resource
|
// an in this case applies to *any* Secret resource
|
||||||
// named "dummy"
|
// named "dummy"
|
||||||
if err == nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected lack of error")
|
t.Fatalf("Err: %v", err)
|
||||||
}
|
|
||||||
if !strings.Contains(
|
|
||||||
err.Error(),
|
|
||||||
"slice case - multiple matches for ~G_v1_Secret|default|dummy") {
|
|
||||||
t.Fatalf("unexpected error: %s", err)
|
|
||||||
}
|
}
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
dummy: ""
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: dummy
|
||||||
|
namespace: default
|
||||||
|
type: Opaque
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
dummy: ""
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: dummy
|
||||||
|
namespace: kube-system
|
||||||
|
type: Opaque
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: dummy
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resourceNames:
|
||||||
|
- dummy
|
||||||
|
resources:
|
||||||
|
- secrets
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user