-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bug: The syncMode written in EventTrigger is not being transferred to ClusterProfile. #465
Comments
Thank you @kahirokunn This is a bug. The syncMode must be copied over to ClusterProfile. |
gianlucam76
added a commit
to gianlucam76/event-manager
that referenced
this issue
Feb 3, 2025
CloudEventAction can be expressed as a template. So whether to create or delete can be a function of CloudEvent properties. For instance ````yaml apiVersion: lib.projectsveltos.io/v1beta1 kind: EventSource metadata: name: user-operation spec: messagingMatchCriteria: - subject: "user-operation" cloudEventSource: "auth.example.com/operation" --- apiVersion: lib.projectsveltos.io/v1beta1 kind: EventTrigger metadata: name: manage-namespace spec: sourceClusterSelector: matchLabels: env: fv eventSourceName: user-operation oneForEvent: true syncMode: ContinuousWithDriftDetection cloudEventAction: "{{ if eq .CloudEvent.type 'auth.example.com.logout' }}Delete{{ else }}Create{{ end }}" policyRefs: - name: namespace namespace: default kind: ConfigMap --- apiVersion: v1 kind: ConfigMap metadata: name: namespace namespace: default annotations: projectsveltos.io/instantiate: ok data: namespace.yaml: | kind: Namespace apiVersion: v1 metadata: name: {{ .CloudEvent.subject }} ``` when CloudEvent is for instance ``` CLOUDEVENT_JSON=$(cat << EOF { "specversion": "1.0", "type": "auth.example.com.login", "source": "auth.example.com/operation", "id": "10001", "subject": "mgianluc", "datacontenttype": "application/json", "data": { "message": "Hello from bash!" } } EOF ) ``` namespace is created. When CloudEvent is ``` CLOUDEVENT_JSON=$(cat << EOF { "specversion": "1.0", "type": "auth.example.com.logòut", "source": "auth.example.com/operation", "id": "10001", "subject": "mgianluc", "datacontenttype": "application/json", "data": { "message": "Hello from bash!" } } EOF ) ``` namespace is deleted. This PR also fixes this [bug](projectsveltos/sveltos#465).
gianlucam76
added a commit
to gianlucam76/event-manager
that referenced
this issue
Feb 3, 2025
CloudEventAction can be expressed as a template. So whether to create or delete can be a function of CloudEvent properties. For instance ````yaml apiVersion: lib.projectsveltos.io/v1beta1 kind: EventSource metadata: name: user-operation spec: messagingMatchCriteria: - subject: "user-operation" cloudEventSource: "auth.example.com/operation" --- apiVersion: lib.projectsveltos.io/v1beta1 kind: EventTrigger metadata: name: manage-namespace spec: sourceClusterSelector: matchLabels: env: fv eventSourceName: user-operation oneForEvent: true syncMode: ContinuousWithDriftDetection cloudEventAction: "{{ if eq .CloudEvent.type 'auth.example.com.logout' }}Delete{{ else }}Create{{ end }}" policyRefs: - name: namespace namespace: default kind: ConfigMap --- apiVersion: v1 kind: ConfigMap metadata: name: namespace namespace: default annotations: projectsveltos.io/instantiate: ok data: namespace.yaml: | kind: Namespace apiVersion: v1 metadata: name: {{ .CloudEvent.subject }} ``` when CloudEvent is for instance ``` CLOUDEVENT_JSON=$(cat << EOF { "specversion": "1.0", "type": "auth.example.com.login", "source": "auth.example.com/operation", "id": "10001", "subject": "mgianluc", "datacontenttype": "application/json", "data": { "message": "Hello from bash!" } } EOF ) ``` namespace is created. When CloudEvent is ``` CLOUDEVENT_JSON=$(cat << EOF { "specversion": "1.0", "type": "auth.example.com.logòut", "source": "auth.example.com/operation", "id": "10001", "subject": "mgianluc", "datacontenttype": "application/json", "data": { "message": "Hello from bash!" } } EOF ) ``` namespace is deleted. This PR also fixes this [bug](projectsveltos/sveltos#465).
gianlucam76
added a commit
to gianlucam76/event-manager
that referenced
this issue
Feb 3, 2025
CloudEventAction can be expressed as a template. So whether to create or delete can be a function of CloudEvent properties. For instance ````yaml apiVersion: lib.projectsveltos.io/v1beta1 kind: EventSource metadata: name: user-operation spec: messagingMatchCriteria: - subject: "user-operation" cloudEventSource: "auth.example.com/operation" --- apiVersion: lib.projectsveltos.io/v1beta1 kind: EventTrigger metadata: name: manage-namespace spec: sourceClusterSelector: matchLabels: env: fv eventSourceName: user-operation oneForEvent: true syncMode: ContinuousWithDriftDetection cloudEventAction: "{{ if eq .CloudEvent.type 'auth.example.com.logout' }}Delete{{ else }}Create{{ end }}" policyRefs: - name: namespace namespace: default kind: ConfigMap --- apiVersion: v1 kind: ConfigMap metadata: name: namespace namespace: default annotations: projectsveltos.io/instantiate: ok data: namespace.yaml: | kind: Namespace apiVersion: v1 metadata: name: {{ .CloudEvent.subject }} ``` when CloudEvent is for instance ``` CLOUDEVENT_JSON=$(cat << EOF { "specversion": "1.0", "type": "auth.example.com.login", "source": "auth.example.com/operation", "id": "10001", "subject": "mgianluc", "datacontenttype": "application/json", "data": { "message": "Hello from bash!" } } EOF ) ``` namespace is created. When CloudEvent is ``` CLOUDEVENT_JSON=$(cat << EOF { "specversion": "1.0", "type": "auth.example.com.logòut", "source": "auth.example.com/operation", "id": "10001", "subject": "mgianluc", "datacontenttype": "application/json", "data": { "message": "Hello from bash!" } } EOF ) ``` namespace is deleted. This PR also fixes this [bug](projectsveltos/sveltos#465).
Fix will be in v0.46.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The written EventTrigger is as follows.
The generated ClusterProfile is as follows.
Is this perhaps a processing description omission? 👀
The text was updated successfully, but these errors were encountered: