Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mitigate viper bug in failing to bind env to nested config #1446

Closed
haoming29 opened this issue Jun 21, 2024 · 0 comments · Fixed by #1451
Closed

Mitigate viper bug in failing to bind env to nested config #1446

haoming29 opened this issue Jun 21, 2024 · 0 comments · Fixed by #1451
Labels
bug Something isn't working cache Issue relating to the cache component critical High priority for next release director Issue relating to the director component origin Issue relating to the origin component registry Issue relating to the registry component
Milestone

Comments

@haoming29
Copy link
Contributor

Ref: spf13/viper#761

As Fabio reported, when setting the Server.TLSCACertificateDirectory config via environment variable, i.e. PELICAN_SERVER_TLSCACERTIFICATEDIRECTORY=/etc/grid-security/certificates, the value isn't propagated to xrootd config. This is because we used viper.Unmarshal to unmarshal viper configuration to our defined xrootd configuration struct:

if err := viper.Unmarshal(&xrdConfig, viper.DecodeHook(combinedDecodeHookFunc())); err != nil {
return "", errors.Wrap(err, "failed to unmarshal xrootd config")
}

However, given the bug in viper, the values of nested fields are lost in unmarshaling. People in the the referred issue proposed a couple of work-around and we should pick one and replace all our instances where we used viper.Unmarshal.

@haoming29 haoming29 added bug Something isn't working critical High priority for next release cache Issue relating to the cache component origin Issue relating to the origin component director Issue relating to the director component registry Issue relating to the registry component labels Jun 21, 2024
@haoming29 haoming29 added this to the v7.10.0 milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cache Issue relating to the cache component critical High priority for next release director Issue relating to the director component origin Issue relating to the origin component registry Issue relating to the registry component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant