Skip to content
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

*: Scaffold for 1.0.1 #79

Closed
wants to merge 6 commits into from
Closed

*: Scaffold for 1.0.1 #79

wants to merge 6 commits into from

Commits on Nov 4, 2020

  1. *: Scaffold for 0.19.3

    Following [1]:
    
      $ 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"
    
    We don't want to commit bin, so the warning is fine.
    wking committed Nov 4, 2020
    Configuration menu
    Copy the full SHA
    cfc6956 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2020

  1. *: Pivot from v1beta1 Cincinnati to v1 UpdateService

    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)
    wking committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    ce911fe View commit details
    Browse the repository at this point in the history
  2. *: Scaffold for 1.0.1

    Generated with:
    
      $ 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.
    wking committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    0731f08 View commit details
    Browse the repository at this point in the history
  3. Merge branch '0.19-scaffolding' into sdk-0.19

    Generated with:
    
      $ 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
    
    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
    wking committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    99b6cb6 View commit details
    Browse the repository at this point in the history
  4. Merge branch '0.19-scaffolding-v1' into v1-crds

    Generated with:
    
      $ 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
    wking committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    84cc70a View commit details
    Browse the repository at this point in the history
  5. Merge branch 'v1-scaffolding' into sdk-1.0

    Generated with:
    
      $ 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
    wking committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    78a20c3 View commit details
    Browse the repository at this point in the history