-
-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Our operator reacts to annotation changes in custom resources.
In the current implementation ReconcileAsync()
is not called when only .metadata
is changed:
Reason is
The
.metadata.generation
value is incremented for all changes, except for changes to.metadata
or.status
.
Describe the solution you would like
Any solution that allows reacting on metadata changes:
- always call
ReconcileAsync()
when metadata is changed - provide an option to override behavior when
ReconcileAsync()
is called - add overload or new method that will be called to
.metadata
or.status
changes
Additional Context
Similar issue #668
Now we are testing a workaround when .generation
is reset during serialization using IJsonOnDeserialized
:
public partial class V1CustomResource : CustomKubernetesEntity<V1V1CustomResource .EntitySpec>, IJsonOnDeserialized
{
// ...
public void OnDeserialized()
{
// HACK
if (Metadata.Annotations?.ContainsKey("special-annotation") == true)
{
Metadata.Generation = null;
}
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request