Add immutable profile catalog loading
This commit is contained in:
@@ -164,8 +164,9 @@ type profileMatch struct {
|
||||
}
|
||||
|
||||
type profileFileMetadata struct {
|
||||
ids []string
|
||||
hasRawAPIKey bool
|
||||
ids []string
|
||||
hasRawAPIKey bool
|
||||
explicitFields []string
|
||||
}
|
||||
|
||||
func readProfileFileMetadata(data []byte) (profileFileMetadata, error) {
|
||||
@@ -206,6 +207,7 @@ func profileMetadataFromNode(node *yaml.Node) profileFileMetadata {
|
||||
for i := 0; i+1 < len(mapping.Content); i += 2 {
|
||||
key := mapping.Content[i]
|
||||
value := mapping.Content[i+1]
|
||||
metadata.explicitFields = append(metadata.explicitFields, key.Value)
|
||||
switch key.Value {
|
||||
case "id":
|
||||
metadata.ids = append(metadata.ids, strings.TrimSpace(value.Value))
|
||||
@@ -228,6 +230,7 @@ func (m profileFileMetadata) matchesID(id string) bool {
|
||||
func (m *profileFileMetadata) merge(other profileFileMetadata) {
|
||||
m.ids = append(m.ids, other.ids...)
|
||||
m.hasRawAPIKey = m.hasRawAPIKey || other.hasRawAPIKey
|
||||
m.explicitFields = append(m.explicitFields, other.explicitFields...)
|
||||
}
|
||||
|
||||
func decodeProfile(data []byte) (*domain.ExecutionProfile, error) {
|
||||
|
||||
Reference in New Issue
Block a user