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

Apply Builders for client-go's typed client #99012

Merged
merged 3 commits into from Mar 4, 2021

Conversation

jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Feb 11, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR is the first step toward implementing Apply for client-go's typed client

umbrella issue: kubernetes/enhancements#2155

Special notes for your reviewer:

Generated code is in a separate commit.

Example usage:

deployment := appsv1ac.Deployment("nginx-deployment-3", "default").
	WithSpec(appsv1ac.DeploymentSpec().
		WithSelector(metav1ac.LabelSelector().
			WithMatchLabels(map[string]string{"app": "nginx"}),
		).
		WithTemplate(corev1ac.PodTemplateSpec().
			WithLabels(map[string]string{"app": "nginx"}).
			WithSpec(corev1ac.PodSpec().
				WithContainers(
					corev1ac.Container().
						WithName("nginx").
						WithImage("nginx:1.14.2").
						WithStdin(true).
						WithPorts(
							corev1ac.ContainerPort().
								WithContainerPort(8080).
								WithProtocol(v1.ProtocolTCP),
						).
						WithResources(corev1ac.ResourceRequirements().
							WithLimits(v1.ResourceList{
								v1.ResourceCPU:    resource.MustParse("4"),
								v1.ResourceMemory: resource.MustParse("32Gi"),
							}),
						),
				),
			),
		),
	)

client.AppsV1().Deployments("default").Apply(context.TODO(), deployment, metav1.ApplyOptions{FieldManager: "test-mgr", Force: true})

Does this PR introduce a user-facing change?:

Release note will be added when all the last change in the umbrella issue is merged

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

TODO

/sig api-machinery
/wg api-expression

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/code-generation labels Feb 11, 2021
@jpbetz
Copy link
Contributor Author

jpbetz commented Feb 11, 2021

/triage accepted
/priority important-soon
/cc @apelisse @Jefftree @kevindelgado

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Feb 11, 2021
@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 11, 2021
@k8s-ci-robot
Copy link
Contributor

@jpbetz: GitHub didn't allow me to request PR reviews from the following users: kevindelgado.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/triage accepted
/priority important-soon
/cc @apelisse @Jefftree @kevindelgado

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Feb 11, 2021
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 11, 2021
@jpbetz jpbetz force-pushed the apply-client-go-builders2 branch 2 times, most recently from ce90ebf to 661665a Compare February 13, 2021 03:52
Copy link
Member

@apelisse apelisse left a comment

Choose a reason for hiding this comment

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

Looked at a few generated types, it looks good in general, I'm just trying to understand some decisions (probably because I don't have enough context of the implementation details).

@jpbetz jpbetz force-pushed the apply-client-go-builders2 branch 5 times, most recently from 548691e to ac853e8 Compare February 18, 2021 00:27
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@dims
Copy link
Member

dims commented Mar 4, 2021

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2021
@dims
Copy link
Member

dims commented Mar 4, 2021

/hold cancel
/retest

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2021
@dims
Copy link
Member

dims commented Mar 4, 2021

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2021
@dims
Copy link
Member

dims commented Mar 4, 2021

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 4, 2021
@jpbetz jpbetz force-pushed the apply-client-go-builders2 branch from 05e7015 to cfb4c66 Compare March 4, 2021 04:51
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2021
@jpbetz
Copy link
Contributor Author

jpbetz commented Mar 4, 2021

Rebased and fix a corner case we found when implementing extract-- non-inlined embeds must be nill-able. Some details at: https://gist.github.com/jpbetz/a5a3a8dd0f12641e8546a9c1a525ea3f

@jpbetz jpbetz force-pushed the apply-client-go-builders2 branch from cfb4c66 to 885e04b Compare March 4, 2021 06:10
@lavalamp
Copy link
Member

lavalamp commented Mar 4, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2021
@jpbetz jpbetz force-pushed the apply-client-go-builders2 branch from 885e04b to 86184be Compare March 4, 2021 18:33
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2021
@jpbetz
Copy link
Contributor Author

jpbetz commented Mar 4, 2021

Rebased and reran generator to pick up added NamespaceSelector in PodAffinityTerm.

@k8s-ci-robot
Copy link
Contributor

@jpbetz: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-aks-engine-azure 86184be link /test pull-kubernetes-e2e-aks-engine-azure
pull-kubernetes-e2e-azure-disk-windows 86184be link /test pull-kubernetes-e2e-azure-disk-windows

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@lavalamp
Copy link
Member

lavalamp commented Mar 4, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit 03d2426 into kubernetes:master Mar 4, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 4, 2021
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. area/code-generation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/api-expression Categorizes an issue or PR as relevant to WG API Expression.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants