Skip to content

Conversation

DnPlas
Copy link
Contributor

@DnPlas DnPlas commented Jan 28, 2025

  • refactor: use main event handler and defer it if Knative CRDs are not found

The Knative Serving and Eventing charms have a strong dependency on knative-operator, as it is the application that applies the KnativeServing and KnativeEventing CRDs and has the business logic to reconcile such CRs. Because the Knative Serving and Eventing charms depend entirely on the existence of those CRDs, this commit refactors the charms logic to:

  1. Use a main event handler that can be deferred in case the required CRDs are not present
  2. Remove any operation for the on_install event, and use the main event handler for config_changed as it is guaranteed that it'll be triggered right after on_install

Part of #156
Fixes #279

… found (#276)

* refactor: use main event handler and defer it if Knative CRDs are not found

The Knative Serving and Eventing charms have a strong dependency on knative-operator,
as it is the application that applies the KnativeServing and KnativeEventing CRDs and
has the business logic to reconcile such CRs. Because the Knative Serving and Eventing
charms depend entirely on the existence of those CRDs, this commit refactors the charms
logic to:
1. Use a main event handler that can be deferred in case the required CRDs are not present
2. Remove any operation for the on_install event, and use the main event handler for config_changed
as it is guaranteed that it'll be triggered right after on_install

Fixes #156
@DnPlas DnPlas marked this pull request as ready for review January 28, 2025 21:28
In a previous commit, a check for knative CRDs was introduced, but for
knative-eventing, it was incorrectly set up. This commit fixes the name
of the CRD that the knative-eventing charm should look up for.
@DnPlas DnPlas merged commit aa88a50 into track/1.12 Jan 29, 2025
23 checks passed
@DnPlas DnPlas deleted the KF-6797-backport-141feb7-track-1.12 branch January 29, 2025 13:05
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.

2 participants