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

#1743: Begin generating the operator bundle using operator-sdk #1811

Merged
merged 2 commits into from
Nov 19, 2020

Conversation

phantomjinx
Copy link
Contributor

Provides build hooks for OLM bundle generation. Uses the latest functionality available from the operator-sdk 1.0.0.

Release Note

NONE

* operator-sdk requires storage version to be specified for each crd
* Makefile
 * OPERATOR_VERSION removes -SNAPSHOT suffix as invalid domain for version
   field while executing `operator-sdk generate...`
 * Adds recipes for constructing both the manifests and bundle, adapted
   from the demonstration versions
 * Uses recursive rule-making to avoid duplication and work around
   the limits of controller-gen & operator-sdk

* script/add_licence.sh
 * Script for prepending the licence header to generated files

* script/gen_crd.sh
 * adds config directory for crd generation

* PROJECT
 * Scaffolding configuration for operator-sdk executable

* config
 * root configuration directory for kustomize and operator-sdk
 * samples directory locates the alm-examples used in the bundle manifest
 * rbac directory locates the permissions, cluster-permissions and
   deployments fields in the bundle manifest
 * prometheus directory used for monitoring resources although doesn't seem
   to be applicable at the moment (prometheus-jmx-exporter.yaml is invalid)
 * crd directory locates the CRDs generated in the same manner as that in
   the deploy directory
 * All resources have to be copied in - cannot use symlinks and both
   controller-gen and operator-sdk will error

* Limitations of process:
 * controller-gen cannot generate CRDs across modules (directory containing
   go.mod) so gen-crds.sh changes directory into pkg/apis in order to
   execute successfully
 * operator-sdk has to execute in root of directory and cannot generate
   across modules. Also, seems to have a duplication problem if 2 apis
   are being processed with one dependent on the other. So copy apis 1 at
   a time & process

* Result is `make bundle` will regenerate csv manifests (if required) then
  create a bundle directory containing these manifests and other artifacts
  necessary for deploying an image for the Operator Hub and OLM catalogue
@astefanutti
Copy link
Member

Let's merge this and iterate on it in subsequent PRs.

@astefanutti astefanutti merged commit 4e73ffd into apache:master Nov 19, 2020
@nicolaferraro nicolaferraro mentioned this pull request Dec 22, 2020
@phantomjinx phantomjinx deleted the master branch May 12, 2021 15:27
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.

None yet

2 participants