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

Rebind workloads when their mappings change #1296

Conversation

sadlerap
Copy link
Contributor

@sadlerap sadlerap commented Oct 31, 2022

Signed-off-by: Andy Sadler ansadler@redhat.com

Changes

This works in three stages:

  1. During workload mapping's validation webhook, we serialize the old mapping into the servicebinding.io/mapping annotation on all relevant service bindings.
  2. We run our reconcile pipeline once, to unbind the workload using the serialized mapping. Once completed, we delete the mapping and immediate trigger reprocessing of the service binding.
  3. We re-run our reconcile pipeline as normal using the new mapping to project data as expected.

/kind enhancement

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs
    included if any changes are user facing
  • Tests
    included if any functionality added or changed. For bugfixes please include tests that can catch regressions
  • All acceptance test scenarios included in the PR which verifies a bugfix or a requested feature reported by a non-member are tagged with @external-feedback tag.
  • Follows the commit message standard

@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Oct 31, 2022
@openshift-ci openshift-ci bot requested review from baijum and pmacik October 31, 2022 21:35
@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

Merging #1296 (9096e4f) into master (4810c32) will increase coverage by 0.17%.
The diff coverage is 70.74%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1296      +/-   ##
==========================================
+ Coverage   58.06%   58.23%   +0.17%     
==========================================
  Files          33       35       +2     
  Lines        2797     2988     +191     
==========================================
+ Hits         1624     1740     +116     
- Misses       1018     1082      +64     
- Partials      155      166      +11     
Impacted Files Coverage Δ
pkg/reconcile/pipeline/api.go 77.77% <ø> (ø)
pkg/reconcile/pipeline/handler/mapping/impl.go 66.66% <ø> (ø)
apis/webhooks/validator.go 61.15% <61.15%> (ø)
pkg/reconcile/pipeline/context/impl.go 66.34% <80.00%> (+0.09%) ⬆️
.../v1beta1/clusterworkloadresourcemapping_webhook.go 92.39% <100.00%> (+5.80%) ⬆️
...kg/reconcile/pipeline/context/spec_binding_impl.go 70.58% <100.00%> (+1.62%) ⬆️
pkg/reconcile/pipeline/handler/project/impl.go 56.70% <100.00%> (+2.49%) ⬆️
apis/webhooks/admission.go 0.00% <0.00%> (ø)

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 4810c32...9096e4f. Read the comment docs.

@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 1, 2022

/retest

2 similar comments
@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 1, 2022

/retest

@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 2, 2022

/retest

Copy link
Member

@baijum baijum left a comment

Choose a reason for hiding this comment

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

There is a small comment about logging

@sadlerap sadlerap force-pushed the rebind-workload-mappings branch 3 times, most recently from 5288dcb to 5bb6729 Compare November 3, 2022 15:47
@baijum
Copy link
Member

baijum commented Nov 3, 2022

/lgtm

@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 3, 2022

/retest

@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 4, 2022

/retest

1 similar comment
@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 5, 2022

/retest

Signed-off-by: Andy Sadler <ansadler@redhat.com>
@sadlerap
Copy link
Contributor Author

sadlerap commented Nov 7, 2022

/retest

Copy link
Member

@baijum baijum left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm label Nov 9, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 9, 2022

[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-ci openshift-ci bot added the approved label Nov 9, 2022
@openshift-merge-robot openshift-merge-robot merged commit e34eefa into redhat-developer:master Nov 9, 2022
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.

None yet

4 participants