-
Notifications
You must be signed in to change notification settings - Fork 524
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-44199: Allow spaces in AWS tags #2124
base: master
Are you sure you want to change the base?
Conversation
Hello @patrickdillon! Some important instructions when contributing to openshift/api: |
@patrickdillon: This pull request references Jira Issue OCPBUGS-44199, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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. |
/jira refresh |
@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
No GitHub users were found matching the public email listed for the QA contact in Jira (yunjiang@redhat.com), skipping review request. In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
4c45dc3
to
56db039
Compare
New changes are detected. LGTM label has been removed. |
56db039
to
c7319b5
Compare
c7319b5
to
d9eefe9
Compare
@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:
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.
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 Please LMK what you think and next steps. |
Can you push the tests as you think they should look, and we can verify the formatting. Typically, tests that aren't gated, should be run from the AAA_ungated test file. Otherwise they should be in a file named after the gate.
For status tests, we typically use |
d9eefe9
to
d100db4
Compare
Thanks Joel! You cleared up both of my issues. As you suggested, the problem for the second part was that I was using All feedback has been addressed so this should be ready for another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more things. Other than this, I think the changes look good.
config/v1/tests/infrastructures.config.openshift.io/AAA_ungated.yaml
Outdated
Show resolved
Hide resolved
config/v1/tests/infrastructures.config.openshift.io/AAA_ungated.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two steps forward, one step back...
Not sure what to do about these test failures for the cloudLoadBalancerConfig
...
platformStatus: | ||
aws: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do here with the cloudLoadBalancerConfig
. The tests seem to be failing both when I include it and when I don't. I am not including it, because the field is feature gated
And that feature gate is not in the default feature set, so the field shouldn't be included here, right?
But the failing test complains about it:
�[0m �[38;5;243m[config.openshift.io/v1, Resource=infrastructures][ClusterProfiles=Hypershift,SelfManagedHA][FeatureSet="DevPreviewNoUpgrade"][FeatureGate=][File=0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml] Infrastructure �[0mOn Update �[38;5;9m�[1m[It] Should be able to create an aws resourcetag with characters '_', '.', '/', '=', '+', '-', ':', '@'�[0m
�[38;5;243m/home/padillon/go/src/github.com/openshift/api/tests/generator.go:314�[0m
�[38;5;9m[FAILED] the following fields were expected to match but did not:
[(status.platformStatus.aws.cloudLoadBalancerConfig/status.platformStatus.aws.cloudLoadBalancerConfig)]
So I try adding it like below, and that also fails...
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailable
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
region: us-east-1
resourceTags:
- key: key with space
value: value with space
type: AWS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoelSpeed it seems that the problem is that tests for TechPreview (etc) as well as the Default feature set are run on the AAA_ungated tests. So if I don't include the cloudLoadBalancerConfig
the TechPreview (etc) tests fail, but if I do include the cloudLoadBalancerConfig
tests for the Default set fail (current status of PR). I'm probably doing something wrong, but not sure what that is... WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which gate is cloudLoadBalancerConfig
behind? You will need to either include or exclude the gate in your test featuregates list.
As you aren't gating this change, you would exclude the gate -GateName
within the list of feature gates for your test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I did that in 0d10a56 and it seemed to resolve the issue. Thanks!
As this is in the AAA_ungated.yaml test file, it seems like we should potentially skip the non-default feature sets? Not sure if that is possible. A downside of doing that, though, is the tests would need to be updated upon graduation of features to the default feature set...
I'm definitely fine with this, if you are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general we want the tests to run against all versions so that we ensure the ungated tests do not break because of a new gated addition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, that is impossible, right? I suppose if the gate did not have default statuses, then it might not break the tests; but would it be exercising/proving anything?
It's probably my own lack of knowledge, but I don't understand the testing scenario. Just asking for my own understanding/potential process improvement. It's solved for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for the tests you're adding, because they leverage part of the API, which has a newly gated default value, it makes it impossible.
If you were to split the new tests into a separate file, the remaining ungated tests should in theory be able to continue to run.
I believe that's possible without anything complaining 🤔
b4ae80e
to
0d10a56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API changes and test cases LGTM. Tagging in @JoelSpeed for a review.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: barbacbd, everettraven, patrickdillon The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 also updates some further validations that were missing and adds godoc text.
result of make update after adding support for spaces in aws tags.
Adds tests for the existing aws resource tags feature.
0d10a56
to
35e446f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are adding the new restriction for not starting with aws:
, I'd like to see some ratcheting tests added that show that a value persisted that is incompatible with this validation does not negatively affect writes to the rest of the object.
You can see an example of how I'm doing that elsewhere in #2142
You'd have to remove the XValidation, persist an invalid value, and then try various updates to check that they still pass (or fail if appropriate)
I have created the test in a784650 but the validation does seem to fail on any updates to the object. I tried adding another resourceTag, adding a service endpoint,and finally just persisting the object as is (which is in the commit). All of these fail with
AFAICT the tests are correct, so it seems like the new validation could be breaking updates? |
@patrickdillon I had missed that this was a field on the status subresource so you are likely running into a bug that openshift/kubernetes#2167 is supposed to fix |
@patrickdillon: The following tests failed, say
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. |
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.