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

🤖 Sync from open-cluster-management-io/config-policy-controller: #161 #575

Merged
merged 5 commits into from
Sep 7, 2023

Commits on Sep 7, 2023

  1. Fix compliance when created resource has a status

    Previously, the template would always be marked as compliant after the
    resource it defines was created. But if the object definition included
    a `status`, then the object might not actually match what was desired.
    Now, in this case, the template will be marked as non-compliant.
    
    Refs:
     - https://issues.redhat.com/browse/ACM-7020
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 04a91c0)
    JustinKuli authored and Magic Mirror committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    32b5f8b View commit details
    Browse the repository at this point in the history
  2. Refactor: rename some fields in singleObject

    The `object` and `unstruct` fields were not self-explanatory. Now they
    are `existingObj` and `desiredObj` respectively. This will help readers
    understand why they are used the way they are.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 4eea290)
    JustinKuli authored and Magic Mirror committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    7587389 View commit details
    Browse the repository at this point in the history
  3. Refactor: better uid lookup

    In both instances, the object is already assured to be non-nil, so there
    are no errors that can occur here.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 05177fb)
    JustinKuli authored and Magic Mirror committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    5146a7d View commit details
    Browse the repository at this point in the history
  4. Refactor: clarify conditions in handleSingleObj

    By keeping track of which branch we're in, it became obvious that the
    `generateSingleObjReason` calls were actually just static lookups. So
    that function has been removed.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit f6f82b5)
    JustinKuli authored and Magic Mirror committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    cbd6956 View commit details
    Browse the repository at this point in the history
  5. Refactor: move metrics for checkAndUpdateResource

    Putting this in the function itself means that the function could be
    called from multiple places, and the metrics would still be recorded.
    
    Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
    (cherry picked from commit 406ccf7)
    JustinKuli authored and Magic Mirror committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    b2b050d View commit details
    Browse the repository at this point in the history