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

Mirror from OCM around 56 #80

Merged
merged 7 commits into from
Apr 21, 2023
Merged

Commits on Apr 18, 2023

  1. Refactor SendEvent

    This should make it slightly more re-usable in other controllers. In
    particular this allows the `instance` to be `nil`, which might be the
    case if the template was not created.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit c6dadad)
    JustinKuli committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    55d433f View commit details
    Browse the repository at this point in the history
  2. Add clientset to template-sync reconciler

    This might be slightly more performant, and other things can use this
    clientset.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit c01cf0a)
    JustinKuli committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    d0e4651 View commit details
    Browse the repository at this point in the history
  3. Synchronously emit template events

    Previously, the controller-runtime event recorder was used for these
    events. Other policy controllers have moved away from that, for various
    reasons. In this case, if a policy went from pending to noncompliant and
    back to pending, the "old" pending event would be re-used by the event
    recorder, and only the `lastTimestamp` would be updated. In this case,
    if a policy controller emitted a compliance event within the same second
    as the Pending event, the status-sync would see it as a tie, and use the
    hex-encoded nanoseconds in the event name. But the event name was not
    updated from the original instance when the policy was pending, so the
    events would be ordered incorrectly.
    
    Most error cases from this synchronous sending can be ignored because
    they are already error cases that would be requeued.
    
    Refs:
     - https://issues.redhat.com/browse/ACM-4699
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit f0e2c60)
    JustinKuli committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    8f815dd View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. Fix gosec:G104

    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit d6cb733)
    JustinKuli committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    2666d6d View commit details
    Browse the repository at this point in the history
  2. Check gosec results in CI

    The KinD tests action will now run the gosec-scan, and that target will
    fail if any vulnerabilities are found. The target was also configured to
    ignore the test code.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 8c251da)
    JustinKuli committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    b31170f View commit details
    Browse the repository at this point in the history
  3. Add more information to the e2e-debug

    Information about the gatekeeper pods might help if those tests fail.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 0034b03)
    JustinKuli committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    e88d76f View commit details
    Browse the repository at this point in the history
  4. Fix test assertion for duplicate events

    The test is meant to ensure that the gatekeeper-sync is not emitting the
    same event multiple times in a row. But the assertion was failing
    sometimes because of duplicate events from template-errors. Those will
    sometimes occur during normal (correct) operation of the template-sync.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 906dcff)
    JustinKuli committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    8a87b21 View commit details
    Browse the repository at this point in the history