-
Notifications
You must be signed in to change notification settings - Fork 32
v1 scaffolding, but without the merges #80
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
Conversation
Generated by creating a fresh scaffold: $ git checkout --orphan 0.19-scaffolding $ 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 cincinnati --version v1beta1 --kind Cincinnati --resource --controller $ 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" And then, back on master: $ git checkout -b sdk-0.19 origin/master $ git merge --allow-unrelated-histories 0.19-scaffolding $ git checkout --theirs .gitignore # drop lots of user-editor cruft, see "Which file to place a pattern in..." in https://git-scm.com/docs/gitignore#_description $ emacs api/v1beta1/cincinnati_types.go # keep some of the outgoing pkg/apis/cincinnati/v1beta1/cincinnati_types.go content $ emacs controllers # keep some of the outgoing pkg/controller content $ emacs main.go # incorperate some of the outgoing cmd/manager/main.go content $ emacs Dockerfile # keep most of the pre-0.19 content. We will still vendor deps, and don't want to have GOARCH, etc., opinions $ emacs Makefile # keep most of the 0.19 content, with a few pre-0.19 rules for openshift/release compatability $ emacs README.md # bump SDK references to 0.19 $ make manifests $ git add .gitignore config Dockerfile main.go Makefile README.md $ git rm -rf cmd/manager pkg/apis pkg/controller $ git checkout HEAD -- go.sum # we'll auto-generate this in a future commit $ emacs go.mod # basically a union of the two sets. Drop the hopefully-obsolete 'replace' block. $ make bundle $ emacs config/manifests/bases/cincinnati-operator.clusterserviceversion.yaml # keep some of the outgoing deploy/olm-catalog content $ make bundle $ go mod tidy $ go mod vendor $ git add -A go.* vendor $ git commit And then washing the merge out of the history: $ git branch temporary-merge $ git reset --hard HEAD^ $ git rm -rf . $ git checkout temporary-merge -- . $ git commit $ git branch -D temporary-merge using: $ go version go version go1.15.2 linux/amd64 $ kustomize version {Version:kustomize/v3.8.6 GitCommit:c1747439cd8bc956028ad483cdb30d9273c18b24 BuildDate:2020-10-29T23:07:50Z GoOs:linux GoArch:amd64} $ controller-gen --version Version: v0.3.0 'oc' has a kustomize subcommand, but even in the master oc branch, that is currently v2 [1], while 'kustomize edit ...' needs v3 to avoid [2]: cd config/manager && /cli/oc kustomize edit set image controller=controller:latest Error: specify one path to a kustomization directory The 'docker build . -t ${IMG}' -> 'docker build -t ${IMG} .' change is for Podman compatibility [3]. Commenting out the 'test' prerequisite allows us to run 'make docker-build' without having functests try to run tests in whatever cluster you may be pointed at. The increased memory limits are based on peak measurements of ~11m CPU and ~94MiB in a 4.6.4 amd64 cluster with a single Cincinnati object. [1]: https://github.com/openshift/oc/blob/1bd1f5ff4aa98d6e4184c2948928b6111fa99191/vendor/modules.txt#L1293 [2]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cincinnati-operator/76/pull-ci-openshift-cincinnati-operator-master-operator-e2e/1326532618765733888 [3]: operator-framework/operator-sdk#4226
Generated by creating a fresh scaffold on top of 0.19-scaffolding (described in the previous commit): $ git checkout -b 0.19-scaffolding-v1 0.19-scaffolding $ 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 And then, back on master: $ git merge 0.19-scaffolding-v1 $ emacs main.go api/v1/updateservice_types.go controllers/updateservice_controller.go # resolve conflicts $ emacs README.md Dockerfile controllers/*.go functests/*.go config/manifests/bases/cincinnati-operator.clusterserviceversion.yaml # remaining api/v1beta1 -> api/v1 migration and renames $ emacs config/samples/updateservice_v1_updateservice.yaml # copy some content from the outgoing Cincinnati sample $ git rm -f config/samples/cincinnati_v1beta1_cincinnati.yaml controllers/suite_test.go $ rm -rf bundle $ make generate manifests bundle $ git add -A README.md main.go api bundle config controllers functests And then washing the merge out of the history: $ git branch temporary-merge $ git reset --hard HEAD^ $ git rm -rf . $ git checkout temporary-merge -- . $ git commit $ git branch -D temporary-merge
Generated by creating a fresh scaffold on top of 0.19-scaffolding-v1 (described in the previous commit): $ git checkout -b v1-scaffolding 0.19-scaffolding-v1 $ git rm -rf . $ operator-sdk-v1.0.1 init --domain openshift.io --repo github.com/openshift/cincinnati-operator $ operator-sdk-v1.0.1 create api --group updateservice --version v1 --kind UpdateService --resource --controller $ sed -i 's/projectName: cincinnati-operator/projectName: update-service-operator/' PROJECT $ 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. And then, back on master: $ git merge v1-scaffolding $ emacs README.md # bump SDK version $ emacs Makefile config/default/kustomization.yaml # resolve conflicts $ emacs go.mod # take largest version from either side $ git checkout --ours go.sum $ go mod tidy $ go mod vendor $ rm -rf bundle $ git mv config/manifests/bases/cincinnati-operator.clusterserviceversion.yaml config/manifests/bases/openshift-update-service.clusterserviceversion.yaml $ make manifests bundle $ git add -A README.md Makefile config go.* vendor $ git commit And then washing the merge out of the history: $ git branch temporary-merge $ git reset --hard HEAD^ $ git rm -rf . $ git checkout temporary-merge -- . $ git commit $ git branch -D temporary-merge
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@wking: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 understand the commands that are listed here. |
|
#65 landed the bulk of this. I'll file separate PRs for anything unique to this PR that I want to keep. /close |
|
@wking: Closed this PR. DetailsIn 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. |
Same content as #79, but without the merges that @LalatenduMohanty didn't like ;)