-
Notifications
You must be signed in to change notification settings - Fork 4
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
Plugin auto installation when operator is installed #89
Plugin auto installation when operator is installed #89
Conversation
851bfa0
to
2da4a3b
Compare
cf825b2
to
9b42c8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! Just a few minor comments.
bundle/manifests/cnf-certsuite-operator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
plugin/consolePlugin.yaml
Outdated
service: | ||
basePath: / | ||
name: cnf-certsuite-plugin | ||
namespace: cnf-certsuite-operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hardcoded namespace on all these plugin's resources must be changed in the controller's code before the err = r.Create(context.Background(), obj.(client.Object))
. Otherwise, it won't work if the operator's subscription is created in a different namespace.
This can be done in a following PR, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look good
a186da3
into
redhat-best-practices-for-k8s:main
Based on [this](#89 (comment)) discussion in previous PR, Instead of using a hard coded ns for the console plugin, the plugin ns will be set according to the ns of the controller. The controller ns is saved as an env var within the container using [downward API](https://github.com/kubernetes/kubernetes/blob/release-1.0/docs/user-guide/downward-api.md). That way, when setting up controller's manager and creating the plugin resources, we can extract the controller's ns and set it as the console plugin ns as well. The plugin resources don't have a default ns, and are set with a place holder for the ns. That way, if we fail to set the operator ns as the plugins ns, will get back an error.
Addressing [this](#89 (comment)) discussion in previous PR. For terms of consistency we'll use only the `kubectl` command instead of `oc` command when running workflows using a kind cluster.
Changes in this PR will make the console plugin of the operator be auto-installed whenever the operator is installed.
This PR allows the plugin installation through the operator using both OLM and the manual installation of the operator.
Plugin resources can be found at the
plugin
directory.Next step: auto delete plugin's resources when the operator is deleted.