-
Notifications
You must be signed in to change notification settings - Fork 897
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
Move up xpkg build command to crossplane #4694
Conversation
Looks like the code coverage is failing as the copied over code is not that well tested. I try to add some tests there |
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'm really excited to see this effort getting kicked off. Given my context for these changes over in upbound/up, I mostly targeted the following:
- Did we bring over more than we needed to (for example dep related functionality and that ties into xpls)?
- Do we want to make some of the same assumptions here that were made in upbound/up?
My comments below are all related to that. Let me know if you have any questions or if there is other context I can provide 👍
Thanks for taking the time to review @tnthornton ! I initially started with adding all the commands, but then removed some because they are alpha ( Looking at it now again, and after the discussion on the SIG meeting, where we confirmed that the most important are |
Ok, made the following changes:
|
Checked the output of this against the one from We can definitely refactor it further, but as an starting point and initial porting of the |
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.
LGTM - thanks
test successful done!
./crank xpkg build --ignore="init/*.yaml,kind-config.yaml" --output=test.xpkg
internal/xpkg/v2/build.go
Outdated
errParseAuth = "an auth extension was supplied but could not be parsed" | ||
errAuthNotAnnotated = "an auth extension was supplied but but the " + providerConfigKind + " object could not be found" | ||
errNotExactlyOneMeta = "package must contain exactly one meta object" | ||
authMetaAnno = "auth.upbound.io/group" |
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.
is this something we need here ?
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.
given this is used to configure ProviderConfig
functionality in console.upbound.io
, probably not. It does imply that any provider in the future that wants to take advantage of that functionality would have to be built with up, which is the case today.
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.
Removed the auth extension option then. We can leave this to be up
specific
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Signed-off-by: lsviben <sviben.lovro@gmail.com>
Description of your changes
Migrates the up
xpkg build
command to Crossplane as part of the devEx improvements.Some notes about the PR for the reviewers:
Most of the PR is just a copy of the https://github.com/upbound/up/internal/pkg/xpkg to
internal/xpkg/v2
(with some unused files removed, nonbuild
related), and the copy is in the first commit. The rest of the commits are adjusting the code to Crossplane linting, adding functions to thebuild
, and trying to make it more Crossplane then Upbound (mostly in comments).I skipped for now the
push
command as it has a lot of Upbound specific code, like authenticating and creating repositories, so I felt that that deserved a separate, more readable PR, where some of this code would be made less Upbound-specific.Other commands like
dep
init
will be added separately.Also I skipped the alpha
batch
andxpextract
commands as they are alpha. We could add those later on.How this interacts with the existing commands and code in Crossplane
As we already have a
build
/push
commands in crossplane(and a couple more), and there is very similar code ininternal/xpkg
initially I tried to merge the code fromup
to that (while keeping the commands separate). And in most cases its ok as it seems that both share the same roots. But it got complicated fast becauseup
had a lot of changes on the original code, and the Crossplane code had also its changes, so it was a nightmare to merge.Thats why the
up
xpkg
code was moved intov2
, as it is anyway planned in the future to replace the current Crossplane commands, due to having a richer feature set. So there will be duplicated code in v2, but its much simpler that way, and we can remove v1 at one point.Which command is added
build
:Improved version of the current Crossplane build which allows for packing the manifest togather with the controller/function image and examples.
Further improvements
There is a bunch of stuff that can still be done here but I wanted to keep this already big PR simpler:
build
commandv1
andv2
internal/xpkg
(partially done)up
usesup xpkg
Fixes #4657
I have:
make reviewable
to ensure this PR is ready for review.[ ] Addedbackport release-x.y
labels to auto-backport this PR, if necessary.[] Opened a PR updating the docs, if necessary.Docs will be covered in Improve discoverability (add docs and pointers) for installing Crossplane CLI #4671
How was this tested
Just ran the command for various packages:
~/go/test/function-dummy (main) $ kubectl crossplane xpkg build -f package/ --controller=provider-dummy:0.1.0 xpkg saved to /home/lovro/go/test/function-dummy/package/function-dummy-303029fb9515.xpkg