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

changes checking modified events with last-modified annotations #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

prtkdaved
Copy link
Collaborator

This PR contains the solution for event triggers when changes_fields mentioned in rulebooks but does not have annotations "kubectl.kubernetes.io/last-applied-configuration".

  1. Added condition to check the "kubectl.kubernetes.io/last-applied-configuration" k8s.py
  2. Added test case modified_configmap_no_last_applied_config to test the behaviour.

last_applied_configuration = json.loads(
last_applied_configuration_str
)
if last_applied_configuration_str:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a comment above.

if last_applied_configuration_str:
last_applied_configuration = json.loads(
last_applied_configuration_str
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to add a debug log here. After that, continue to avoid falling into the other logic.

@edwinpjacques
Copy link
Collaborator

edwinpjacques commented Mar 13, 2025

I think it would be good to update docs/juniper.eda.k8s_source_plugin.rst as well to document the nuance that if the lastappliedconfiguration field is required to validate if a field has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants