Skip to content

Commit

Permalink
code clean for evntest.server
Browse files Browse the repository at this point in the history
Signed-off-by: yanggang <gang.yang@daocloud.io>
  • Loading branch information
yanggang committed Feb 7, 2023
1 parent f127c11 commit 65f861d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkg/envtest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,19 @@ func (te *Environment) Start() (*rest.Config, error) {
if os.Getenv(envAttachOutput) == "true" {
te.AttachControlPlaneOutput = true
}
if apiServer.Out == nil && te.AttachControlPlaneOutput {
apiServer.Out = os.Stdout
}
if apiServer.Err == nil && te.AttachControlPlaneOutput {
apiServer.Err = os.Stderr
}
if te.ControlPlane.Etcd.Out == nil && te.AttachControlPlaneOutput {
te.ControlPlane.Etcd.Out = os.Stdout
}
if te.ControlPlane.Etcd.Err == nil && te.AttachControlPlaneOutput {
te.ControlPlane.Etcd.Err = os.Stderr
if te.AttachControlPlaneOutput {
if apiServer.Out == nil {
apiServer.Out = os.Stdout
}
if apiServer.Err == nil {
apiServer.Err = os.Stderr
}
if te.ControlPlane.Etcd.Out == nil {
te.ControlPlane.Etcd.Out = os.Stdout
}
if te.ControlPlane.Etcd.Err == nil {
te.ControlPlane.Etcd.Err = os.Stderr
}
}

apiServer.Path = process.BinPathFinder("kube-apiserver", te.BinaryAssetsDirectory)
Expand Down

0 comments on commit 65f861d

Please sign in to comment.