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-gen: avoid panic for empty groups #52079

Merged

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Sep 7, 2017

No description provided.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 7, 2017
@k8s-github-robot k8s-github-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Sep 7, 2017
@sttts sttts force-pushed the sttts-clientgen-panic-empty-group branch from 4722d7c to 4039a72 Compare September 7, 2017 08:43
@sttts sttts added 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. kind/bug Categorizes issue or PR as related to a bug. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 7, 2017
@sttts sttts added this to the v1.8 milestone Sep 7, 2017
@mrIncompetent
Copy link
Contributor

I ran into this issue when i tried to generate a client for 2 groups.
This PR fixes my problem!

Removing old client
Generating clientset
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/kubermatic/kubermatic/api/vendor/k8s.io/code-generator/cmd/client-gen/generators.(*genGroup).Filter(0xc4286b5b80, 0xc428f1b980, 0xc425f67290, 0x882688)
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go:49 +0x3e
github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator.(Generator).Filter-fm(0xc428f1b980, 0xc425f67290, 0xc42bbd9828)
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator/execute.go:221 +0x43
github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator.(*Context).filteredBy(0xc428f1b980, 0xc42bbd9ab8, 0x882688)
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator/execute.go:182 +0x108
github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator.(*Context).ExecutePackage(0xc428654600, 0xc42000c9a0, 0x15, 0x84d5a0, 0xc42a69a200, 0x0, 0x0)
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator/execute.go:221 +0x3c6
github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator.(*Context).ExecutePackages(0xc428654600, 0xc42000c9a0, 0x15, 0xc42a69aa00, 0x7, 0x8, 0x0, 0xc420017140)
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/generator/execute.go:51 +0xa7
github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/args.(*GeneratorArgs).Execute(0xc420078500, 0xc420017290, 0x70029d, 0x6, 0x7147d8, 0x1, 0x4)
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/gengo/args/args.go:166 +0x22c
main.main()
	/home/henrik/work/src/github.com/kubermatic/kubermatic/api/vendor/k8s.io/code-generator/cmd/client-gen/main.go:201 +0x650

@wojtek-t
Copy link
Member

wojtek-t commented Sep 7, 2017

/lgtm
/approve no-issue

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 7, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts, wojtek-t

Associated issue requirement bypassed by: wojtek-t

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 7, 2017
@sttts
Copy link
Contributor Author

sttts commented Sep 7, 2017

/retest

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 7, 2017

@sttts: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws 4039a72 link /test pull-kubernetes-e2e-kops-aws

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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 52073, 52079)

@k8s-github-robot k8s-github-robot merged commit 42e2ca8 into kubernetes:master Sep 7, 2017
@lavalamp
Copy link
Member

lavalamp commented Sep 7, 2017

@grodrigues3 This PR is fine and good, but the queue shouldn't have merged it. Did someone forget to make the queue require the approved for milestone label??

@lavalamp
Copy link
Member

lavalamp commented Sep 7, 2017

@caesarxuchao can you double check this PR?

@caesarxuchao
Copy link
Member

lgtm

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants