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

simple deploy_marketplace.sh #409

Closed

Conversation

AsherShoshan
Copy link

A simple deploy_Marketplace.sh script, which does not include the creation of operatorSource nor catalogSourceConfig.
In upstream/downstream openshift cluster creation of operatorSorce/catalogSource is not required (redhat-operators is used)
For QE/Dev environment, custom opsrc/catsrc are provided in an earlier step of cluster creation.

@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. size/L labels Jan 21, 2020
Copy link
Member

@dankenigsberg dankenigsberg left a comment

Choose a reason for hiding this comment

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

It may be a good idea to simplify this script by dropping half of its code, but you should probably explain why nobody needs the catalogSource preparation.

I would suggest to keep the code, but move it to a function. Then you can run the script with something like --use-existing-catalog-source if you do not need a new one.

@@ -2,195 +2,72 @@

set -ex

RED='\033[0;31m'
NO_COLOR='\033[0m'
Copy link
Member

Choose a reason for hiding this comment

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

this change is irrelevant. If you think that this should be dropped, please do it in a separate PR.

Copy link
Author

Choose a reason for hiding this comment

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

Because when you have a cluster (clean one), you already have 3 catalogsources: redhat-operators, community, and certified-operators. So no need for preparation.
In case of QE/Dev, custom catalogsources are prepared earlier, and already used for other operators (not just CNV)

Should someone, needs a custom catsrc, then he can't use the "full" script as it's not supporting the creation of a plain catalogSource (ONLY by operatorSource, from QUAY).

IMO, an OLM catalogSource creation script, should be added to repo as an extra utility, and to support plain/opsrc catsrc creation.

Copy link
Member

Choose a reason for hiding this comment

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

I don't like long scripts myself. If you want to split out some logic to another script, please do it. But please take care of existing use cases

Copy link
Author

Choose a reason for hiding this comment

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

As mentioned before, for 99.99% of deploy_marketplace.sh, creation of catalogSOurce is not required. For other cases, the split is in a new script (with old content) deploy_operatoSource.sh.

Copy link
Member

Choose a reason for hiding this comment

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

Currently we already have deploy_imageregistry.sh (to consume the bundle image as a local registry) and deploy_marketplace.sh (to deploy pointing to a remote app-registry) and we want to unify them (to avoid having to duplicate each fix to both of them).
Introducing a third script is definitively not an option.

Copy link
Author

Choose a reason for hiding this comment

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

deploy_imageregistry is creating catalogSource not an operatorSource from QUAY.
Also this one should be splitted..
Sure, it's a good idea to unify them (just for catsrc/opsrc creation)

globalNamespace=`oc -n openshift-operator-lifecycle-manager get deployments catalog-operator -o jsonpath='{.spec.template.spec.containers[].args[1]}'`
echo "Global Namespace: ${globalNamespace}"
GLOBAL_NAMESPACE="${GLOBAL_NAMESPACE:-$globalNamespace}"
Copy link
Member

Choose a reason for hiding this comment

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

I see you do not introduce this in this PR, but the previous line printed one value, and now you are going to use another. This would confuse the reader.

Copy link
Author

Choose a reason for hiding this comment

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

It's not used at all, and the confusion is there also with the original script.
Note it's running 'oc' command, even if it's called with CLUSTER=KUBERNETES.
It's should be removed completely.

Copy link
Member

@tiraboschi tiraboschi left a comment

Choose a reason for hiding this comment

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

I'd prefer to split the code into helper functions and eventually skip what's not needed for the specific case instead of removing the code that is still relevant for other use cases.

@AsherShoshan AsherShoshan force-pushed the simpleDeployMarketplace branch from 9e86911 to a043742 Compare January 22, 2020 10:25
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 23, 2020
@AsherShoshan AsherShoshan force-pushed the simpleDeployMarketplace branch from a043742 to 3c6a7e9 Compare January 28, 2020 15:28
@kubevirt-bot kubevirt-bot 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 Jan 28, 2020
@AsherShoshan AsherShoshan force-pushed the simpleDeployMarketplace branch from 4b2b896 to 234d911 Compare January 30, 2020 13:48
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2020
@AsherShoshan AsherShoshan force-pushed the simpleDeployMarketplace branch from 234d911 to c814b22 Compare January 30, 2020 14:12
@kubevirt-bot
Copy link
Contributor

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@tiraboschi
Copy link
Member

We are going to use kustomize for this, see #463

@tiraboschi tiraboschi closed this Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: no Indicates the PR's author has not DCO signed all their commits. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants