-
Notifications
You must be signed in to change notification settings - Fork 188
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
Rename constants being promoted to API v1
to have the common part as a prefix and variations at the end
#1569
Comments
I thought more about it and looked for what we already have. I think this issue can be generalized and not be specific to Bucket API as we have the same naming issue for other APIs. Here are some more information that may be relevant and useful here. I'll focus on third-party "provider" related constants only here as we have some space to fix them going into v1 API. The other constants related to conditions and reasons are ignored as they already exist in the v1 API package. At present, in the v1 API package we have GitRepository, HelmRepository and HelmChart. Of these, only HelmRepository and HelmChart have some third party provider for performing certain operations. We will soon have contextual login in GitRepository, then it will be relevant too. HelmRepository, when used for OCI registries, have a provider field for authentication with the cloud providers. It accepts the usual values In v1 API package, we can create new constants, for example: const (
OCIProviderGeneric string = "generic"
OCIProviderAmazon string = "aws"
OCIProviderGoogle string = "gcp"
OCIProviderAzure string = "azure"
BucketProviderGeneric string = "generic"
BucketProviderAmazon string = "aws"
BucketProviderGoogle string = "gcp"
BucketProviderAzure string = "azure"
) and if we decide to make it easy for users to use the v1 API, without needing to change the variables, create alias for the old constants with these new ones, for example: var (
GenericOCIProvider = OCIProviderGeneric
AmazonOCIProvider = OCIProviderAmazon
GoogleOCIProvider = OCIProviderGoogle
AzureOCIProvider = OCIProviderAzure
GenericBucketProvider = BucketProviderGeneric
AmazonBucketProvider = BucketProviderAmazon
GoogleBucketProvider = BucketProviderGoogle
AzureBucketProvider = BucketProviderAzure
) In the examples above, the providers are the same, we could have common constants for both OCI and Bucket, but this may just be a coincidence for these two APIs. The constants for the upcoming Git providers will have other values, "github", "gitlab", etc. Maintaining separate providers for separate APIs seems better. |
v1
APIv1
to have the common part as a prefix and variations at the end
This was discussed in the dev meeting today and it was decided to introduce the new constants in v1beta2 API package first, updating the existing constants to be an alias to the new constants and marking them as deprecated. The old constants will never be removed from v1beta2 API, they will only be marked as deprecated. In the v1 API package, only the new constants will be introduced. The underlying values for the constants will remain the same, no user facing change. Only the consumers of these constants will have to migrate to the new names. |
See #1552 (comment)
The text was updated successfully, but these errors were encountered: