linkerd2/cli/cmd
Andrew Seigner c5a719da47
Modify inject to warn when file is un-injectable (#1603)
If an input file is un-injectable, existing inject behavior is to simply
output a copy of the input.

Introduce a report, printed to stderr, that communicates the end state
of the inject command. Currently this includes checking for hostNetwork
and unsupported resources.

Malformed YAML documents will continue to cause no YAML output, and return
error code 1.

This change also modifies integration tests to handle stdout and stderr separately.

example outputs...

some pods injected, none with host networking:

```
hostNetwork: pods do not use host networking...............................[ok]
supported: at least one resource injected..................................[ok]

Summary: 4 of 8 YAML document(s) injected
  deploy/emoji
  deploy/voting
  deploy/web
  deploy/vote-bot
```

some pods injected, one host networking:

```
hostNetwork: pods do not use host networking...............................[warn] -- deploy/vote-bot uses "hostNetwork: true"
supported: at least one resource injected..................................[ok]

Summary: 3 of 8 YAML document(s) injected
  deploy/emoji
  deploy/voting
  deploy/web
```

no pods injected:

```
hostNetwork: pods do not use host networking...............................[warn] -- deploy/emoji, deploy/voting, deploy/web, deploy/vote-bot use "hostNetwork: true"
supported: at least one resource injected..................................[warn] -- no supported objects found

Summary: 0 of 8 YAML document(s) injected
```

TODO: check for UDP and other init containers

Part of #1516

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-09-10 10:34:25 -07:00
..
testdata Modify inject to warn when file is un-injectable (#1603) 2018-09-10 10:34:25 -07:00
check.go Modify inject to warn when file is un-injectable (#1603) 2018-09-10 10:34:25 -07:00
check_test.go Refactor healthcheck init and observe setup (#1502) 2018-08-22 12:30:45 -07: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 Add --wait flag for CLI check and dashboard commands (#1503) 2018-08-22 12:56:42 -07:00
get.go Add --wait flag for CLI check and dashboard commands (#1503) 2018-08-22 12:56:42 -07:00
get_test.go Rename CLI from conduit to linkerd (#1312) 2018-07-12 17:14:07 -07:00
inject.go Modify inject to warn when file is un-injectable (#1603) 2018-09-10 10:34:25 -07:00
inject_test.go Modify inject to warn when file is un-injectable (#1603) 2018-09-10 10:34:25 -07:00
install.go Modify inject to warn when file is un-injectable (#1603) 2018-09-10 10:34:25 -07:00
install_test.go Add data plane check to validate proxy version (#1574) 2018-09-04 15:22:38 -07:00
root.go Modify inject to warn when file is un-injectable (#1603) 2018-09-10 10:34:25 -07:00
stat.go Add data plane check to validate proxies are ready (#1570) 2018-08-31 15:51:57 -07:00
stat_test.go Add additional validation for stat command-line arguments (#1415) 2018-08-08 15:35:47 -07:00
tap.go Increase default max-rps for tap and top (#1531) 2018-08-28 14:16:39 -07:00
tap_test.go Add resource metadata to Tap CLI output (#1437) 2018-08-20 14:25:26 -07:00
test_helper.go Add Grafana to conduit install (#444) 2018-02-28 11:36:21 -08:00
top.go Increase default max-rps for tap and top (#1531) 2018-08-28 14:16:39 -07:00
version.go Better CLI error messages when control plane is unavailable (#1428) 2018-08-09 15:40:41 -07:00
version_test.go Rename CLI from conduit to linkerd (#1312) 2018-07-12 17:14:07 -07:00