gardener / kupid

Inject scheduling criteria into target pods orthogonally by policy definition.
Apache License 2.0
11 stars 19 forks source link

fixes the issue where the mutation log does not get printed the first… #61

Open unmarshall opened 1 year ago

unmarshall commented 1 year ago

What this PR does / why we need it: As part of https://github.com/gardener/kupid/pull/59 we added logic to take a cartesian product of NSRs. Along with that change we also added an ability to compute the delta change and print it to the logs for better diagnostics. However there was a gap left where the first time a change is done to a k8s resource (e.g. sts) where there are no existing node affinity policies defined and kupid injects the policies as defined in the clusterpodschedulingpolicies then it does not print that mutation in the logs.

Which issue(s) this PR fixes: Fixes #60

Special notes for your reviewer:

Release note:

Will also log the first mutation done to NodeAffinity policies done to a resource where none existed.
ashwani2k commented 1 year ago

I tested this PR on a local-setup and it still doesn't show the logs for the first change on the STS. Only subsequent changes are logged.