Remove unused argument (#3149)

Removed unused argument in the `GetPatch()` function in
`pkg/inject/inject.go`

Signed-off-by: Alejandro Pedraza <alejandro.pedraza@gmail.com>
This commit is contained in:
Alejandro Pedraza 2019-07-26 11:39:25 -05:00 committed by GitHub
parent 51b33ad53c
commit 8c07223f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -160,7 +160,7 @@ func (rt resourceTransformerInject) transform(bytes []byte) ([]byte, []inject.Re
conf.AppendPodAnnotations(rt.overrideAnnotations) conf.AppendPodAnnotations(rt.overrideAnnotations)
} }
p, err := conf.GetPatch(bytes, rt.injectProxy) p, err := conf.GetPatch(rt.injectProxy)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }

View File

@ -61,7 +61,7 @@ func Inject(api *k8s.API,
resourceConfig.AppendPodAnnotations(map[string]string{ resourceConfig.AppendPodAnnotations(map[string]string{
pkgK8s.CreatedByAnnotation: fmt.Sprintf("linkerd/proxy-injector %s", version.Version), pkgK8s.CreatedByAnnotation: fmt.Sprintf("linkerd/proxy-injector %s", version.Version),
}) })
p, err := resourceConfig.GetPatch(request.Object.Raw, true) p, err := resourceConfig.GetPatch(true)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -119,7 +119,7 @@ func TestGetPatch(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
p, err := fullConf.GetPatch(fakeReq.Object.Raw, true) p, err := fullConf.GetPatch(true)
if err != nil { if err != nil {
t.Fatalf("Unexpected PatchForAdmissionRequest error: %s", err) t.Fatalf("Unexpected PatchForAdmissionRequest error: %s", err)
} }
@ -153,7 +153,7 @@ func TestGetPatch(t *testing.T) {
fakeReq := getFakeReq(deployment) fakeReq := getFakeReq(deployment)
conf := confNsDisabled().WithKind(fakeReq.Kind.Kind) conf := confNsDisabled().WithKind(fakeReq.Kind.Kind)
p, err := conf.GetPatch(fakeReq.Object.Raw, true) p, err := conf.GetPatch(true)
if err != nil { if err != nil {
t.Fatalf("Unexpected PatchForAdmissionRequest error: %s", err) t.Fatalf("Unexpected PatchForAdmissionRequest error: %s", err)
} }

View File

@ -205,7 +205,7 @@ func (conf *ResourceConfig) ParseMetaAndYAML(bytes []byte) (*Report, error) {
// GetPatch returns the JSON patch containing the proxy and init containers specs, if any. // GetPatch returns the JSON patch containing the proxy and init containers specs, if any.
// If injectProxy is false, only the config.linkerd.io annotations are set. // If injectProxy is false, only the config.linkerd.io annotations are set.
func (conf *ResourceConfig) GetPatch(bytes []byte, injectProxy bool) (*Patch, error) { func (conf *ResourceConfig) GetPatch(injectProxy bool) (*Patch, error) {
patch := NewPatch(conf.workload.metaType.Kind) patch := NewPatch(conf.workload.metaType.Kind)
if conf.pod.spec != nil { if conf.pod.spec != nil {
conf.injectPodAnnotations(patch) conf.injectPodAnnotations(patch)