redhat-cop / resource-locker-operator

Apache License 2.0
30 stars 14 forks source link

add generic alm-example to olm-catalog 0.1.3 placeholders #19

Closed komish closed 4 years ago

komish commented 4 years ago

Nearly there, @raffaelespazzoli - thanks so much for your help resolving this!

The gitdiff reflects that I created new files, but understand that I simply took the directory structure for the olm-catalog/resource-locker-operator/0.1.2 and copied it over to 0.1.3, and then made the following changes:

  1. Bumped all version references to 0.1.3
  2. In the ClusterServiceVersion, I added the Secret object to the permission list. That will translate to a the Role which is given to the operator's ServiceAccount being updated when installed via OLM in OpenShift. Link
  3. In the ClusterServiceVersion, I updated all version references from previous 0.1.2 to 0.1.3.
  4. In the ClusterServiceVersion, I removed the original test-simple-resource CR and replaced it with one that can properly be created out-of-the-box with no changes required by the end user. Link

The CustomResourceDefinition has not been changed.

What needs to be done

This merely stages the bundle data that's needed to update the operator in https://github.com/operator-framework/community-operators but the images still need to be built, published, and everything needs to be merged over there as well whenever you have time!

Goal of this PR

Final piece necessary to fix this bug. 🎉

Allows an end-user to create an instance of a ResourceLocker successfully. It uses the operator's default ServiceAccount (resource-locker-operator) which is not a best practice, but should be ok for demonstration purposes. That ServiceAccount has the ability to create secrets with this PR, as well as list them at the cluster scope which is a requirement (this piece was already in place, no change happens here re: the deployed ClusterRole or the clusterPermissions CSV spec item).

raffaelespazzoli commented 4 years ago

we have to do this differently. this has to do with the process needed to release to OLM. Please add the examples you'd like to see in the alm-examples field as files with extension .cr and format yaml in the ./deploy/crds directory. The release process will take care of putting them in the csv.

komish commented 4 years ago

@raffaelespazzoli Sure thing, though I see the CR that's already included is a placeholder. I can translate all of the alm-examples to CR files. Let me know if you want this done differently.

raffaelespazzoli commented 4 years ago

feel free to delete the placeholder CR, I should have done it a long ago and add your more meaningful examples.

komish commented 4 years ago

@raffaelespazzoli Done! I've split the alm-examples into CRs that get properly parsed when you generate a csv using operator-sdk.

I've also updated the roles yaml file to include the added Secrets permission.

Finally, since the project has bumped to operator-sdk 0.16.0, I've updated the documentation on generating catalog components to deprecate use of olm-catalog gen-csv in favor of generate csv

Let me know if any further changes are required.

komish commented 4 years ago

@raffaelespazzoli friendly bump!