Skip to content

Part3: Make backend universal and support kcp #276

Merged
mjudeikis merged 2 commits into
kbind-dev:mainfrom
mjudeikis:mjudeikis/kcp.backend.mcr.edition
Aug 19, 2025
Merged

Part3: Make backend universal and support kcp #276
mjudeikis merged 2 commits into
kbind-dev:mainfrom
mjudeikis:mjudeikis/kcp.backend.mcr.edition

Conversation

@mjudeikis

@mjudeikis mjudeikis commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR start making backend a first-class citizen on the project, which means that with the move to multicluster-runtime we can now make it runnable for any cluster.
Removes kcp SDK and moves kcp related assets to /kcp
Makes separate package backend for new/old backend.
Removes usage of generated client (still left in konnector) #280

Commit history is bit shady. I tried to split no-op to individual separate commit so one can just review second commit only.

Fixes: #267

Will need kubernetes-sigs/multicluster-runtime#62 as now its go mod replaced
Will need version of ^ in kcp apiexport providers too as its too go mod replaces

What Type of PR Is This?

Related Issue(s)

Fixes #

Release Notes

move backend out of examples to part of mainline project structure

@mjudeikis
mjudeikis force-pushed the mjudeikis/kcp.backend.mcr.edition branch 10 times, most recently from 3f7c4bb to 390e348 Compare August 18, 2025 15:24
@mjudeikis
mjudeikis force-pushed the mjudeikis/kcp.backend.mcr.edition branch from 390e348 to df413f1 Compare August 18, 2025 15:35
@mjudeikis
mjudeikis marked this pull request as ready for review August 18, 2025 16:49
@mjudeikis
mjudeikis requested a review from a team as a code owner August 18, 2025 16:49
@mjudeikis
mjudeikis force-pushed the mjudeikis/kcp.backend.mcr.edition branch from df413f1 to b650304 Compare August 18, 2025 16:52
return nil, err
}
return binding, nil
createClusterRoleBinding: func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRoleBinding) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do all of these still offer a real value, now that they are one-liners?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It just gives consistency in mocking. If one of these are more complex than one-line it makes sense to have all of them same so its just consistent.

We can always refactor these out if we see need. Now - it just change for sake of change :)

Comment thread backend/config.go Outdated
Comment thread deploy/patches/kube-bind.io_apiconversions.yaml-patch Outdated
Comment thread kcp/bootstrap/config/core/resources/bootstrap.go Outdated
Comment thread kcp/bootstrap/options/options.go
Comment thread kcp/bootstrap/options/options.go
Comment thread kcp/bootstrap/options/options.go Outdated
Comment thread kcp/bootstrap/server.go
}

func (s *Server) Start(ctx context.Context) error {
fakeBatteries := sets.New("")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are the fake batteries meant to include a single, empty string?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yap. Because I reuse kcp machinery/lib for it. it just placeholder to be able to reuse lib.

Comment thread kcp/cmd/kcp-init/main.go Outdated
Comment thread kcp/deploy/resources/bootstrap.go Outdated
Comment thread kcp/deploy/bootstrap.go Outdated
Comment thread kcp/deploy/bootstrap.go
},
}

binding.Spec.PermissionClaims = []apisv1alpha2.AcceptablePermissionClaim{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In case you were just looking for a 2nd opinion: I would consider using a loop here to construct the claims. For my taste it would probably save enough code to make it worth it. But that's just my 2 cents. Take it or leave it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was lift and shift. Lets do this in follow-up
#286

Comment thread kcp/hack/update-kcp-codegen.sh Outdated
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

# Copyright 2021 The Kube Bind Authors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In theory this was written in 2021 :D

Comment thread kcp/Makefile Outdated
Comment thread kcp/README.md Outdated
Comment thread kcp/README.md Outdated
Comment thread kcp/README.md Outdated
Comment thread kcp/README.md Outdated
Comment thread kcp/README.md Outdated
Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
On-behalf-of: @SAP mangirdas.judeikis@sap.com
Make backend work with kcp/mcr
Simplify code

Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
On-behalf-of: @SAP mangirdas.judeikis@sap.com
@mjudeikis
mjudeikis force-pushed the mjudeikis/kcp.backend.mcr.edition branch from 71cd9ba to cce3a0c Compare August 19, 2025 15:15

@xrstf xrstf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll fix the empty string feature gate later.

@mjudeikis
mjudeikis merged commit 0296caa into kbind-dev:main Aug 19, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor KubeBind to work with Multicluster-runtime

2 participants