Skip to content

Conversation

patrickdillon
Copy link
Contributor

An incorrect regex validation prevents users from specifying AWS tag keys or values that include spaces, which are
allowed by AWS's official regex:

https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html

This bug is affecting users, so it would be good to backport to at least 4.17.

Copy link
Contributor

openshift-ci bot commented Dec 12, 2024

Hello @patrickdillon! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 12, 2024
@openshift-ci-robot
Copy link

@patrickdillon: This pull request references Jira Issue OCPBUGS-44199, which is invalid:

  • expected the bug to target either version "4.19." or "openshift-4.19.", but it targets "4.18.0" instead

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:

An incorrect regex validation prevents users from specifying AWS tag keys or values that include spaces, which are
allowed by AWS's official regex:

https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html

This bug is affecting users, so it would be good to backport to at least 4.17.

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-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 12, 2024
@patrickdillon
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 12, 2024
@openshift-ci-robot
Copy link

@patrickdillon: This pull request references Jira Issue OCPBUGS-44199, 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.19.0) matches configured target version for branch (4.19.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request.

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.

Copy link
Contributor

@barbacbd barbacbd left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2024
@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 10, 2025
@openshift-ci openshift-ci bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 20, 2025
@patrickdillon
Copy link
Contributor Author

patrickdillon commented Jan 20, 2025

@everettraven @JoelSpeed I think the API changes are complete, but I am blocked trying to add tests. I have added a commit with some of the tests I have been experimenting with, but here is what I have found:

  1. It seems that specifying a featuregate is required. If I don't specify a featuregate, the tests fail:
the following fields were expected to match but did not:
  [(status.platformStatus.aws.cloudLoadBalancerConfig/status.platformStatus.aws.cloudLoadBalancerConfig)]
  Expected
      <*unstructured.Unstructured | 0xc00008c800>: {
          Object: {
....

Not sure what I should do here, as there is no associated feature gate. Right now I've added an arbitrary feature gate to get the one test I can write to pass. This seems like a bug.

  1. Another issue is that when I test the aws:- prefix validation (expected error) with onCreate, I get the same error. So next I try testing with onUpdate. If I put the aws:key key in the initial config, the test fails:
  �[38;5;9m[FAILED] initial object status should update successfully
   ...
              Message: "Infrastructure.config.openshift.io \"test-xw97d\" is invalid: status.platformStatus.aws.resourceTags[0].key: Invalid value: \"string\": the prefix 'aws:' is reserved for AWS system usage and cannot be used at the beginning of a key",

This error message actually demonstrates the validation seems to be working., I just can't figure out a test to confirm it. When I try to update the test so that the bad key is only used during updated, no error is returned. I wonder if this has something to do with how for this object, the values in question are in the status and not the spec?

Please LMK what you think and next steps.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 31, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 31, 2025
An incorrect regex validation prevents users from specifying AWS tag keys or
values that include spaces, which are allowed by AWS's official regex:

https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html

Also includes some API cleanup.
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 6, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 6, 2025
@patrickdillon
Copy link
Contributor Author

Sorry I missed that this got tagged and ended up needing to rebase.

@JoelSpeed if I could trouble you for another look and lgtm

@patrickdillon
Copy link
Contributor Author

also it would be fine with me if we want to squash the commits with tide. not sure if there is a preference

@patrickdillon
Copy link
Contributor Author

/retest

@everettraven
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2025
Copy link
Contributor

openshift-ci bot commented Feb 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: barbacbd, everettraven, JoelSpeed, patrickdillon

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

@everettraven
Copy link
Contributor

Not sure who needs to add the acknowledge-critical-fixes-only label. I suppose @JoelSpeed . Is this change something that would fit the scope of a "critical fix"?

@patrickdillon
Copy link
Contributor Author

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Feb 10, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 9e59a77 and 2 for PR HEAD d5168f3 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD bf3f3e9 and 1 for PR HEAD d5168f3 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD bf3f3e9 and 2 for PR HEAD d5168f3 in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD bf3f3e9 and 2 for PR HEAD d5168f3 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b8a067b and 2 for PR HEAD d5168f3 in total

2 similar comments
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b8a067b and 2 for PR HEAD d5168f3 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b8a067b and 2 for PR HEAD d5168f3 in total

Copy link
Contributor

openshift-ci bot commented Feb 13, 2025

@patrickdillon: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit f5b09d1 into openshift:master Feb 13, 2025
22 checks passed
@openshift-ci-robot
Copy link

@patrickdillon: Jira Issue OCPBUGS-44199: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

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

In response to this:

An incorrect regex validation prevents users from specifying AWS tag keys or values that include spaces, which are
allowed by AWS's official regex:

https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html

This bug is affecting users, so it would be good to backport to at least 4.17.

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.

@patrickdillon
Copy link
Contributor Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@patrickdillon: #2124 failed to apply on top of branch "release-4.18":

Applying: OCPBUGS-44199: Allow spaces in AWS resource tags
Using index info to reconstruct a base tree...
M	config/v1/tests/infrastructures.config.openshift.io/AAA_ungated.yaml
M	config/v1/types_infrastructure.go
Falling back to patching base and 3-way merge...
Auto-merging config/v1/types_infrastructure.go
CONFLICT (content): Merge conflict in config/v1/types_infrastructure.go
Auto-merging config/v1/tests/infrastructures.config.openshift.io/AAA_ungated.yaml
CONFLICT (content): Merge conflict in config/v1/tests/infrastructures.config.openshift.io/AAA_ungated.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OCPBUGS-44199: Allow spaces in AWS resource tags

In response to this:

/cherry-pick release-4.18

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants