Allow store encoders to post-process after all resources of type are imported

This commit is contained in:
Tomaž Jerman
2023-03-22 10:56:20 +01:00
parent 371bc96616
commit c0ce0f6ac5
5 changed files with 21 additions and 11 deletions
@@ -202,6 +202,10 @@ func (e StoreEncoder) encode{{.expIdent}}s(ctx context.Context, p envoyx.EncodeP
}
}
{{- if .envoy.store.postSetEncoder }}
err = e.post{{.expIdent}}sEncode(ctx, p, s, tree, nn)
{{end }}
return
}
+5
View File
@@ -203,6 +203,11 @@ import (
// enable or disable custom logic after the resource is imported
extendedEncoder: bool | *false
extendedSubResources: bool | *false
// temporary until I figure something better.
// the idea here is that after all of the modules (or resources x) are imported
// only then we should do something over them (like import records).
postSetEncoder: bool | *false
// enable or disable additional custom processing for determining
// resource references