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: #298 #1041

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

magic-mirror-bot[bot]
Copy link

@magic-mirror-bot magic-mirror-bot bot commented Sep 25, 2024

Previously, this map was initialized when being setup with a controller
runtime manager. It is not necessary to wait until then, and it was
preventing any possibility of running the reconcilers without a real
manager (for example, in tests).

Signed-off-by: Justin Kulikauskas <[email protected]>
(cherry picked from commit a98f4aaeae5ba0d8b9a135877613a65a2b8ca69c)
Storing both the rest.Config *and* multiple clients generated from it
could lead to confusion, and prevented the possibility of using clients
that we don't have the config for (potentially in tests).

Signed-off-by: Justin Kulikauskas <[email protected]>
(cherry picked from commit af4207604479985c8aa47f7e3f4342a0ae1cbd80)
v2 is much more configurable.

Signed-off-by: Justin Kulikauskas <[email protected]>
(cherry picked from commit 684ffc32e971cb5833b11709b87fb5be64d45ab4)
This would allow a user to save a set of REST mappings from an existing
cluster which the config-policy-controller reconciler *could* use
instead of a "live" discovery API. Currently the setup in main.go for
the controller *does not* connect this, but it would be possible to add
in the future.

The included "default-mappings.yaml" file is the output of the tool from
a simple kind cluster.

Signed-off-by: Justin Kulikauskas <[email protected]>
(cherry picked from commit d914d301ab450a8b2bb08eb926928d449ccdcc15)
This command allows for the testing of configuration policies without a
cluster. "Cluster state" is provided via input files, which are
simulated in a fake cluster. A real config-policy-controller reconciler
is run against this fake cluster, and the resulting policy status, as
well as the compliance events, are captured and can be displayed to the
user. If the policy is noncompliant, the command exits with error code 2
(to distinguish it from other possible exit reasons).

This also exposes the GenerateMappings command as a subcommand.

Refs:
 - https://issues.redhat.com/browse/ACM-14161

Signed-off-by: Justin Kulikauskas <[email protected]>
(cherry picked from commit 6e86ab4328e1db4abdd5b2195a6e8d87fc4f2b40)
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

SonarCloud found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@mprahl
Copy link
Contributor

mprahl commented Sep 25, 2024

/override "SonarCloud Code Analysis"

It seems that SonarCloud doesn't like @JustinKuli's security practices in his test manifests for the dryrun CLI.

Copy link

openshift-ci bot commented Sep 25, 2024

@mprahl: Overrode contexts on behalf of mprahl: SonarCloud Code Analysis

In response to this:

/override "SonarCloud Code Analysis"

It seems that SonarCloud doesn't like @JustinKuli's security practices in his test manifests for the dryrun CLI.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

openshift-ci bot commented Sep 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: magic-mirror-bot[bot], mprahl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

sonarcloud bot commented Sep 26, 2024

@openshift-merge-bot openshift-merge-bot bot merged commit da95cec into main Sep 26, 2024
20 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the magic-mirror-main-1727286035352 branch September 26, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

😿 Failed to sync the upstream PRs: #298
2 participants