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

fix: user platform validation expects sorted list of platforms #1498

Closed
wants to merge 1 commit into from

Conversation

serbrech
Copy link
Contributor

if the list of platform is not sorted, the validation will fail, as the index returned by SearchString will not match the index of the platform string found, and the equality check will fail.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 29, 2019
@openshift-ci-robot
Copy link
Contributor

Hi @serbrech. Thanks for your PR.

I'm waiting for a openshift 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-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 29, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: serbrech
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: steveej

If they are not already assigned, you can assign the PR to them by writing /assign @steveej in a comment when ready.

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

@abhinavdahiya
Copy link
Contributor

You can't add to platform list in not sorted order.

func TestPlatformNamesSorted(t *testing.T) {

@serbrech
Copy link
Contributor Author

serbrech commented Mar 29, 2019

You can't add to platform list in not sorted order.

installer/pkg/types/installconfig_test.go

Line 10 in 3cadc45
func TestPlatformNamesSorted(t *testing.T) {

If you think that relying on the unit test is better than to not have to care about the order, feel free to close this. Every new platform will just have to make sure they add their own name in the right spot in the list.

Instead of assuming a sorted list, what about making types.PlatformNames private and only exposing SortedPlaftormNames as a func?

@abhinavdahiya
Copy link
Contributor

You can't add to platform list in not sorted order.
installer/pkg/types/installconfig_test.go
Line 10 in 3cadc45
func TestPlatformNamesSorted(t *testing.T) {

If you think that relying on the unit test is better than to not have to care about the order, feel free to close this. Every new platform will just have to make sure they add their own name in the right spot in the list.

some previous dicussion is here, here and here.

/close

@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: Closed this PR.

In response to this:

You can't add to platform list in not sorted order.
installer/pkg/types/installconfig_test.go
Line 10 in 3cadc45
func TestPlatformNamesSorted(t *testing.T) {

If you think that relying on the unit test is better than to not have to care about the order, feel free to close this. Every new platform will just have to make sure they add their own name in the right spot in the list.

some previous dicussion is here, here and here.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants