Skip to content

Conversation

@yangcao77
Copy link
Contributor

Signed-off-by: Stephanie yangcao@redhat.com

What does this PR do?

should not assume the keyset length
add keyset length check before access keyset[0] and keyset[1]

What issues does this PR fix or reference?

fixes #276

Is your PR tested? Consider putting some instruction how to test your changes

tested with parser unit test

Signed-off-by: Stephanie <yangcao@redhat.com>
Signed-off-by: Stephanie <yangcao@redhat.com>
Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

LGTM


func ensureOnlyExistingElementsAreOverridden(spec *workspaces.DevWorkspaceTemplateSpecContent, overrides workspaces.Overrides) error {
return checkKeys(func(elementType string, keysSets []sets.String) []error {
if len(keysSets) <= 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Totally optional nit

Suggested change
if len(keysSets) <= 1 {
if len(keysSets) < 2 {

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amisevsk, yangcao77
To complete the pull request process, please assign after the PR has been reviewed.
You can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

override checkkeys should not assume there is a matching key in the override patch

3 participants