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

Add provisioned service support #978

Conversation

pedjak
Copy link
Contributor

@pedjak pedjak commented Jun 14, 2021

Application can be bound to a provisioned service:

https://github.com/k8s-service-bindings/spec#provisioned-service

  • collect.ProvisionedService handler detects if referred service contains a reference to secret containing the bindings
  • unit and acceptance tests demonstrate the contact and exposed functionality

Fixes #548

@openshift-ci openshift-ci bot requested review from baijum and isutton June 14, 2021 12:47
@pedjak pedjak force-pushed the provisioned-service-support branch from 425ec2e to 675e125 Compare June 14, 2021 12:48
Copy link
Contributor

@isutton isutton left a comment

Choose a reason for hiding this comment

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

LGTM with some minors; will leave to you @pedjak to modify the minors or squash-and-merge.

return i.bindingItems
var allItems pipeline.BindingItems
for _, b := range i.bindings {
items, err := b.Items()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to drop the error return value here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure what do you mean - would you like that return error to the caller, instead of trying to collect as much as possible items?

Copy link
Contributor

Choose a reason for hiding this comment

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

The error is captured but ignored, and also the fact that Items() doesn't read as a method that might return an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right - according to the current contract Items() does not return error, it is just a getter.

pkg/reconcile/pipeline/context/impl.go Show resolved Hide resolved
@baijum
Copy link
Member

baijum commented Jun 14, 2021

What if the Provisioned Service also got CR/CRD annotations? Does the binding Secret resource contain values from Provisioned Service Secret and the values extracted through CR/CRD annotations?

We need to document the behavior. Probably we can add some acceptance tests also.

Application can be bound to a provisioned service:

https://github.com/k8s-service-bindings/spec#provisioned-service

* collect.ProvisionedService handler detects if referred service contains a reference to secret containing the bindings
* unit and acceptance tests demonstrate the contact and exposed functionality

Signed-off-by: Predrag Knezevic <pknezevi@redhat.com>
@pedjak pedjak force-pushed the provisioned-service-support branch from 675e125 to 3ca7333 Compare June 14, 2021 17:37
@pedjak
Copy link
Contributor Author

pedjak commented Jun 14, 2021

What if the Provisioned Service also got CR/CRD annotations? Does the binding Secret resource contain values from Provisioned Service Secret and the values extracted through CR/CRD annotations?

@baijum the code submitted in this PR allows that - I have added the acceptance test demonstrating this. The documentation will be added as the part of #863

@pedjak
Copy link
Contributor Author

pedjak commented Jun 14, 2021

/retest

1 similar comment
@pedjak
Copy link
Contributor Author

pedjak commented Jun 15, 2021

/retest

@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #978 (3ca7333) into master (278caf8) will increase coverage by 0.86%.
The diff coverage is 73.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #978      +/-   ##
==========================================
+ Coverage   55.56%   56.42%   +0.86%     
==========================================
  Files          23       24       +1     
  Lines        1240     1315      +75     
==========================================
+ Hits          689      742      +53     
- Misses        462      477      +15     
- Partials       89       96       +7     
Impacted Files Coverage Δ
pkg/reconcile/pipeline/api.go 75.00% <ø> (ø)
pkg/reconcile/pipeline/builder/pipeline.go 90.00% <ø> (ø)
pkg/reconcile/pipeline/secretbackedbindings.go 66.66% <66.66%> (ø)
pkg/reconcile/pipeline/context/impl.go 71.51% <75.00%> (+0.84%) ⬆️
pkg/reconcile/pipeline/handler/collect/impl.go 79.85% <80.00%> (-1.66%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 278caf8...3ca7333. Read the comment docs.

@baijum
Copy link
Member

baijum commented Jun 16, 2021

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baijum

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

@openshift-merge-robot openshift-merge-robot merged commit 212651d into redhat-developer:master Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support duck type from spec
4 participants