Unverified Commit c15ae2ff authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #59360 from immutableT/envelop_encryption_benchmark

Automatic merge from submit-queue (batch tested with PRs 59190, 59360). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Adding benchmarks to envelop encryption integration tests **What this PR does / why we need it**: Adding benchmarks for envelop encryption integration tests. Allows to estimate how envelop encryption may impact the performance of KubeAPI server. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 3aa70942 cfdea234
...@@ -21,7 +21,6 @@ import ( ...@@ -21,7 +21,6 @@ import (
"io/ioutil" "io/ioutil"
"net" "net"
"os" "os"
"testing"
"time" "time"
pflag "github.com/spf13/pflag" pflag "github.com/spf13/pflag"
...@@ -46,13 +45,20 @@ type TestServer struct { ...@@ -46,13 +45,20 @@ type TestServer struct {
TmpDir string // Temp Dir used, by the apiserver TmpDir string // Temp Dir used, by the apiserver
} }
// Logger allows t.Testing and b.Testing to be passed to StartTestServer and StartTestServerOrDie
type Logger interface {
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Logf(format string, args ...interface{})
}
// StartTestServer starts a etcd server and kube-apiserver. A rest client config and a tear-down func, // StartTestServer starts a etcd server and kube-apiserver. A rest client config and a tear-down func,
// and location of the tmpdir are returned. // and location of the tmpdir are returned.
// //
// Note: we return a tear-down func instead of a stop channel because the later will leak temporariy // Note: we return a tear-down func instead of a stop channel because the later will leak temporary
// files that becaues Golang testing's call to os.Exit will not give a stop channel go routine // files that because Golang testing's call to os.Exit will not give a stop channel go routine
// enough time to remove temporariy files. // enough time to remove temporary files.
func StartTestServer(t *testing.T, customFlags []string, storageConfig *storagebackend.Config) (result TestServer, err error) { func StartTestServer(t Logger, customFlags []string, storageConfig *storagebackend.Config) (result TestServer, err error) {
// TODO : Remove TrackStorageCleanup below when PR // TODO : Remove TrackStorageCleanup below when PR
// https://github.com/kubernetes/kubernetes/pull/50690 // https://github.com/kubernetes/kubernetes/pull/50690
...@@ -137,7 +143,7 @@ func StartTestServer(t *testing.T, customFlags []string, storageConfig *storageb ...@@ -137,7 +143,7 @@ func StartTestServer(t *testing.T, customFlags []string, storageConfig *storageb
} }
// StartTestServerOrDie calls StartTestServer t.Fatal if it does not succeed. // StartTestServerOrDie calls StartTestServer t.Fatal if it does not succeed.
func StartTestServerOrDie(t *testing.T, flags []string, storageConfig *storagebackend.Config) *TestServer { func StartTestServerOrDie(t Logger, flags []string, storageConfig *storagebackend.Config) *TestServer {
result, err := StartTestServer(t, flags, storageConfig) result, err := StartTestServer(t, flags, storageConfig)
if err == nil { if err == nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment