Skip to content

Conversation

@antonlisovenko
Copy link
Contributor

This PR transforms some of the fields to Enums. Unit tests are added to ensure behavior is not broken.
Note, that only two fields are added: ProviderName and ClusterType. The suggestion is to do this gradually and also for those enums that are quite stable and "protected" by CRD enum validation.

Copy link
Contributor

@vasilevp vasilevp left a comment

Choose a reason for hiding this comment

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

LGTM, just a small style suggestion

ProviderAzure ProviderName = "AZURE"
ProviderTenant ProviderName = "TENANT"

TypeReplicaSet ClusterType = "REPLICASET"
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] It's good practice to separate different types into different const blocks. This also allows the Go documentation generator to parse comments for such blocks as relevant documentation.

Unofficial example: https://pkg.go.dev/github.com/fluhus/godoc-tricks#Mock_enums

@antonlisovenko antonlisovenko merged commit fedfa1f into main Feb 11, 2021
@antonlisovenko antonlisovenko deleted the CLOUDP-80774_enums branch February 11, 2021 12:17
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.

4 participants