Skip to content

Conversation

@nghialv
Copy link
Member

@nghialv nghialv commented Mar 17, 2022

What this PR does / why we need it:

This PR deletes CloudProviderType and uses ApplicationKind instead for CloudProvider configuration.
This allows us to remove unneeded syncing between ApplicationKind and CloudProviderType.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.51%. This pull request increases coverage by 0.02%.

File Function Base Head Diff
pkg/model/cloudprovider.go CloudProviderType.String 0.00% -- +-0.00%
pkg/model/deployment.go Deployment.CloudProviderType 0.00% -- +-0.00%

@knanao
Copy link
Member

knanao commented Mar 17, 2022

Nice catch🙌
/lgtm

Type model.CloudProviderType `json:"type"`
Config json.RawMessage `json:"config"`
Name string `json:"name"`
Type string `json:"type"`
Copy link
Member

Choose a reason for hiding this comment

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

nits, should we do the same thing we did at L338, instead of using type string, should we use type model.ApplicationKind?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it will not work since model.ApplicationKind is int32 not a string.
Or we have to add a custom Marshal function.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I mean to that since currently, we convert it at L360. But you're right, add a custom marshal function is not worth doing here. Thanks for clarification 🙏

@khanhtc1202
Copy link
Member

Nice improvement 🙆‍♂️
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants