-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Feature request] Have a command to rename an existing API and code consuming it #560
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
Comments
+1, I found it to be very hard to manually do this after it was generated using sdk. |
@cmoulliard you can for now just do a |
Title renamed. |
I'd be also interested in this. |
I also ran into this went wanting to change the |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'm unsure if the SDK should support rewriting/renaming an existing API and all the associated manifest and controller files that are using that API. In any case this isn't on our radar at the moment (and why this was ignored for so long) so proposals are appreciated if this seems to be a common workflow. |
Generated with: $ git rm -rf . $ operator-sdk-v0.19.3 init --domain openshift.io --repo github.com/openshift/cincinnati-operator $ operator-sdk-v0.19.3 create api --group updateservice --version v1 --kind UpdateService --resource --controller $ sed -i 's/cincinnati-operator/update-service-operator/' config/default/kustomization.yaml $ git add -A .gitignore * The following paths are ignored by one of your .gitignore files: bin hint: Use -f if you really want to add them. hint: Turn this message off by running hint: "git config advice.addIgnoredFile false" We don't want to commit bin, so the warning is fine. This regenerates the file with the scaffolding for the new API name, and we can merge it into our main branch to update the type there. From [1], regenerating a new API is the prefered migration approach, and running the '... create api ...' call directly in the main branch gave: ... vet: functests/utils.go:79:53: SchemeGroupVersion not declared by package v1beta1 make: *** [vet] Error 1 Error: failed to create API with version "3-alpha": exit status 2 ... FATA[0006] failed to create API with version "3-alpha": exit status 2 [1]: operator-framework/operator-sdk#560 (comment)
Generated with: $ git rm -rf . $ operator-sdk-v0.19.3 init --domain openshift.io --repo github.com/openshift/cincinnati-operator $ operator-sdk-v0.19.3 create api --group updateservice --version v1 --kind UpdateService --resource --controller $ sed -i 's/cincinnati-operator/update-service-operator/' config/default/kustomization.yaml $ git add -A .gitignore * The following paths are ignored by one of your .gitignore files: bin cover.out hint: Use -f if you really want to add them. hint: Turn this message off by running hint: "git config advice.addIgnoredFile false" We don't want to commit bin or cover.out, so the warning is fine. This regenerates the file with the scaffolding for the new API name, and we can merge it into our main branch to update the type there. From [1], regenerating a new API is the prefered migration approach, and running the '... create api ...' call directly in the main branch gave: ... vet: functests/utils.go:79:53: SchemeGroupVersion not declared by package v1beta1 make: *** [vet] Error 1 Error: failed to create API with version "3-alpha": exit status 2 ... FATA[0006] failed to create API with version "3-alpha": exit status 2 [1]: operator-framework/operator-sdk#560 (comment)
Met this problem too. |
What is the best approach to rename an API / CRD + operator's code ?
operator-sdk new spring-boot-operator --api-version=springboot.snowdrop.me/v1alpha1 --kind=SpringBoot
,pkg/apis/component/v1alpha1
+ CRD + ... filesThe text was updated successfully, but these errors were encountered: