linkerd2/cli/cmd
Alejandro Pedraza d358605269
Added `linkerd uninject` command (#2054)
Add `linkerd uninject` command

uninject.go iterates through the resources annotations, labels,
initContainers and Containers, removing what we know was injected by
linkerd.

The biggest part of this commit is the refactoring of inject.go, to make
it more generic and reusable by uninject.

The idea is that in a following PR this functionality will get reused by
`linkerd inject` to uninject as as preliminary step to injection, as a
solution to #1970.

This was tested successfully on emojivoto with:

```
1) inject:
kubectl get -n emojivoto deployment -o yaml | bin/linkerd inject - |
kubectl apply -f -
2) uninject:
kubectl get -n emojivoto deployment -o yaml | bin/linkerd uninject - |
kubectl apply -f -
```

Also created unit tests for uninject.go. The fixture files from the inject
tests could be reused. But as now the input files act as outputs, they
represent existing resources and required these changes (that didn't
affect inject):
  - Rearranged fields in alphabetical order.
  - Added fields that are only relevant for existing resources (e.g.
    creationTimestamp and status.replicas in StatefulSets)

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-14 17:39:31 -05:00
..
testdata Added `linkerd uninject` command (#2054) 2019-01-14 17:39:31 -05:00
check.go More granular control on checks made by CLI commands (#2033) 2019-01-10 09:13:44 -05:00
check_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
completion.go Rename CLI from conduit to linkerd (#1312) 2018-07-12 17:14:07 -07:00
completion_test.go Rename CLI from conduit to linkerd (#1312) 2018-07-12 17:14:07 -07:00
dashboard.go Setup port-forwarding for linkerd dashboard command (#2052) 2019-01-10 10:16:08 -08:00
get.go More granular control on checks made by CLI commands (#2033) 2019-01-10 09:13:44 -05:00
get_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
inject.go Added `linkerd uninject` command (#2054) 2019-01-14 17:39:31 -05:00
inject_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
inject_util.go Added `linkerd uninject` command (#2054) 2019-01-14 17:39:31 -05:00
install.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
install_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
profile.go Add input validation for profile command (#1934) 2018-12-05 15:13:10 -08:00
profile_test.go Add input validation for profile command (#1934) 2018-12-05 15:13:10 -08:00
root.go Added `linkerd uninject` command (#2054) 2019-01-14 17:39:31 -05:00
routes.go More granular control on checks made by CLI commands (#2033) 2019-01-10 09:13:44 -05:00
routes_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
stat.go More granular control on checks made by CLI commands (#2033) 2019-01-10 09:13:44 -05:00
stat_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
tap.go More granular control on checks made by CLI commands (#2033) 2019-01-10 09:13:44 -05:00
tap_test.go Followups from lint/comment changes (#2032) 2019-01-02 15:28:09 -08:00
test_helper.go Add TopRoutes method the the public api and route CLI command to consume it (#1860) 2018-11-19 12:20:30 -08:00
top.go More granular control on checks made by CLI commands (#2033) 2019-01-10 09:13:44 -05:00
uninject.go Added `linkerd uninject` command (#2054) 2019-01-14 17:39:31 -05:00
uninject_test.go Added `linkerd uninject` command (#2054) 2019-01-14 17:39:31 -05:00
version.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00
version_test.go Fix most golint issues that are not comment related (#1982) 2018-12-20 10:37:47 -08:00