Closed k15r closed 7 months ago
We agreed on investigating the root cause of this behaviour estimate it to 1. Follow-up issue for the fix will be linked here as well.
After investigating into this Issue I have the following conclusion:
Deleting
if the DeletionTimestamp has been set and the state is unequal to Deleting
, then it triggers a new reconiliationDeleting
it continues with the normal workflow of synchronising the resources, thus if the Module CR has the state Warning
(even with set DeletionTimestamp), the state will be propagated to the Manifest CR -> Manifest has now Warning
stateAcceptance Criterias:
Add new flag to Template-Operator which allows to set the State when Module is in Deleting
; default Deleting
-> Can be used to simulate more complex scenarios like the one describes in this ticket; I.e. Final-Deleting-State
Fix flapping state bug
declarative/ 2/reconciler.go
in the syncResoruces
function it always sets the status of the manifest CR to Deleting if the DeletionTimestamp is unequal to zero, this needs to be changed to avoid the status flapping between Deleting
and Warning
if obj.GetDeletionTimestamp().IsZero() {
obj.SetStatus(status.WithState(shared.StateProcessing).WithOperation(ErrWarningResourceSyncStateDiff.Error()))
} else if status.State != shared.StateWarning {
obj.SetStatus(status.WithState(shared.StateDeleting).WithOperation("manifest should be deleted"))
}
Adapt E2E Test in KLM
warning_status_propagation_test.go
:
CONSISTENTLY
if Kyma and Manifest CR are in Warning
state (First check with eventually condition and then with consistently; since this test should have been covered this scenaroi from the bug, but since it it flapping between the states the Eventually
results to trueBy("And Module Manifest CR is consistently in a \"Warning\" State")
Eventually(CheckManifestIsInState).
WithContext(ctx).
WithArguments(kyma.GetName(), kyma.GetNamespace(), module.Name, controlPlaneClient,
shared.StateWarning).
Should(Succeed())
Consistently(CheckManifestIsInState).
WithContext(ctx).
WithArguments(kyma.GetName(), kyma.GetNamespace(), module.Name, controlPlaneClient,
shared.StateWarning).
Should(Succeed())
Template-Operator Changes will be done in https://github.com/kyma-project/template-operator/issues/147 Unitl then this issue is blcoked.
Description
If a module goes into
warning
state during deletion the kyma-CR will report it alternatingIs Deleting
andWarning
Steps to reproduce
eg: install nats module create resources on nats:
delete the nats module
it will go into warning state as the manager will not remove the reconciler (resources exist on the nats cluster) the result can be seen in the attachment
Environment Type
Managed
Environment Info
Kubernetes Version: x.y.z Docker Version: x.y.z Kyma CLI Version: x.y.z If used - k3d/k3s/minikube versions
Attachments
https://github.com/kyma-project/lifecycle-manager/assets/292906/169ce74e-3bc6-41f7-b065-27fd10fdd38a