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

Ecto decode cloud discovery #582

Merged
merged 2 commits into from
May 25, 2022
Merged

Conversation

dottorblaster
Copy link
Contributor

Decoding cloud discovery payload using Ecto.

@dottorblaster dottorblaster self-assigned this May 23, 2022
@dottorblaster dottorblaster force-pushed the ecto-decode-cloud-discovery branch 2 times, most recently from ec988b6 to 1dd2bb6 Compare May 24, 2022 13:17
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

LGTM

provider_data:
case metadata do
%{
compute: %{
Copy link
Member

Choose a reason for hiding this comment

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

could we have a function here instead of a case?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would have something like:

defp build_update_provider_command(agent_id, %CloudDiscoveryPayload{
         provider: :azure,
         metadata: metadata
       }) do
...

To handle the different provider overtime, instesad of the case option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy that 👍

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Nice work @dottorblaster !
I agree on the comment given by @fabriziosestito on splitting the metadata building process by providers

provider_data:
case metadata do
%{
compute: %{
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have something like:

defp build_update_provider_command(agent_id, %CloudDiscoveryPayload{
         provider: :azure,
         metadata: metadata
       }) do
...

To handle the different provider overtime, instesad of the case option

@dottorblaster dottorblaster force-pushed the ecto-decode-cloud-discovery branch from 1dd2bb6 to d7ab945 Compare May 25, 2022 12:20
@dottorblaster dottorblaster merged commit a8d0134 into main May 25, 2022
@dottorblaster dottorblaster deleted the ecto-decode-cloud-discovery branch May 25, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants