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): revert persisted status #5233

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

squakez
Copy link
Contributor

@squakez squakez commented Mar 8, 2024

The work done in #5153 is based on the wrong assumption that a trait status can be persisted at any point of the Integration/IntegrationKit lifecycle This cannot be always true, because the resource move towards different .status.phase with the execution of its logic or not depending on the phase. Therefore we cannot persist in a consistent way, as the status would reflect the latest execution of a trait which may happen in a different phase (and would be overridden by the new execution phase). The best way to deal with this, at this stage, seems to be the usage of .status.conditions in order to warn that some trait value was overwritten.

Release Note

fix(trait): revert persisted status

@squakez squakez mentioned this pull request Mar 8, 2024
@squakez squakez added the trigger native test Use this label in PR when you want to trigger Quarkus Native tests label Mar 8, 2024
@lburgazzoli
Copy link
Contributor

The best way to deal with this, at this stage, seems to be the usage of .status.conditions in order to warn that some trait value was overwritten.

In general, I would recommend not to rely on conditions as those are primarily designed to be consumed by observers rather than the operator itself. A golden rule of controller is that, with some very little exceptions, the status sub resource should not be used to determine the current state.

@squakez
Copy link
Contributor Author

squakez commented Mar 8, 2024

The best way to deal with this, at this stage, seems to be the usage of .status.conditions in order to warn that some trait value was overwritten.

In general, I would recommend not to rely on conditions as those are primarily designed to be consumed by observers rather than the operator itself. A golden rule of controller is that, with some very little exceptions, the status sub resource should not be used to determine the current state.

Yes. The point for the consume of conditions was more directed to a human observer that wants to understand why, for instance, an Quarkus native Integration is instructing the Kit to use 4GB of memory (which is the sensible default configuration the operator overrides).

@lburgazzoli
Copy link
Contributor

Yes. The point for the consume of conditions was more directed to a human observer that wants to understand why, for instance, an Quarkus native Integration is instructing the Kit to use 4GB of memory (which is the sensible default configuration the operator overrides).

should that be part of the kit condition/status then ?

@squakez
Copy link
Contributor Author

squakez commented Mar 8, 2024

should that be part of the kit condition/status then ?

I think it is already happening. We stores conditions of certain traits overridden properties and deprecation notices. It may be polished a little bit (see #5027) but the logic to store them is already there.

@lburgazzoli
Copy link
Contributor

should that be part of the kit condition/status then ?

I think it is already happening. We stores conditions of certain traits overridden properties and deprecation notices. It may be polished a little bit (see #5027) but the logic to store them is already there.

so I'm a little bit confusing about what is the .status.conditions we are talking about here :)

@squakez
Copy link
Contributor Author

squakez commented Mar 8, 2024

so I'm a little bit confusing about what is the .status.conditions we are talking about here :)

NP. Let me try to summarize in shorter terms. .status.conditions already exists and it is meant to provide some info about possible info/warnings the user needs to know. Sometime ago I introduced another field, .status.traits whose goal was to store the executed traits in order to make the operator logic more consistent. However, this development was made based on the wrong assumptions provided in this PR description. The aim of this PR is to remove .status.traits which is inconsistent. Any user interested in troubleshooting an Integration can still rely on .status.conditions as it was doing previously.

@lburgazzoli
Copy link
Contributor

so I'm a little bit confusing about what is the .status.conditions we are talking about here :)

NP. Let me try to summarize in shorter terms. .status.conditions already exists and it is meant to provide some info about possible info/warnings the user needs to know. Sometime ago I introduced another field, .status.traits whose goal was to store the executed traits in order to make the operator logic more consistent. However, this development was made based on the wrong assumptions provided in this PR description. The aim of this PR is to remove .status.traits which is inconsistent. Any user interested in troubleshooting an Integration can still rely on .status.conditions as it was doing previously.

ok then, I was a little bit confused because the .status.traits has been the center of a number of things recently, like checksum, copy to kit, etc so I missed a little bit the context.

sorry for the noise

@squakez
Copy link
Contributor Author

squakez commented Mar 8, 2024

ok then, I was a little bit confused because the .status.traits has been the center of a number of things recently, like checksum, copy to kit, etc so I missed a little bit the context.

sorry for the noise

Probably I was the one making noise with wrong development ;) - Fixing all those wrong stuff though.

The work done in apache#5153 is based on the wrong assumption that a trait status can be persisted at any point of the Integration/IntegrationKit lifecycle
This cannot be always true, because the resource move towards different .status.phase with the execution of its logic or not depending on the phase.
Therefore we cannot persist in a consistent way, as the status would reflect the latest execution of a trait which may happen in a different phase (and would be overridden by the new execution phase).
The best way to deal with this, at this stage, seems to be the usage of .status.conditions in order to warn that some trait value was overwritten.
@squakez squakez force-pushed the fix/revert_traits_status branch from 394393d to bf2f9c9 Compare March 8, 2024 13:42
@squakez
Copy link
Contributor Author

squakez commented Mar 8, 2024

--- PASS: TestNativeHighMemoryIntegrations (1834.10s)
    --- PASS: TestNativeHighMemoryIntegrations/java_native_support (875.74s)
        --- PASS: TestNativeHighMemoryIntegrations/java_native_support/java_native_same_should_not_rebuild (2.21s)
        --- PASS: TestNativeHighMemoryIntegrations/java_native_support/java_native_should_rebuild (428.39s)
    --- PASS: TestNativeHighMemoryIntegrations/groovy_native_support (495.43s)
    --- PASS: TestNativeHighMemoryIntegrations/kotlin_native_support (451.77s)
PASS
ok  	github.com/apache/camel-k/v2/e2e/native	1834.133s
--- PASS: TestNativeIntegrations (884.52s)
    --- PASS: TestNativeIntegrations/unsupported_integration_source_language (0.76s)
    --- PASS: TestNativeIntegrations/xml_native_support (412.21s)
    --- PASS: TestNativeIntegrations/automatic_rollout_deployment_from_jvm_to_native_kit (462.53s)
        --- PASS: TestNativeIntegrations/automatic_rollout_deployment_from_jvm_to_native_kit/yaml_native_should_not_rebuild (2.70s)
PASS
ok  	github.com/apache/camel-k/v2/e2e/native	1330.983s

@squakez squakez merged commit b986989 into apache:main Mar 8, 2024
14 of 16 checks passed
@squakez squakez deleted the fix/revert_traits_status branch March 8, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trigger native test Use this label in PR when you want to trigger Quarkus Native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants