cuddly-jelly-27016
05/26/2025, 12:10 AMconfig_load_test fails. I realize that this is not a present bug but I figured I would open this up in case anyone has an issue and in the event that Flyte eventually updates viper to a more recent version.
It appears that the latest entry in defined in a YAML map will be the only entry in the map that is parsed. For example:
=== RUN TestLoadConfig/k8s-config-test
config_load_test.go:30:
Error Trace: /home/jparraga/code/flyte/flyteplugins/go/tasks/config_load_test.go:30
Error: Not equal:
expected: map[string]string{"annotationKey1":"annotationValue1", "annotationKey2":"annotationValue2"}
actual : map[string]string{"annotationkey2":"annotationValue2"}
Diff:
--- Expected
+++ Actual
@@ -1,4 +1,3 @@
-(map[string]string) (len=2) {
- (string) (len=14) "annotationKey1": (string) (len=16) "annotationValue1",
- (string) (len=14) "annotationKey2": (string) (len=16) "annotationValue2"
+(map[string]string) (len=1) {
+ (string) (len=14) "annotationkey2": (string) (len=16) "annotationValue2"
}
Test: TestLoadConfig/k8s-config-test
It appears the error happens in decoding the custom config into the root config. From what I've seen there is a different in the typing of the configuration that is parsed by viper. Notably, map entries used to be parsed as map[interface{}]interface{} and are now parsed as map[string]interface{}. The code is bit hair but I figured I'd file a ticket before I dig deeper here.
### Expected behavior
I would expect config loading to work correctly and unit tests to pass.
### Additional context to reproduce
go get github.com/spf13/viper@v1.18.2
proceed to run unit tests in flyteplugins
### Screenshots
v1.11.0
[v1 11 0](https://private-user-images.githubusercontent.com/1274471/338710941-61feb4a4-d3ee-4297-8232-5e38a7250290.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgyMTg1MjgsIm5iZiI6MTc0ODIxODIyOCwicGF0aCI6Ii8xMjc0NDcxLzMzODcxMDk0MS02MWZlYjRhNC1kM2VlLTQyOTctODIzMi01ZTM4YTcyNTAyOTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMt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ZXJzPWhvc3QifQ.3_pxtQf4E90MdEAbXCjyprVZWdGBbCwjPcJG-Iw2VfI)
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/26/2025, 12:10 AM