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

✨ Syncer transfos and coordination controller helpers #2289

Conversation

davidfestal
Copy link
Member

Summary

This PR implements:

  • a synchronous resource transformation framework that can be used in the virtual workspaces
  • the use of this framework to maintain syncer-specific views of a single KCP resource
  • builds on top of this to define a layer that very easily allows defining syncer transformations
  • defines coordination controller helpers

This PR is the second part of PROOF PR #1239, which implements the first stories of the EPIC Multi-SyncTarget syncing and coordination controllers.

Thus this PR should be reviewed with the wider context and use-case in mind (especially the deployment Splitter POC in the PROOF PR).

Reviewing this PR commit-by-commit will make it easier.

Related issue(s)

#1992

@openshift-ci openshift-ci bot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Oct 31, 2022

func UpstreamViewChanged(old, new Object, equality func(old, new interface{}) bool) bool {
old = old.DeepCopyObject().(Object)
new = new.DeepCopyObject().(Object)
Copy link
Member

Choose a reason for hiding this comment

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

these are heavy operations. The only thing you mutate are annotations?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you're right.

Copy link
Member Author

@davidfestal davidfestal Nov 4, 2022

Choose a reason for hiding this comment

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

But it's only on helpers for coordination controllers, and isn't involved in the main transformation.

Copy link
Member

Choose a reason for hiding this comment

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

ack. Then it is fine.

@davidfestal davidfestal force-pushed the syncer-transfos-and-coordination-controller-helpers branch from 6828cb0 to 2d619c9 Compare November 1, 2022 11:22

// DefaultSummarizingRules provides a default minimal implementation of [SummarizingRules].
// It only adds a status field, which for now is always promoted (see comments below in the code)
type DefaultSummarizingRules struct{}
Copy link
Member

Choose a reason for hiding this comment

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

can we then call it as something what it is? AlwaysPromoteStatusFieldSummarizing or similar.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather keep this name, because it could probably have additional fields + promottion rules according to the GVR in a near future.

Copy link
Member

Choose a reason for hiding this comment

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

no strong opinion. Keeping it is fine.

@davidfestal davidfestal force-pushed the syncer-transfos-and-coordination-controller-helpers branch 3 times, most recently from 15b698b to af2356b Compare November 4, 2022 22:39
Copy link
Contributor

@qiujian16 qiujian16 left a comment

Choose a reason for hiding this comment

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

just some nits. LGTM in general.

pkg/virtual/syncer/transformations/transformer.go Outdated Show resolved Hide resolved
pkg/virtual/syncer/transformations/transformer.go Outdated Show resolved Hide resolved
pkg/virtual/syncer/transformations/transformer.go Outdated Show resolved Hide resolved
pkg/virtual/syncer/transformations/transformer.go Outdated Show resolved Hide resolved
... using the ResourceTransformer

Signed-off-by: David Festal <[email protected]>
... based on the experimental spec-diff annotation

Signed-off-by: David Festal <[email protected]>
(experimental and temporary feature)

Signed-off-by: David Festal <[email protected]>
@davidfestal davidfestal force-pushed the syncer-transfos-and-coordination-controller-helpers branch from af2356b to 58fb746 Compare November 7, 2022 14:30
@davidfestal
Copy link
Member Author

/retest

@qiujian16
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2022
@davidfestal
Copy link
Member Author

/assign @sttts

@sttts
Copy link
Member

sttts commented Nov 7, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 7, 2022
@openshift-merge-robot openshift-merge-robot merged commit a972681 into kcp-dev:main Nov 7, 2022
@kcp-ci-bot kcp-ci-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants