Skip to content

Commit

Permalink
Remove unused argument
Browse files Browse the repository at this point in the history
Removed unused argument in the `GetPatch()` function in
`pkg/inject/inject.go`

Signed-off-by: Alejandro Pedraza <alejandro.pedraza@gmail.com>
  • Loading branch information
alpeb committed Jul 26, 2019
1 parent 51b33ad commit ff4cf23
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (rt resourceTransformerInject) transform(bytes []byte) ([]byte, []inject.Re
conf.AppendPodAnnotations(rt.overrideAnnotations)
}

p, err := conf.GetPatch(bytes, rt.injectProxy)
p, err := conf.GetPatch(rt.injectProxy)
if err != nil {
return nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion controller/proxy-injector/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func Inject(api *k8s.API,
resourceConfig.AppendPodAnnotations(map[string]string{
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 {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions controller/proxy-injector/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestGetPatch(t *testing.T) {
t.Fatal(err)
}

p, err := fullConf.GetPatch(fakeReq.Object.Raw, true)
p, err := fullConf.GetPatch(true)
if err != nil {
t.Fatalf("Unexpected PatchForAdmissionRequest error: %s", err)
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestGetPatch(t *testing.T) {

fakeReq := getFakeReq(deployment)
conf := confNsDisabled().WithKind(fakeReq.Kind.Kind)
p, err := conf.GetPatch(fakeReq.Object.Raw, true)
p, err := conf.GetPatch(true)
if err != nil {
t.Fatalf("Unexpected PatchForAdmissionRequest error: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/inject/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// 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)
if conf.pod.spec != nil {
conf.injectPodAnnotations(patch)
Expand Down

0 comments on commit ff4cf23

Please sign in to comment.