argo-events
argo-events copied to clipboard
Implement observedGeneration in order to compare with standard generation property
Is your feature request related to a problem? Please describe. When observing k8s resource (ArgoCD application) during the update of the values we get two events fired.
Event source is:
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: resource
spec:
template:
serviceAccountName: argo-events-sa
resource:
example:
namespace: argocd
group: argoproj.io
version: v1alpha1
resource: applications
eventTypes:
- UPDATE
filter:
fields:
- key: metadata.name
operation: ==
value: ing
sensor is:
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: resource
spec:
template:
serviceAccountName: argo-events-sa
dependencies:
- name: test-test
eventSourceName: resource
eventName: example
filters:
data:
- path: body.status.health.status
type: string
value:
- Healthy
- path: body.status.sync.status
type: string
value:
- Synced
- path: body.status.operationState.phase
type: string
value:
- Succeeded
triggers:
- template:
name: webhook-pod-trigger
k8s:
group: ""
version: v1
resource: pods
operation: create
source:
resource:
apiVersion: v1
kind: Pod
metadata:
generateName: hello-world-
spec:
containers:
- name: hello-container
args:
- "hello-world"
command:
- cowsay
image: "docker/whalesay:latest"
parameters:
- src:
dependencyName: test-test
dataKey: body
dest: spec.containers.0.args.0
In the first event, we are getting an outdated status section with a "healthy" status for the application. However, the application is still not reconciled.
There is no way to distinguish the outdated status section from the new (valid) status section due to missing observedGeneration
property.
Describe the solution you'd like
implement observedGeneration
in order to compare this property with standard generation
property
Describe alternatives you've considered we tried to find another mechanism to distinguish outdated status section by comparing operationState finishAt and status reconciledAt without success
Message from the maintainers:
If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.
Is this the reason of https://github.com/argoproj/argo-events/issues/1025?
@whynowy I think both are related
@tolko - I want to confirm the order with you, did you mean after the EventSource and Sensor were started, there was an Argo-cd Application update, and 2 events were triggered? Or after an Argo-cd Application object update, starting a EventSource trigged 2 actions?