Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

service-binding-operator-967 #993

Closed

Conversation

isutton
Copy link
Contributor

@isutton isutton commented Jul 21, 2021

Motivation

When using the sliceOfMaps elementType in a service binding annotation, the operator panics when the specified sourceValue does not exist in the underlying maps, although the expected behaviour would be to inform the user the binding has an error through conditions.

Changes

This PR changes the current behavior by verifying whether the value extracted is present, and set a condition in the service binding in the case the sourceValue key isn't present.

Testing

<< How to test those changes, reference implementation of unit/acceptance tests. >>

For further more details refer the CONTRIBUTING.md

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 21, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from isutton after the PR has been reviewed.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot requested review from jasperchui and pmacik July 21, 2021 13:45
Comment on lines +229 to +232
condition := v1alpha1.Conditions().NotCollectionReady().
Msg(fmt.Sprintf("Value for key %v_%v not found", prefix+k.String(), n.String())).
Reason("ValueNotFound").Build()
ctx.SetCondition(condition)
Copy link
Contributor

Choose a reason for hiding this comment

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

apart from setting the condition, you need to do these as well:

ctx.Error(err)
ctx.StopProcessing()

Also, please extract ValueNotFound into a constant and put around other constant in the same file.

@@ -928,6 +928,74 @@ var _ = Describe("Integration Collect definitions + items", func() {

})

// TODO: spec title should be rephrased: should we have one spec for regression tests?
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just add these tests cases under others for the existing specs.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 27, 2021

@isutton: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
ci/prow/4.7-acceptance 6049589 link /test 4.7-acceptance
ci/prow/4.6-acceptance 6049589 link /test 4.6-acceptance
ci/prow/4.8-acceptance 6049589 link /test 4.8-acceptance
ci/prow/4.9-acceptance 6049589 link /test 4.9-acceptance

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants