mirror of
https://github.com/kyverno/policy-reporter.git
synced 2024-12-14 11:57:32 +00:00
remove obsolete code and reuse the same object
Signed-off-by: fengshunli <1171313930@qq.com>
This commit is contained in:
parent
b793b90d60
commit
3624b2c233
2 changed files with 3 additions and 4 deletions
|
@ -3,7 +3,6 @@ package api
|
|||
import (
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
|
@ -11,7 +10,7 @@ import (
|
|||
|
||||
var gzPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
w := gzip.NewWriter(ioutil.Discard)
|
||||
w := gzip.NewWriter(io.Discard)
|
||||
return w
|
||||
},
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ type k8sClient struct {
|
|||
|
||||
func (c *k8sClient) Get(ctx context.Context, name string) (Values, error) {
|
||||
secret, err := c.client.Get(ctx, name, metav1.GetOptions{})
|
||||
values := Values{}
|
||||
if err != nil {
|
||||
return Values{}, err
|
||||
return values, err
|
||||
}
|
||||
|
||||
values := Values{}
|
||||
if host, ok := secret.Data["host"]; ok {
|
||||
values.Host = string(host)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue