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

prevent error on catalog missing from config #2170

Merged
merged 6 commits into from Oct 13, 2023

Conversation

Sean-Holcomb
Copy link
Contributor

What does this PR change?

  • Fix issue with Athena configuration where new catalog parameter was required when unmarshalling json of config. This bug causes existing configs to fail to load

Does this PR relate to any other PRs?

How will this PR impact users?

no impact to user

Does this PR address any GitHub or Zendesk issues?

  • Closes ...

How was this PR tested?

  • Tested by loading configs missing this value

Does this PR require changes to documentation?

Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
return fmt.Errorf("AthenaConfiguration: UnmarshalJSON: %s", err.Error())
if _, ok := fmap["catalog"]; ok {
catalog, err := config.GetInterfaceValue[string](fmap, "catalog")
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be !=?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
if _, ok := fmap["catalog"]; ok {
catalog, err := config.GetInterfaceValue[string](fmap, "catalog")
if err != nil {
return fmt.Errorf("AthenaConfiguration: UnmarshalJSON: %w", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelmdresser you are slipping man, you didn't even comment on the unwrapped errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 ahh its a dark day isn't it

if _, ok := fmap["catalog"]; ok {
catalog, err := config.GetInterfaceValue[string](fmap, "catalog")
if err != nil {
return fmt.Errorf("AthenaConfiguration: UnmarshalJSON: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 ahh its a dark day isn't it

@a7i
Copy link
Contributor

a7i commented Sep 23, 2023

thank you for the fix @michaelmdresser 🏆

@Sean-Holcomb Sean-Holcomb merged commit fedcbdd into develop Oct 13, 2023
3 checks passed
@mattray mattray deleted the sean/fix-aws-catalog-load branch January 18, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants