-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Repo package cleanups/refactors #2387
Conversation
(don't review yet and ignore the CI failures... this will get worse before it gets better 🙃) |
}, | ||
} | ||
|
||
func init() { |
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.
The use of init means no one can cherry pick this command to remix their own cli. I prefer explicitly adding commands and in this way: https://github.com/kubernetes-sigs/zeitgeist/blob/master/buoy/commands/commands.go
"k8s.io/enhancements/pkg/kepctl" | ||
) | ||
|
||
// TODO: Struct literal instead? |
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 prefer no struct and have it be local to a function. https://github.com/kubernetes-sigs/zeitgeist/blob/master/buoy/commands/exists.go#L30 and this lets you reuse common flag defs like https://github.com/n3wscott/bujo/blob/master/pkg/commands/get.go#L89
(Rebased on top of #2388, which pulls out a lot of the non-go changes.) |
b78806b
to
82a4357
Compare
I started rewriting the validation logic with 82a4357 shows that off with a fake required field: --- FAIL: TestValidation (0.09s)
--- FAIL: TestValidation/../keps/sig-api-machinery/1904-efficient-watch-resumption/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Alpha.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Stable.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-api-machinery/1904-efficient-watch-resumption/kep.yaml
--- FAIL: TestValidation/../keps/sig-apps/2214-indexed-job/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Stable.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-apps/2214-indexed-job/kep.yaml
--- FAIL: TestValidation/../keps/sig-apps/2255-pod-cost/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Stable.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-apps/2255-pod-cost/kep.yaml
--- FAIL: TestValidation/../keps/sig-apps/592-ttl-after-finish/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Alpha.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Stable.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-apps/592-ttl-after-finish/kep.yaml
--- FAIL: TestValidation/../keps/sig-apps/85-Graduate-PDB-to-Stable/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Alpha.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-apps/85-Graduate-PDB-to-Stable/kep.yaml
--- FAIL: TestValidation/../keps/sig-auth/1393-oidc-discovery/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Alpha.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-auth/1393-oidc-discovery/kep.yaml
--- FAIL: TestValidation/../keps/sig-network/2079-network-policy-port-range/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Stable.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-network/2079-network-policy-port-range/kep.yaml
--- FAIL: TestValidation/../keps/sig-network/2200-externalips-admission/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Alpha.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-network/2200-externalips-admission/kep.yaml
--- FAIL: TestValidation/../keps/sig-scheduling/1923-prefer-nominated-node/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Stable.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-scheduling/1923-prefer-nominated-node/kep.yaml
--- FAIL: TestValidation/../keps/sig-storage/1412-immutable-secrets-and-configmaps/kep.yaml (0.00s)
metadata_test.go:126:
Error Trace: metadata_test.go:126
Error: Expected nil, but got: validating PRR: running validation: Key: 'PRRApproval.Alpha.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.Beta.Approver' Error:Field validation for 'Approver' failed on the 'required' tag
Key: 'PRRApproval.FakeRequiredField' Error:Field validation for 'FakeRequiredField' failed on the 'required' tag
Test: TestValidation/../keps/sig-storage/1412-immutable-secrets-and-configmaps/kep.yaml
FAIL
FAIL command-line-arguments 0.104s
FAIL
FAILED verify-kep-metadata.sh 4s (not quite there yet, but getting closer!) |
2d4148b
to
faa7fce
Compare
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
Signed-off-by: Stephen Augustus <foo@auggie.dev>
/hold cancel |
/lgtm I took a look at this, I think it sets us up for a good state for future work. Thanks @justaugustus |
/pony party |
In response to this:
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. |
Thank you @justaugustus 👍🏽 /lgtm |
In response to this:
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. |
proposal.Error = errors.Wrap(err, "error validating KEP metadata") | ||
return proposal | ||
} | ||
*/ |
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.
@justaugustus - why this was commented out? We no longer validate e.g. if PRR approvers are from PRR approvers, etc....
@johnbelamaric @deads2k - FYI
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.
@wojtek-t -- Discussing on #enhancements and will send an updated PR later.
Thanks for flagging this!
Revert "Merge pull request #2387 from justaugustus/cleanup"
I've reviewed a few PRs recently that I realized had issues that would've been caught by golangci-lint.
Done
kepval (does this actually exist anymore?)Follow-ups
hack/
(usescripts/
)fmt
)Person
/Reviewer
fieldCI
k/release
Handoff (@jeremyrickard)
Not ready for review yet, but:
cc: @kubernetes/enhancements
/hold