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

Fix tls-ca key for yaml #268

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Conversation

netixx
Copy link
Contributor

@netixx netixx commented Oct 30, 2023

There was a typo (I think) with yaml decoding key for tls-ca on tagets. It was "tlsca"

This aligns it with the other keys to be "tls-ca".

@karimra
Copy link
Collaborator

karimra commented Oct 31, 2023

Thanks for catching this.
For the record, that struct tag does not influence config reading. The YAML unmarshaling is based on the mapstructure struct tag.

@karimra karimra merged commit 49ba97c into openconfig:main Oct 31, 2023
2 checks passed
@netixx
Copy link
Contributor Author

netixx commented Oct 31, 2023

I was having the issue using "tls-ca" in my yaml config which wasn't taken into account (checked using the debug logs of the loader), so I think mapstructure is not used here ?

I see in the code that

// unmarshal the bytes into a map of targetConfigs
	err = yaml.Unmarshal(b, result)

is done, so I do believe that the yaml tag is used ?

@karimra
Copy link
Collaborator

karimra commented Oct 31, 2023

Ah yes you are right, the yaml struct tags will be used with loaders. The mapstructure tag is used when reading the main config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants