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

Plugin auto installation when operator is installed #89

Merged

Conversation

shirmoran
Copy link
Collaborator

@shirmoran shirmoran commented Jul 3, 2024

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.

@shirmoran shirmoran force-pushed the plugin-installation branch 2 times, most recently from 851bfa0 to 2da4a3b Compare July 3, 2024 12:17
Copy link
Collaborator

@greyerof greyerof left a 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.

Makefile Show resolved Hide resolved
plugin/consolePlugin.yaml Outdated Show resolved Hide resolved
service:
basePath: /
name: cnf-certsuite-plugin
namespace: cnf-certsuite-operator
Copy link
Collaborator

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.

.github/workflows/pre-main.yaml Show resolved Hide resolved
@shirmoran shirmoran requested a review from greyerof July 18, 2024 09:04
Copy link

@aabughosh aabughosh left a comment

Choose a reason for hiding this comment

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

look good

@shirmoran shirmoran merged commit a186da3 into redhat-best-practices-for-k8s:main Jul 18, 2024
3 checks passed
shirmoran added a commit that referenced this pull request Aug 5, 2024
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.
shirmoran added a commit that referenced this pull request Aug 5, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants