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

[release-4.15] OCPBUGS-30570: Fix for ACM Policy Generator Plugin #756

Merged

Conversation

edcdavid
Copy link
Contributor

  • This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
    For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
    In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
    clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

  • Addressing Jun's comments

  • Addinitonal fixes for map key

  • fix kuttl test

@openshift-ci-robot
Copy link

@edcdavid: This pull request references Jira Issue OCPBUGS-29208, which is invalid:

  • expected the bug to target either version "4.15." or "openshift-4.15.", but it targets "4.16.0" instead
  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED instead
  • expected Jira Issue OCPBUGS-29208 to depend on a bug targeting a version in 4.16.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

  • This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
    For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
    In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
    clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

  • Addressing Jun's comments

  • Addinitonal fixes for map key

  • fix kuttl test

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 openshift-eng/jira-lifecycle-plugin repository.

@edcdavid
Copy link
Contributor Author

/test integration

@edcdavid
Copy link
Contributor Author

/retest

1 similar comment
@edcdavid
Copy link
Contributor Author

/retest

* This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:
 - namespace+"/"+name key used in the clusterGroupUpgrade.Status.SafeResourceNames map
 - use of namespace instead of namespace length in GetSafeResourceName
 - use of utf8.RuneCountInString() instead of len to support non english characters (see policy web hook at https://github.com/stolostron/governance-policy-propagator/blob/feb9abb241954d7ce64054d7c621b423deece8cf/api/v1/policy_webhook.go#L86-L87 ).
 - adding logs to display the safenames and lenghts

* Addressing Jun's comments

* Addinitonal fixes for map key

* fix kuttl test
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2024
Copy link

openshift-ci bot commented Feb 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jc-rh

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit b6e0457 into openshift-kni:release-4.15 Feb 27, 2024
6 checks passed
@openshift-ci-robot
Copy link

@edcdavid: Jira Issue OCPBUGS-29208 is in an unrecognized state (ON_QA) and will not be moved to the MODIFIED state.

In response to this:

  • This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
    For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
    In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
    clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

  • Addressing Jun's comments

  • Addinitonal fixes for map key

  • fix kuttl test

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 openshift-eng/jira-lifecycle-plugin repository.

edcdavid added a commit to edcdavid/cluster-group-upgrades-operator that referenced this pull request Feb 27, 2024
openshift-kni#756)

* This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:
 - namespace+"/"+name key used in the clusterGroupUpgrade.Status.SafeResourceNames map
 - use of namespace instead of namespace length in GetSafeResourceName
 - use of utf8.RuneCountInString() instead of len to support non english characters (see policy web hook at https://github.com/stolostron/governance-policy-propagator/blob/feb9abb241954d7ce64054d7c621b423deece8cf/api/v1/policy_webhook.go#L86-L87 ).
 - adding logs to display the safenames and lenghts

* Addressing Jun's comments

* Addinitonal fixes for map key

* fix kuttl test
@edcdavid edcdavid changed the title [release-4.15] OCPBUGS-29208: Fix for ACM Policy Generator Plugin (#751) [release-4.15] OCPBUGS-30570: Fix for ACM Policy Generator Plugin Mar 8, 2024
@openshift-ci-robot
Copy link

@edcdavid: Jira Issue OCPBUGS-30570: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-30570 has been moved to the MODIFIED state.

In response to this:

  • This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
    For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
    In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
    clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

  • Addressing Jun's comments

  • Addinitonal fixes for map key

  • fix kuttl test

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 openshift-eng/jira-lifecycle-plugin repository.

@edcdavid
Copy link
Contributor Author

edcdavid commented Mar 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@edcdavid: Jira Issue OCPBUGS-30570 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@edcdavid
Copy link
Contributor Author

edcdavid commented Mar 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@edcdavid: Jira Issue OCPBUGS-30570: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-30570 has been moved to the MODIFIED state.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@edcdavid
Copy link
Contributor Author

edcdavid commented Mar 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@edcdavid: Jira Issue OCPBUGS-30570: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-30570 has been moved to the MODIFIED state.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@edcdavid
Copy link
Contributor Author

edcdavid commented Mar 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@edcdavid: Jira Issue OCPBUGS-30570: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-30570 has been moved to the MODIFIED state.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

openshift-merge-bot bot pushed a commit that referenced this pull request Mar 12, 2024
* This commit fixes an issue happening when using policies generated with ACM Policy Generator Plugin.
For ConfigurationPolicy kind, the name of the object and the inner template are the same when generated with ACM Gen.
In comparison the PGT plugin, adds "-config" to the name of the inner template. this leads to overloaded keys in the
clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:
 - namespace+"/"+name key used in the clusterGroupUpgrade.Status.SafeResourceNames map
 - use of namespace instead of namespace length in GetSafeResourceName
 - use of utf8.RuneCountInString() instead of len to support non english characters (see policy web hook at https://github.com/stolostron/governance-policy-propagator/blob/feb9abb241954d7ce64054d7c621b423deece8cf/api/v1/policy_webhook.go#L86-L87 ).
 - adding logs to display the safenames and lenghts

* Addressing Jun's comments

* Addinitonal fixes for map key

* fix kuttl test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants