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

✨ client: Generate apply configurations #2583

Merged
merged 6 commits into from
Mar 28, 2023

Conversation

astefanutti
Copy link
Member

@astefanutti astefanutti commented Jan 10, 2023

Summary

This PR enables the generation of apply configurations for kcp APIs, so they can be used for server-side apply requests.

Requires kubernetes/kubernetes#114920.

@openshift-ci openshift-ci bot requested review from csams and ncdc January 10, 2023 11:11
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch from 3dd0fec to 4c70a6d Compare January 10, 2023 11:43
@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 Jan 10, 2023
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch from 4c70a6d to 45f0bc1 Compare January 10, 2023 12:57
--output-base "${SCRIPT_ROOT}" \
--trim-path-prefix github.com/kcp-dev/kcp

"$GOPATH"/bin/client-gen \
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this call to client-gen do?

Copy link
Member Author

Choose a reason for hiding this comment

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

The upstream generate-groups.sh script does not support passing the apply-configuration-package option to client-gen, so this call does what generate-groups.sh "client" would do, but with the extra apply-configuration-package passed to client-gen. Upstream code-generator scripts completely lack support for applyconfiguration-gen, so I went for the path of least resistance, and have code-generator improved asynchronously.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right, of course - I chatted with upstream about this and they are 100% on getting generate-groups.sh to support it - is that something you'd be up for doing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great! Sure, I'll do it ASAP 👍🏼.

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -36,7 +71,7 @@ bash "${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client" \

pushd ./pkg/apis
${CODE_GENERATOR} \
"client:outputPackagePath=github.com/kcp-dev/kcp/pkg/client,apiPackagePath=github.com/kcp-dev/kcp/pkg/apis,singleClusterClientPackagePath=github.com/kcp-dev/kcp/pkg/client/clientset/versioned,headerFile=${BOILERPLATE_HEADER}" \
"client:outputPackagePath=github.com/kcp-dev/kcp/pkg/client,apiPackagePath=github.com/kcp-dev/kcp/pkg/apis,singleClusterClientPackagePath=github.com/kcp-dev/kcp/pkg/client/clientset/versioned,singleClusterApplyConfigurationsPackagePath=github.com/kcp-dev/kcp/pkg/client/applyconfiguration,headerFile=${BOILERPLATE_HEADER}" \
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to test SSA in e2e, we should also add apply-configurations to wildwest group

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Let me do it 👍🏼.

Copy link
Member Author

@astefanutti astefanutti Jan 11, 2023

Choose a reason for hiding this comment

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

Updated. PTAL 🙏🏼.

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

Looks awesome!

@astefanutti astefanutti force-pushed the pr-applyconfiguration branch 3 times, most recently from 9e2b0bc to c050fb3 Compare January 13, 2023 08:50
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 31, 2023
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch from c050fb3 to 2214b2b Compare January 31, 2023 10:35
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 31, 2023
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch from 2214b2b to 73965d6 Compare January 31, 2023 10:54
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch from 73965d6 to ecdb5d0 Compare February 17, 2023 15:36
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch 2 times, most recently from 0b9e622 to 64efa80 Compare March 14, 2023 14:48
@astefanutti astefanutti force-pushed the pr-applyconfiguration branch from 64efa80 to 72c7367 Compare March 28, 2023 16:12
@stevekuznetsov
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2023
@stevekuznetsov stevekuznetsov added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: stevekuznetsov

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 aea0ba7 into kcp-dev:main Mar 28, 2023
@astefanutti astefanutti deleted the pr-applyconfiguration branch March 28, 2023 19:48
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants