Skip to content

feat(olm-catalog) : add missing fields with placehoders in the CSV #2095

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

Closed
wants to merge 4 commits into from
Closed

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Oct 23, 2019

Description of the change:
Add warn for spec.icon.

Motivation for the change:

Closes:

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 23, 2019
@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 23, 2019
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure the user has replaced these field's text, which we are not doing in these changes in getEmptyRequiredCSVFields(). I suggest adding mandatory field checks in getEmptyRequiredCSVFields() and not setting these to placeholder values in setCSVDefaultFields(), since the former function will pass on placeholder data when it should not.

@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Oct 23, 2019

Hi @estroz,

Really tks for your review.

The getEmptyRequiredCSVFields() as you suggested by you will not add the fields. It will just show a warning message when the CSV file generated as the following which in POV is not a good experience for the users at all. Note that we can find issues caused by it.

Fill in the following required fields in file deploy/olm-catalog/project-test/0.0.1/project-test.v0.0.1.clusterserviceversion.yaml:

I mean: As I developer, I would like to generate the CSV with all fields which are required for the project works successfully in OLM and be accepted on it. Is it make sense?

@estroz
Copy link
Member

estroz commented Oct 23, 2019

@camilamacedo86 passing gen-csv or deployment with placeholder values is not the correct way to resolve these outstanding issues. Either the warning messages need to be more clear, or we need to error out. I think the validation library being worked on in operator-framework/api will help with this.

Furthermore I'm fairly certain operator-framework/getting-started#43 is caused by an RBAC issue and not minikube version. I've seen the minikube version status before on a successfully deployed CSV.

@camilamacedo86 camilamacedo86 changed the title feat(olm-catalog) : add mandatory missing fields with placehoders in the CSV feat(olm-catalog) : add missing fields with placehoders in the CSV Oct 23, 2019
@camilamacedo86
Copy link
Contributor Author

/test e2e-aws-go
/test e2e-aws-ansible
/test e2e-aws-subcommand

@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Oct 25, 2019

Hi @joelanford and @dmesser,

@estroz asked for I raise you both here and ask your inputs as well.

@joelanford
Copy link
Member

If I'm understanding @estroz's comments correctly, I'm in agreement with him. If we're trying to solve the problem of helping the user generate a valid CSV, using placeholders won't help because they will obscure the fact that a particular field is not populated correctly.

I agree that the static bundle validation library is the correct solution here.

@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 28, 2019
@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Oct 31, 2019

HI @estroz and @joelanford,

It was changed as we spoke. Then, we are here just adding icon.spec which was missing in the WARN which shows enough so far for we attend the community request. Are you ok with? Could we move forward with this PR?

Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camilamacedo86 you could change this line to use log.Errorf() since these fields are required.

@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Oct 31, 2019

Hi @estroz,

@camilamacedo86 you could change this line to use log.Errorf() since these fields are required.

The WARN appears when we exec the command to generate the file. So, IMO shows an ERROR message by default is a really bad user experience and will be very confusing. I do not think that we should do it.

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 31, 2019
@camilamacedo86 camilamacedo86 requested a review from estroz October 31, 2019 21:19
@camilamacedo86
Copy link
Contributor Author

Hi @estroz,

The docs are updated as well as we spoke about it. Please, let me know if you are ok with.

@camilamacedo86
Copy link
Contributor Author

/test images
/test e2e-aws-helm
/test e2e-aws-go
/test e2e-aws-ansible
/test e2e-aws-subcommand

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estroz are we planning to replace this logic with the static bundle validator? If so, I would only recommend that we make this change if the static bundle validator is also going to include this check.

I'm pretty sure spec.icon is optional for OLM purposes, right? We probably need to distinguish optional and required fields. As is, this PR is grouping spec.icon in with other required fields and I'm not sure that's the impression we want to give to users.

Thoughts?

@@ -93,6 +94,7 @@ Required:
* `spec.displayName` _(user)_ : a name to display for the Operator in Operator Hub.
* `spec.keywords` _(user)_ : a list of keywords describing the Operator.
* `spec.maintainers` _(user)_ : a list of human or organizational entities maintaining the Operator, with a `name` and `email`.
* `spec.icon` _(user)_ : a Base64 encoded image. E.g `cat image.png | base64` or `base64 -w 0 image.jpg`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do go forward with this PR, we should be explicit about which image types are supported.

But, let's hold off on further changes until @estroz weighs in on my previous question so we don't use CI resources unnecessarily.

Co-Authored-By: Joe Lanford <[email protected]>
@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Nov 1, 2019

Hi @joelanford,

I'm pretty sure spec.icon is optional for OLM purposes, right?

Currently, the WARN is done for:

INFO[0000] Required csv fields not filled in file deploy/olm-catalog/app-operator/0.0.1/app-operator.v0.0.1.clusterserviceversion.yaml:
spec.keywords
spec.maintainers
spec.provider

In my understanding, the spec.icon added here is so "optional" as the above specs keywords, maintainers, provider. So, the operator will work without all this info, however, they are required to be populated in order to integrate with OLM and distribute the solution in OperatorHub and/or OCP catalogue.

I understand that all this validation will be improved in the future with new features as we spoke about. It should be just a small pr to help users until there. Shows that we will know better how we can go forward when the operator-framework/api#3 be done.

I am looking for your positions. @joelanford and @estroz
Realy tks for your inputs.

@estroz
Copy link
Member

estroz commented Nov 1, 2019

@joelanford I was under the impression that spec.icon is not required. According to #2071 that might not be the case, or there is a misunderstanding about what is "required" by OLM or not. I will confirm with the OLM team.

The api library will perform these checks.

EDIT: spec.icon is not required. operator-courier issues a warning if it is not present.

@camilamacedo86
Copy link
Contributor Author

Hi @estroz @joelanford,

It is not clear for me the comments. Could we not move forward with this small one? What you are not ok with here and should be changed? Or you would like to close this one?

@joelanford
Copy link
Member

Alright, so my high-level understanding is that the validations done by operator-courier will be replaced with the validations performed by the static bundle validation library.

Since our current CSV generation code does not distinguish between required and recommended fields and since we'll be migrating to use the static bundle validation library, my vote would be to close this PR and update #2071 to reflect our plans to solve it via with the validation library.

@estroz Once the validation library is merged, we plan to integrate it into a new scorecard test. Will we also integrate it into gen-csv?

@camilamacedo86
Copy link
Contributor Author

Closing this one after the discussions and definitions over how it will be addressed.

@camilamacedo86 camilamacedo86 deleted the olm-fields branch November 4, 2019 18:03
@estroz
Copy link
Member

estroz commented Nov 4, 2019

@joelanford yes it will be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants