Update envoy to not scope referenced workflows
This commit is contained in:
@@ -183,6 +183,12 @@ var scope envoyx.Scope
|
||||
Identifiers: refs["{{(index .parents 0).refField}}"].Identifiers,
|
||||
}
|
||||
for k, ref := range refs {
|
||||
// @todo temporary solution to not needlessly scope resources.
|
||||
// Optimally, this would be selectively handled by codegen.
|
||||
if !strings.HasPrefix(ref.ResourceType, "corteza::compose") {
|
||||
continue
|
||||
}
|
||||
|
||||
ref.Scope = scope
|
||||
refs[k] = ref
|
||||
}
|
||||
|
||||
24
server/compose/envoy/store_decode.gen.go
generated
24
server/compose/envoy/store_decode.gen.go
generated
@@ -200,6 +200,12 @@ func ChartToEnvoyNode(r *types.Chart) (node *envoyx.Node, err error) {
|
||||
Identifiers: refs["NamespaceID"].Identifiers,
|
||||
}
|
||||
for k, ref := range refs {
|
||||
// @todo temporary solution to not needlessly scope resources.
|
||||
// Optimally, this would be selectively handled by codegen.
|
||||
if !strings.HasPrefix(ref.ResourceType, "corteza::compose") {
|
||||
continue
|
||||
}
|
||||
|
||||
ref.Scope = scope
|
||||
refs[k] = ref
|
||||
}
|
||||
@@ -298,6 +304,12 @@ func ModuleToEnvoyNode(r *types.Module) (node *envoyx.Node, err error) {
|
||||
Identifiers: refs["NamespaceID"].Identifiers,
|
||||
}
|
||||
for k, ref := range refs {
|
||||
// @todo temporary solution to not needlessly scope resources.
|
||||
// Optimally, this would be selectively handled by codegen.
|
||||
if !strings.HasPrefix(ref.ResourceType, "corteza::compose") {
|
||||
continue
|
||||
}
|
||||
|
||||
ref.Scope = scope
|
||||
refs[k] = ref
|
||||
}
|
||||
@@ -393,6 +405,12 @@ func ModuleFieldToEnvoyNode(r *types.ModuleField) (node *envoyx.Node, err error)
|
||||
Identifiers: refs["NamespaceID"].Identifiers,
|
||||
}
|
||||
for k, ref := range refs {
|
||||
// @todo temporary solution to not needlessly scope resources.
|
||||
// Optimally, this would be selectively handled by codegen.
|
||||
if !strings.HasPrefix(ref.ResourceType, "corteza::compose") {
|
||||
continue
|
||||
}
|
||||
|
||||
ref.Scope = scope
|
||||
refs[k] = ref
|
||||
}
|
||||
@@ -550,6 +568,12 @@ func PageToEnvoyNode(r *types.Page) (node *envoyx.Node, err error) {
|
||||
Identifiers: refs["NamespaceID"].Identifiers,
|
||||
}
|
||||
for k, ref := range refs {
|
||||
// @todo temporary solution to not needlessly scope resources.
|
||||
// Optimally, this would be selectively handled by codegen.
|
||||
if !strings.HasPrefix(ref.ResourceType, "corteza::compose") {
|
||||
continue
|
||||
}
|
||||
|
||||
ref.Scope = scope
|
||||
refs[k] = ref
|
||||
}
|
||||
|
||||
@@ -317,6 +317,12 @@ func (aa Identifiers) HasIntersection(bb Identifiers) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// If the second identifies are empty we can assume that anything has an intersection with them.
|
||||
// This is useful when we want to remove any resource of some type.
|
||||
if len(bb.Slice) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
return len(aa.Intersection(bb)) > 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user