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

OCPBUGS-29208: Fix for ACM Policy Generator Plugin #751

Merged
merged 4 commits into from Feb 21, 2024

Conversation

edcdavid
Copy link
Contributor

@edcdavid edcdavid commented Feb 7, 2024

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 (see https://github.com/openshift-kni/cnf-features-deploy/blob/dc64c970fa59dacf387f1e432d6a46ea551dbb1c/ztp/policygenerator/policyGen/policyBuilder.go#L422). this leads to overloaded keys in the
clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

@openshift-ci openshift-ci bot requested review from jc-rh and sakhoury February 7, 2024 20:53
Copy link

openshift-ci bot commented Feb 7, 2024

Hi @edcdavid. Thanks for your PR.

I'm waiting for a openshift-kni member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 7, 2024
…th 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
@edcdavid edcdavid changed the title Fix for ACM Policy Generator Plugin. OCPBUGS-29208: Fix for ACM Policy Generator Plugin. Feb 8, 2024
@openshift-ci-robot
Copy link

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

  • expected the bug to target the "4.16.0" version, but no target version was set

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:

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 (see https://github.com/openshift-kni/cnf-features-deploy/blob/dc64c970fa59dacf387f1e432d6a46ea551dbb1c/ztp/policygenerator/policyGen/policyBuilder.go#L422). this leads to overloaded keys in the
clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

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 edcdavid changed the title OCPBUGS-29208: Fix for ACM Policy Generator Plugin. OCPBUGS-29208: Fix for ACM Policy Generator Plugin Feb 8, 2024
@edcdavid
Copy link
Contributor Author

edcdavid commented Feb 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

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

  • expected the bug to target the "4.16.0" version, but no target version was set

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:

/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 Feb 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

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

  • expected the bug to target the "4.16.0" version, but no target version was set

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.

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 Feb 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@edcdavid: This pull request references Jira Issue OCPBUGS-29208, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

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 Feb 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@edcdavid: This pull request references Jira Issue OCPBUGS-29208, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

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.

controllers/utils/common.go Outdated Show resolved Hide resolved
controllers/utils/common.go Outdated Show resolved Hide resolved
@jc-rh
Copy link
Member

jc-rh commented Feb 13, 2024

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 13, 2024
@edcdavid edcdavid force-pushed the fix-acm-gen branch 2 times, most recently from 387a86c to 80318c8 Compare February 15, 2024 23:32
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 21, 2024
Copy link

openshift-ci bot commented Feb 21, 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 21, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 8260704 into openshift-kni:main Feb 21, 2024
6 checks passed
@openshift-ci-robot
Copy link

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

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

In response to this:

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 (see https://github.com/openshift-kni/cnf-features-deploy/blob/dc64c970fa59dacf387f1e432d6a46ea551dbb1c/ztp/policygenerator/policyGen/policyBuilder.go#L422). this leads to overloaded keys in the
clusterGroupUpgrade.Status.SafeResourceNames map.

Changes:

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

/cherry-pick release-4.15

@openshift-cherrypick-robot

@edcdavid: only openshift-kni org members may request cherry picks. If you are already part of the org, make sure to change your membership to public. Otherwise you can still do the cherry-pick manually.

In response to this:

/cherry-pick release-4.15

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/test-infra repository.

@edcdavid
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@edcdavid: #751 failed to apply on top of branch "release-4.15":

Applying: 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.
Applying: Addressing Jun's comments
Applying: Addinitonal fixes for map key
Applying: fix kuttl test
Using index info to reconstruct a base tree...
M	tests/kuttl/tests/backup-complete/02-assert.yaml
M	tests/kuttl/tests/backup-fail/02-assert.yaml
M	tests/kuttl/tests/backup-partial-complete/02-assert.yaml
M	tests/kuttl/tests/pre-caching-complete/03-assert.yaml
M	tests/kuttl/tests/pre-caching-partial-complete/03-assert.yaml
Falling back to patching base and 3-way merge...
Auto-merging tests/kuttl/tests/pre-caching-partial-complete/03-assert.yaml
CONFLICT (content): Merge conflict in tests/kuttl/tests/pre-caching-partial-complete/03-assert.yaml
Auto-merging tests/kuttl/tests/pre-caching-complete/03-assert.yaml
Auto-merging tests/kuttl/tests/backup-partial-complete/02-assert.yaml
Auto-merging tests/kuttl/tests/backup-fail/02-assert.yaml
Auto-merging tests/kuttl/tests/backup-complete/02-assert.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 fix kuttl test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.15

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/test-infra repository.

edcdavid added a commit to edcdavid/cluster-group-upgrades-operator that referenced this pull request Feb 22, 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
edcdavid added a commit to edcdavid/cluster-group-upgrades-operator that referenced this pull request Feb 27, 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
openshift-merge-bot bot pushed a commit that referenced this pull request Feb 27, 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
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
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
jc-rh pushed a commit to jc-rh/cluster-group-upgrades-operator that referenced this pull request Apr 23, 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants