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
kmsv2: add grpc service #114678
kmsv2: add grpc service #114678
Conversation
@ibihim: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @ibihim. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
} | ||
|
||
return s, nil | ||
} |
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.
This cannot error.
|
||
// ListenAndServe accepts incoming connections on a Unix socket. Returns non-nil | ||
// error unless Close or Shutdown is called. | ||
func (s *GRPCService) ListenAndServe() error { |
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.
This blocks right? Document that behavior.
// blocks until all pending RPCs are finished. | ||
func (s *GRPCService) Shutdown() { | ||
if s.server != nil { | ||
s.server.GracefulStop() |
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.
If this returns an error, ignore it explicitly.
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.
s.server.GracefulStop()
has the signature: func (s *Server) GracefulStop()
. It doesn't return an error.
}) | ||
} | ||
|
||
func newClient(t *testing.T, address string) (kmsapi.KeyManagementServiceClient, func() error) { |
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.
This should only return the client, use t.Cleanup
to avoid funneling up.
|
||
var _ Service = (*testService)(nil) | ||
|
||
func (ts *testService) Decrypt(ctx context.Context, uid string, req *DecryptRequest) ([]byte, error) { |
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.
Use one letter receiver names.
t.Errorf("want: len(keyID) > 0, have: %d", len(status.KeyId)) | ||
} | ||
if status.Version != version { | ||
t.Errorf("want %q, have: %q", "v2alpha1", status.Version) |
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.
t.Errorf("want %q, have: %q", "v2alpha1", status.Version) | |
t.Errorf("want %q, have: %q", version, status.Version) |
} | ||
|
||
decRes, err := client.Decrypt(ctx, &kmsapi.DecryptRequest{ | ||
Ciphertext: encRes.Ciphertext, |
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.
Assert that ciphertext is not equal to plaintext.
/ok-to-test |
3af7d3c
to
026325c
Compare
/reopen |
@enj: Reopened this PR. 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. |
57dd645
to
4bb35c8
Compare
Signed-off-by: Krzysztof Ostrowski <kostrows@redhat.com>
4bb35c8
to
371b3b3
Compare
/lgtm |
LGTM label has been added. Git tree hash: f49e8a3666d6a8642f5d601bb7d9ff16d658aa01
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enj, ibihim 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 |
/retest |
the test added in this PR is flaking (saw an immediate failure in #114766 - https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/114766/pull-kubernetes-unit/1611428013864390656 and https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/114766/pull-kubernetes-unit-go-canary/1611428103538610176) |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This is a smaller version of #112898, it only contains a GRPC Service and an in-memory kms.Service.
Which issue(s) this PR fixes:
Fixes #112859 partially.
Fixes #
Special notes for your reviewer:
This is a subset of #114315 with slight changes to accommodate discussions from #sig-auth-kms-dev on kubernetes Slack.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: