mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 09:51:23 +00:00
Improve NameReference Test cases
- Add more NameReference Namespace tests - Address issue when mixing empty/no namespace and default namespace. - Address ClusterRoleBinding subjects field pointing at multiple namespaces.
This commit is contained in:
@@ -43,6 +43,11 @@ func (rf *Factory) FromMapWithNamespace(n string, m map[string]interface{}) *Res
|
||||
return rf.makeOne(rf.kf.FromMap(m), nil).setOriginalNs(n)
|
||||
}
|
||||
|
||||
// FromMapWithNamespaceAndName returns a new instance with the given "original" namespace.
|
||||
func (rf *Factory) FromMapWithNamespaceAndName(ns string, n string, m map[string]interface{}) *Resource {
|
||||
return rf.makeOne(rf.kf.FromMap(m), nil).setOriginalNs(ns).setOriginalName(n)
|
||||
}
|
||||
|
||||
// FromMapAndOption returns a new instance of Resource with given options.
|
||||
func (rf *Factory) FromMapAndOption(
|
||||
m map[string]interface{}, args *types.GeneratorArgs, option *types.GeneratorOptions) *Resource {
|
||||
|
||||
@@ -127,7 +127,7 @@ func (r *Resource) GetOutermostNameSuffix() string {
|
||||
}
|
||||
|
||||
func (r *Resource) InSameFuzzyNamespace(o *Resource) bool {
|
||||
return r.GetNamespace() == o.GetNamespace() &&
|
||||
return r.CurId().IsNsEquals(o.CurId()) &&
|
||||
r.GetOutermostNamePrefix() == o.GetOutermostNamePrefix() &&
|
||||
r.GetOutermostNameSuffix() == o.GetOutermostNameSuffix()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user