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

Automate CSV generation #35

Closed
guymguym opened this issue Aug 19, 2019 · 4 comments · Fixed by #40
Closed

Automate CSV generation #35

guymguym opened this issue Aug 19, 2019 · 4 comments · Fixed by #40
Labels
enhancement New feature or request

Comments

@guymguym
Copy link
Member

Continue here the discussion started on PR #33 with @davidvossel.

@guymguym guymguym added the enhancement New feature or request label Aug 19, 2019
@davidvossel
Copy link

from PR #33

How does OCS operator plan to generate the CSV?

  1. run operator-sdk olm-catalog gen-csv to generate the base ocs-operator csv.
  2. extract CSV and CRD manifests from the exact noobaa/rook operator container images that ocs-operator is integrating with
  3. Merge noobaa/rook operator related manifests into the base ocs-operator manifests.
  4. the result is the unified CSV and list of CRDs.

For step 2 to work, we need both noobaa and rook to maintain accurate CSV/CRD manifests within the operator container image for us to extract.

This means for ocs-operator integration, we're less interested in retrieving a pre-bulit release manifest that represents a previous noobaa release, and more interested in retrieving a CSV that is built to reflect exactly what RBAC/Deployment/CRDs correspond to the specific build that's being consumed.

^ That's why my initial PR, #32 generated the template in the built step.

@guymguym
Copy link
Member Author

Hi @davidvossel

  1. run operator-sdk olm-catalog gen-csv to generate the base ocs-operator csv.

Is step 1 a repeatable build step? Did you think on how to handle all all those manual CSV properties that are not generated?

For step 2 to work, we need both noobaa and rook to maintain accurate CSV/CRD manifests within the operator container image for us to extract.

So this is already done in #33 right? The CSV and CRD's are part of the container image and can be extracted upon request.

This means for ocs-operator integration, we're less interested in retrieving a pre-bulit release manifest that represents a previous noobaa release, and more interested in retrieving a CSV that is built to reflect exactly what RBAC/Deployment/CRDs correspond to the specific build that's being consumed. That's why my initial PR, #32 generated the template in the built step.

To make sure I understand what you mean - once we automate the CSV generation of the noobaa operator in the build, just like we do for CRD's today (make gen-api), is that what you're interested in?

Thanks!

@davidvossel
Copy link

To make sure I understand what you mean - once we automate the CSV generation of the noobaa operator in the build, just like we do for CRD's today (make gen-api), is that what you're interested in?

yes, for our purposes (integration with ocs-operator) the CSV generation should occur at nooba operator build time. This ensures any changes to the noobaa's Deployment/RBAC will be picked up by the ocs-operator when generating the unified CSV.

@davidvossel
Copy link

Is step 1 a repeatable build step? Did you think on how to handle all all those manual CSV properties that are not generated?

right, so you're talking about the fields marked as (user) in this doc https://github.com/operator-framework/operator-sdk/blob/master/doc/user/olm-catalog/generating-a-csv.md#csv-fields

There are a few options.

  • Create a golang tool to read in the generated CSV file into a struct, add your user bits to the struct, then export the struct as yaml. here's an example of reading in CSV into a struct and exporting it back to yaml.
  • Tools like yq could be used to merge those fields into the generated CSV yaml
  • some sort of sed/bash logic to splice together the generated CSV along with the custom user defined bits.

guymguym added a commit to guymguym/noobaa-operator that referenced this issue Aug 27, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Aug 27, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Aug 28, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Aug 28, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Sep 3, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Sep 3, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Sep 5, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Sep 5, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Sep 6, 2019
CLI usage - use current namespace by default
CLI add --mongodb-image flag
Fixes noobaa#38 - handle BackingStore.Spec.S3Options == nil
Fixes noobaa#35 - automated CSV generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants