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

fix(trait): watch for resource versions... #5218

Merged
merged 1 commit into from Mar 6, 2024

Conversation

squakez
Copy link
Contributor

@squakez squakez commented Mar 5, 2024

...instead of for their content.

With this PR we fix a potentially risky behavior, as we were inspecting Configmap/Secrets content to address any change. Instead of looking directly the content, we watch for the changing resource version, which should be the way provided by the platform to know when a resource has changed without inspecting its content.

Release Note

fix(trait): watch for resource versions

@lburgazzoli
Copy link
Contributor

Note that resourceVersion changes also in case of any of the metadata changes

@squakez
Copy link
Contributor Author

squakez commented Mar 5, 2024

Note that resourceVersion changes also in case of any of the metadata changes

Thanks. Not sure if there is any better way to deal with this, any idea? At least we remove the inspection of a secret, with the tradeoff to potentially reload an Integration when there is a metadata change as well.

@squakez squakez force-pushed the fix/revert_config_inspection branch from 2dd3fb5 to 5c32fa3 Compare March 5, 2024 17:20
@lburgazzoli
Copy link
Contributor

lburgazzoli commented Mar 5, 2024

Note that resourceVersion changes also in case of any of the metadata changes

Thanks. Not sure if there is any better way to deal with this, any idea? At least we remove the inspection of a secret, with the tradeoff to potentially reload an Integration when there is a metadata change as well.

I don't think there is a better solution so is a matter of document the behavior.

Maybe, should we honor the mount.hot-reload option ? In some cases, the user may not have full control of the configmap/secrets i.e. when those resources are generated by another controller.

@squakez
Copy link
Contributor Author

squakez commented Mar 6, 2024

Maybe, should we honor the mount.hot-reload option ? In some cases, the user may not have full control of the configmap/secrets i.e. when those resources are generated by another controller.

The option is already used in the controller to wake up the Integration and kick the logic:

if integration.Spec.Traits.Mount == nil || !pointer.BoolDeref(integration.Spec.Traits.Mount.HotReload, false) {
- do you think we need to include this again in the getIntegrationSecretAndConfigmapResourceVersions func? I think it may be a duplicated check, but definetely it's something that should not hurt.

@lburgazzoli
Copy link
Contributor

lburgazzoli commented Mar 6, 2024

Maybe, should we honor the mount.hot-reload option ? In some cases, the user may not have full control of the configmap/secrets i.e. when those resources are generated by another controller.

The option is already used in the controller to wake up the Integration and kick the logic:

if integration.Spec.Traits.Mount == nil || !pointer.BoolDeref(integration.Spec.Traits.Mount.HotReload, false) {

  • do you think we need to include this again in the getIntegrationSecretAndConfigmapResourceVersions func? I think it may be a duplicated check, but definetely it's something that should not hurt.

I don't have the full picture but my reasoning is that, the hot reload flag prevents a reconciliation to happen but, in case the reconciliation is triggered by i.e. a non destructive trait change, then we ends up in the same case as #5192, which effectively will end up in a restart/reload.

That said, this seems to be the case as today anyhow so not sure if we want to fix it now or have some better reasoning as part of #5192,

@squakez squakez force-pushed the fix/revert_config_inspection branch from 5c32fa3 to 23a138f Compare March 6, 2024 08:48
@squakez
Copy link
Contributor Author

squakez commented Mar 6, 2024

@lburgazzoli I've added a check on the presence of the hot-reload flag and a short documentation notice to warn about the behavior. Thanks.

...instead of for their content.
@squakez squakez force-pushed the fix/revert_config_inspection branch from 23a138f to d9b2c6f Compare March 6, 2024 08:54
@squakez
Copy link
Contributor Author

squakez commented Mar 6, 2024

Check failure relates to #5197

@squakez squakez merged commit c401351 into apache:main Mar 6, 2024
14 of 16 checks passed
@squakez squakez deleted the fix/revert_config_inspection branch March 6, 2024 15:27
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.

None yet

3 participants