Roll back failed dynamic descriptor builds
This commit is contained in:
@@ -40,9 +40,11 @@ func (o *valueOperation) dynamicDescriptor(current reflect.Type, path Path) (*ty
|
||||
builder := schemaBuilder{cache: o.schema.types, building: make(map[reflect.Type]bool), secrets: o.schema.secrets}
|
||||
descriptor, issue := builder.describe(current, path)
|
||||
if issue != nil {
|
||||
builder.rollback()
|
||||
return nil, &projectionIssue{code: CodeSchemaDynamicType, path: path.clone(), message: "dynamic configuration value has an unsupported type"}
|
||||
}
|
||||
if descriptorContainsSecret(descriptor, make(map[*typeDescriptor]bool)) {
|
||||
builder.rollback()
|
||||
return nil, &projectionIssue{code: CodeSchemaDynamicType, path: path.clone(), message: "dynamic configuration values cannot establish secret-reference semantics"}
|
||||
}
|
||||
return descriptor, nil
|
||||
|
||||
Reference in New Issue
Block a user