-
Notifications
You must be signed in to change notification settings - Fork 91
service-binding-operator-967 #993
service-binding-operator-967 #993
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
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) |
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.
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? |
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 would just add these tests cases under others for the existing specs.
@isutton: 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/test-infra repository. I understand the commands that are listed here. |
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