agollo icon indicating copy to clipboard operation
agollo copied to clipboard

我配置的是yml文件,为啥读取出来是个ppro?

Open LargeOrange opened this issue 8 months ago • 2 comments

Image 我在我的阿波罗配置里面这个namespace配置的是yml 但是读取出来的是ppro的键值对。框架不应该改变我远程的文件属性吧?

LargeOrange avatar Jun 06 '25 06:06 LargeOrange

看代码中是有转换逻辑的,可以 debug 看看

https://github.com/apolloconfig/agollo/blob/7b9b2c34de437144da34d9d0d7675b0cbde5d62f/component/remote/sync.go#L75-L88

nobodyiam avatar Jun 07 '25 04:06 nobodyiam

看代码中是有转换逻辑的,可以 debug 看看

agollo/component/remote/sync.go

Lines 75 to 88 in 7b9b2c3

parser := extension.GetFormatParser(constant.ConfigFileFormat(path.Ext(apolloConfig.NamespaceName))) if parser == nil { parser = extension.GetFormatParser(constant.DEFAULT) }

if parser == nil { return apolloConfig, nil }

content, ok := configurations[defaultContentKey] if !ok { content = string(b) } m, err := parser.Parse(content)

我看了,这里是json。但是我在apollo里面写的是yml类型的。我期望就是和json一样string原样给我,不需要转成其他格式

LargeOrange avatar Jun 10 '25 12:06 LargeOrange

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 23 '25 03:09 stale[bot]