Commit Graph

311 Commits

Author SHA1 Message Date
Kevin Leimkuhler d5591f07ac
Fix helm upgrade test (#4622)
## Problem

#4557 changed the name of the function that `helm_upgrade_integration_tests`
uses.

`install_stable()` was renamed to `latest_release_channel()` and now takes an
argument for specifying either `edge` or `stable`.

`run_helm_upgrade_test` is a function used by the helm upgrade integration test
and was not properly updated to use `latest_release_channel()`.

This silently passed integration tests because `run_helm_upgrade_test` started
passing an empty string for the version to upgrade from, which results in the
default behavior of `install_test.go`--and therefore still passes.

## Solution

`run_helm_upgrade_test` now uses `latest_release_channel()` and passes the
proper argument.

Additionally, it checks that the version returned from
`latest_release_channel()` is not empty. If it is empty, it exits the test. This
ensures something like this does happen in the future.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-06-18 12:22:15 -04:00
Kevin Leimkuhler f6bd722e2c
Fix install-pr script (#4610)
* Fix install-pr script
* Add image-archives path to commands to use the files

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
Signed-off-by: Charles Pretzer <charles@buoyant.io>
Co-authored-by: Charles Pretzer <charles@buoyant.io>
2020-06-17 21:32:01 -07:00
Kevin Leimkuhler b0765c4361
Add integration test for upgrading from edge (#4557)
This adds an integration test for upgrading from the latest edge to the current
build.

Closes #4471

Signed-off-by: Kevin Leimkuhler kevin@kleimkuhler.com
2020-06-16 09:18:52 -07:00
Alejandro Pedraza d10ed2aa5e
CI steps for Chocolatey package - take 2 (#4536)
* CI steps for Chocolatey package - take 2

Followup to #4205, supersedes #4205

This adds:

- A new job psscript-analyzer into the `statics_checks.yml`
workflow for linting the Chocolatey Powershell script.
- A new `choco_pack` job in the `release.yml` workflow for
updating the Chocolatey spec file and generating the
package. This is only triggered for stable releases. It requires
a windows runner in order to run the choco tooling (in theory
it should have worked on a linux runner but in practice it
didn't).
- The `Create release` step was updated to upload the generated package,
if present.
- The source file path in `bin/win/linkerd.nuspec` was updated
to make this work.

* Name nupkg file accordingly to the other release assets
2020-06-15 16:42:50 -05:00
Joakim Roubert 57f321b14b
Use buster for base and web images too (#4567)
Requires setting iptables-legacy as the iptables provider.

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-06-15 10:49:26 -07:00
Joakim Roubert 544d484784
bin/test-cleanup: Fix shellcheck issues (#4421)
Fix shellcheck issues

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-06-03 14:35:12 -04:00
Joakim Roubert 903fb0fcad
Fix quotes in shellscripts (#4406)
- Add quotes where missing, to handle whitespace & c:o.
- Use single quotes for non-expansion strings.
- Fix quotes were the current would cause errors.

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-06-02 16:44:38 -04:00
Alex Leong 5635f7377f
Fix uname flags for darwin in bin/lint (#4490)
The version of `uname` on Darwin doesn't support the `-o` flag, resulting in an error message when running the `bin/lint` script. 

We add an if-branch to short-circuit the `uname-o` call if running on Darwin.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-06-02 13:02:07 -07:00
Alejandro Pedraza 571626d524
CI: properly report errors from commands (#4514)
Failures in `bin/_test-run` from commands different than `go test`
aren't currently properly reported, in part because CI's bash default is
to have `set -e` which terminates the script and just outputs
`##[error]Process completed with exit code 2.` like
[here](https://github.com/linkerd/linkerd2/pull/4496/checks?check_run_id=720720352#step:14:116)

```
linkerd-existence
-----------------
√ 'linkerd-config' config map exists
√ heartbeat ServiceAccount exist
√ control plane replica sets are ready
× no unschedulable pods
    linkerd-controller-6c77c7ffb8-w8wh5: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-destination-6767d88f7f-rcnbq: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-grafana-76c76fcfb9-pdhfb: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-identity-5bcf97d6c8-q6rll: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-prometheus-6b95c56b44-hd9m6: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-proxy-injector-58d794ff9-jf7cj: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-sp-validator-6c5f999bfb-qg252: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-tap-6fdf84fc65-6txvr: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    linkerd-web-8484fbd867-nm8z2: 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
    see https://linkerd.io/checks/#l5d-existence-unschedulable-pods for hints

Status check results are ×
[error]Process completed with exit code 2.
```

I've made the following changes to `bin/_test-run` to generate better
messages and Github annotations when an error occurs:

- Unset `set -e` so that errors don't immediately exit the script and
don't allow us to properly format the errors.
- Removed many of the `exit_on_err` calls after go test calls because
those output enough information already (they were not being used
anyways in CI because of `set -e`). And instead have `run_test` exit
upon a `go test` error.
- Added `exit_on_err` calls right after non-`go-test` commands to
properly report their failure.
- Refactored the `exit_on_err` function so that it generates a Github
error annotation upon failure.
- Removed `trap` in `install_stable`, since the OS should be able to
handle GC for stuff under `/tmp`.

Also, I've changed the exit 2 code from `linkerd check` when it fails,
to exit code 1.
2020-06-01 15:57:33 -05:00
Alex Leong 015d352f34
Fix array handling in bin/fmt (#4489)
Quoting the list of directories passed to `goimports` was causing the list to be interpreted as a single argument which was stopping `bin/fmt` from working.

Instead, use `read` to split the list of directories into an array.

Also fix up incorrect formatting that has crept in while `bin/fmt` has been broken.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-06-01 12:10:24 -07:00
Kevin Leimkuhler 8f5ff8d973
Wait for KinD nodes to be ready in CI (#4488)
* Wait for all nodes to be ready in CI

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-05-28 13:56:09 -07:00
Zahari Dichev 7b46682841
Add allow and link commands (#4466)
This change adds a `allow` and `link` commands, effectivelly enabling a cluster to have more than one set of credentials that allow it to be mirrored. 

Fx #4461

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>

Co-authored-by: Alex Leong <alex@buoyant.io>
2020-05-27 14:30:55 -07:00
Alejandro Pedraza d4cdd956f5
Use bash shebang instead of sh in bin/root-tag (#4487)
In #4436 `head_root_tag()` was changed to replace `sed` with a
bash-native substitution. This assumes bash is our shell, which is the
case in `bin/_tag.sh` but not in `bin/root-tag` which calls it, and
which has a `sh` shebang that in Ubuntu points to dash instead of bash,
which breaks with the new bash-native substitution. Ergo, I'm
expliciting the bash shebang in this file.
2020-05-27 15:33:54 -05:00
Alejandro Pedraza de5b22ffba
Flaky tests: when installation test fails, fetch logs and events (#4410)
* When installation test fails, fetch logs and events

Re #4371

When a test fails in `./test/install_test.go`, trigger the `TestLogs`
and `TestEvents` tests in a separate process in order to output any
unexpected logs/events that might have caused the initial test failure.

For instance, currently we're sporadically experiencing pod restarts.
Instead of ignoring them, this might help provide us with the real
underlying cause.
2020-05-26 16:41:31 -05:00
Joakim Roubert 6b36934143
markdownlint: Use /bin/sh instead of /bin/bash (#4447)
The nice and clean markdownlint scripts use no bash-specific
functionality. Hence they could be run with /bin/sh instead. On e.g.
Debian-based systems /bin/sh is dash which has 1/10 of bash's footprint.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-20 16:36:53 -07:00
Joakim Roubert 5c104ebec6
Run shellcheck for all shell scripts in repository (#4441)
* Run shellcheck for all shell scripts in repository

Update the shellcheck command in static_checks.yml to not only scan the
contents of ./bin, but search for all files with mimetype
text/x-shellscript and feed them to shellcheck.

Certainly, this is a tad more time consuming than just scanning one
directory, but still a quite fast thing to do while it prevents any
new scripts to fly under the radar.

(Also, there is no need to exclude *.nuspec or *.ps1 from the find
command as they do not have the text/x-shellscript mimetype.)

Change-Id: I7433d231e8a315df65c03ee8765914e782057343
Signed-off-by: Joakim Roubert <joakimr@axis.com>

* Updates after review comment

Move shellcheck of all scripts to own script that is then called by
static_checks.yml as suggested by @kleimkuhler.
Also updated sources for helm-build and kind-load so that the
new shellcheck-all script can be called from any directory.

Change-Id: I9e82230459cb843c4143ec979c93060f424baed8
Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-05-20 14:08:45 -07:00
Alejandro Pedraza 301429ea9b
Bump KinD to 0.8.1 (#4445)
* Bump KinD to 0.8.1

This brings us K8s 1.18, which is in theory passing all the integration
tests. Currently the tracing one is failing just because of the quay.io
downtime, that hosts the nginx-ingress image.

Re #4382
2020-05-20 14:46:05 -05:00
Joakim Roubert 960ce556ba
bin/_log.sh: Add shebang to please shellcheck (#4437)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-20 09:55:51 -07:00
Joakim Roubert ef67cbed38
bin/lint: Fix shellcheck issue (#4434)
Delete variable `os` that is not used. The golangci-lint downloader script does its own extensive platform lookup before downloading the selected binary.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-19 23:23:25 -07:00
Kevin Leimkuhler d99c1486ba
Lint all markdown files in CI (#4402)
## Motivation

linkerd/rfc#22

## Solution

Use the [markdown-lint-action](https://github.com/marketplace/actions/markdown-linting-action) to lint all `.md` files for all pull requests
and pushes to master.

This action uses the default rules outlined in [markdownlint
package](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md).

The additional rules are added are explained below:
- Ignore line length lints for code blocks
- Ignore line length lints for tables
- Allow duplicate sub-headers in sibling headers (e.g. allowing multiple ##
  Significant headers in `CHANGES.md` as long as they are part of separate
  release headers)

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-05-19 23:03:50 -07:00
Joakim Roubert 30ba9a1261
bin/fmt: Fix shellcheck issue (#4438)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-19 14:49:28 -07:00
Joakim Roubert 6f1654a65d
bin/_tag.sh: Fix shellcheck issues (#4436)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-19 14:49:07 -07:00
Kevin Leimkuhler a457936045
Exit tests if linkerd resources exist (#4397)
## Motivation

As mentioned in the [Testing RFC](https://github.com/linkerd/rfc/blob/master/design/0003-isolated-integration-tests.md#constraints):
> The integration test setup checks require that certain conditions are
> satisfied by the given cluster. A surprising condition is that no
> pre-existing Linkerd installation resource may exist; if it does then it is
> deleted.

## Solution

`init_test_run` which runs before integration tests start will now exit the
script if any Linkerd resources exist on the cluster.

Example bad path:
```
Checking the linkerd binary...[ok]
Checking if there is a Kubernetes cluster available...[ok]
Checking if Linkerd resources exist on cluster...
Linkerd resources exist on cluster:

pod/hello-6b6b5d644d-xrnhn
pod/hello-slow-cooker-h8xn2
pod/world-fc8f457b7-gj7wq
pod/gateway-676fd64cb9-j57k6
pod/hello-c767bf764-cbdqh
pod/hello-slow-cooker-fqmxr
pod/slow-cooker-ftxdx
pod/t1-855c678bdd-vdg96
pod/t2-76989f94d4-d5fv8
pod/t3-75c8877797-hfwgc
pod/world-6784d4f65c-cn6vl
replicaset.apps/gateway-676fd64cb9
replicaset.apps/hello-c767bf764
replicaset.apps/t1-855c678bdd
replicaset.apps/t2-76989f94d4
replicaset.apps/t3-75c8877797
replicaset.apps/world-6784d4f65c
job.batch/hello-slow-cooker
job.batch/slow-cooker

Help:
    Run [/home/kevin/Projects/linkerd/linkerd2/bin/test-cleanup]
    Specify a cluster context [/home/kevin/Projects/linkerd/linkerd2/bin/test-run /home/kevin/Projects/linkerd/linkerd2/target/cli/linux/linkerd [l5d-integration] [context]]
exit
```

Example good path:
```
Checking the linkerd binary...[ok]
Checking if there is a Kubernetes cluster available...[ok]
Checking if Linkerd resources exist on cluster...[ok]
```

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-05-19 13:59:27 -07:00
Joakim Roubert b2082712b5
bin/update-go-deps-shas: Fix shellcheck issues (#4435)
Pass grep output through xargs.
Use `${0%/*}` instead of `$bindir `since the variable `bindir` exists in
_tag.sh too and then triggers the shellcheck variable modifed warning.
Script uses no bash features and can thus be a POSIX /bin/sh script.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-19 13:00:34 -07:00
Joakim Roubert 406107bc87
bin/_docker.sh: Fix shellcheck issues (#4433)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-19 10:39:41 -07:00
Joakim Roubert 113ccbc9c6
shellcheck: Bump to version 0.7.1 (#4439)
This includes the new download location since the old one is deprecated.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-19 10:24:55 -07:00
Joakim Roubert 56484ade8d
bin/test-clouds: Fix shellcheck issues (#4423)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 13:42:46 -07:00
Joakim Roubert 3ef358bb2f
bin/protoc-go.sh: Fix shellcheck error (#4420)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 13:13:41 -07:00
Joakim Roubert 68e25f2c11
bin/test-clouds-cleanup: Fix shellcheck issues (#4422)
shellcheck will not accept the string DO since it is not sure whether it is a misspelled do command or a string with DO. Explicitly quoting it will mitigate this.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 11:53:24 -07:00
Joakim Roubert cc1279b4ba
Fix SC1090 shellcheck issues in shell script files (#4417)
The SC1090 "Can't follow non-constant source" issue is addressed in the way suggested in shellcheck's documentation; the source paths are pointed out in shellcheck comments. By adding the bin dir to the -P shellcheck CLI parameter, we avoid having to state the bin directory in each and every script file.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 11:32:14 -07:00
Joakim Roubert 55326a61ac
bin/web: Fix shellcheck issues (#4425)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 10:46:28 -07:00
Joakim Roubert 9c639dc3b7
bin/test-scale: Fix shellcheck issues (#4424)
Remove superfluous echo commands in assignments.
Add quotes.
Simplify the for loops that shellcheck didn't like.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 10:41:49 -07:00
Joakim Roubert 5eba710f54
bin/mkube: Update according to shellcheck suggestions (#4419)
Also clean up sed Windows path filtering.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 10:03:42 -07:00
Joakim Roubert 1e8bfed83f
bin/fmt: Use sort -u instead of sort | uniq (#4418)
No need to pipe output to another program when the functionality
exists in sort.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-05-18 09:52:53 -07:00
Kevin Leimkuhler 659756e93f
Bump golangci-lint version (#4356)
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-05-15 16:22:17 -07:00
Joakim Roubert 0b58a56637
Use -n instead of ! -z in shell scripts (#4404)
Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-05-15 14:03:06 -05:00
Alejandro Pedraza d0d97e9426
Upgrade to Helm v3 (#4373)
Upgraded to Helm v3.2.1 from v2.16.1, getting rid of Tiller and making
other simplifications.

Note that the version placeholder in the `values.yaml` files had to be
changed from `{version}` to `linkerdVersionValue` because the former
confuses Helm v3.
2020-05-14 12:11:47 -05:00
Alejandro Pedraza fdd7809f13
Increase timeout for Helm cleanup in integration tests (#4317)
* Increase timeout for Helm cleanup in integration tests

Tests were failing sporadically, waiting for the Helm namespace to get
cleaned up. I verified that it is getting cleaned up, but taking more
time sometimes.
2020-05-01 09:48:37 -05:00
Zahari Dichev 5149152ef3
Multicluster gateway and remote setup command (#4265)
Add multicluster gateway and setup command

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-04-29 20:33:23 +03:00
drholmie 7a560a723d
Linkerd CLI Chocolatey Package (#4205)
* Add Linkerd CLI Chocolatey Package

This PR partially fixes #3063 by building a chocolatey package for Linkerd2's Windows CLI
It adds the build scripts for the Linkerd chocolatey package and based on discussions in
https://github.com/linkerd/linkerd2/pull/3921

Signed-off-by: Animesh Narayan Dangwal <animesh.leo@gmail.com>
2020-04-29 09:41:54 -07:00
Alejandro Pedraza 66ec92aa09
Additional Jest reporter for GH Annotations (#4294)
Second part of #4176

Added extra Jest reporter when running js tests from CI, which will send
to stdout a GH annotation for each test failure, something like:

```
::error file=/home/alpeb/src/forks/linkerd2/web/app/js/components/Navigation.test.jsx::Navigation › checks state when versions do not match
```

See the [health
metrics RFC](https://github.com/linkerd/rfc/blob/master/design/0002-ci-health-metrics.md) for more context.
2020-04-28 13:10:27 -05:00
Alejandro Pedraza 437f53cdcf
Fix bin/root-tag when applied to annotated tags (#4299)
Fixes #4298

Since we started using using annotated tags for releases (because they
need to be signed), `bin/root-tag` will append `^0` to them when used
after checking out a release tag. E.g.:

```
$ bin/root-tag
edge-20.4.4^0
```

which breaks version checking by the CLI.

This PR removes that trailing `^0` whenever it's present
2020-04-27 11:08:51 -05:00
Kevin Leimkuhler 00b8ea22a0
Update kind version (#4280)
#4195 relaxed the clock skew check to match the Kubernetes 1.17 default
heartbeat interval.

This is the same issue that was preventing an update to the `kind` version
used.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-22 11:38:44 -07:00
Alejandro Pedraza 322ba5fd2f
`linkerd uninstall` errors when attempting to delete PSP (#4234)
* Bug in `linkerd uninstall` when attempting to delete PSP

We were using a wrong apiVersion for PSP in `linkerd uninstall`'s
output, which avoids removing that resource:

```
$ linkerd uninstall | kubectl delete -f -
clusterrole.rbac.authorization.k8s.io "linkerd-linkerd-controller"
deleted
clusterrole.rbac.authorization.k8s.io "linkerd-linkerd-destination"
deleted
...
mutatingwebhookconfiguration.admissionregistration.k8s.io
"linkerd-proxy-injector-webhook-config" deleted
validatingwebhookconfiguration.admissionregistration.k8s.io
"linkerd-sp-validator-webhook-config" deleted
namespace "linkerd" deleted
error: unable to recognize "uninstall.yml": no matches for kind
"PodSecurityPolicy" in version "extensions/v1beta1"

$ kubectl get psp -oname
podsecuritypolicy.policy/linkerd-linkerd-control-plane
```

I've also replaced the uninstall integration test with a new separate
suite that performs the installation, waits for it to be ready,
uninstalls, and then confirms `linkerd check --pre` returns as expected.
2020-04-07 11:01:11 -05:00
Alex Leong d8eebee4f7
Upgrade to client-go 0.17.4 and smi-sdk-go 0.3.0 (#4221)
Here we upgrade our dependencies on client-go to 0.17.4 and smi-sdk-go to 0.3.0.  Since smi-sdk-go uses client-go 0.17.4, these upgrades must be performed simultaneously.

This also requires simultaneously upgrading our dependency on linkerd/stern to a SHA which also uses client-go 0.17.4.  This keeps all of our transitive dependencies synchronized on one version of client-go.

This ALSO requires updating our codegen scripts to use the 0.17.4 version of code-generator and running it to generate 0.17.4 compatible generated code.  I took this opportunity to update our code generation script to properly use the version of code-generater from `go.mod` rather than a hardcoded SHA.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-04-01 10:07:23 -07:00
Alejandro Pedraza 0c8171d466
Fix bin/kind-load for pull requests (#4222)
* Fix bin/kind-load for pull requests

Followup to #4212

External PRs were failing because:

1) The image tarballs weren't being loaded from the `images-archives`
directory
2) Concurrent calls to `bin/kind` were attempting to download the KinD
binary simultaneously, resulting in a "text file busy" error. To avoid
that, now we just call `bin/kind` synchronously one time beforehand.
2020-04-01 12:04:24 -05:00
Alejandro Pedraza 22f1606b73
Extract common logic in scripts and CI to load images into KinD (#4212)
Fixes #4206 Followup to #4167

Extract common logic to load images into KinD, from `bin/kind-load`, `bin/install-pr`, `.github/workflows/kind_integration.yml` and `.github/workflows/release.yml`.

Besides removing the duplication, `bin/kind-load` will benefit in performance by having each image be loaded in parallel.

```
Load into KinD the images for Linkerd's proxy, controller, web, grafana, debug and cni-plugin.

Usage:
    bin/kind-load [--images] [--images-host ssh://linkerd-docker]

Examples:

    # Load images from the local docker instance
    bin/kind-load

    # Load images from tar files located in the current directory
    bin/kind-load --images

    # Retrieve images from a remote docker instance and then load them into KinD
    bin/kind-load --images --images-host ssh://linkerd-docker

Available Commands:
    --images: use 'kind load image-archive' to load the images from local .tar files in the current directory.
    --images-host: the argument to this option is used as the remote docker instance from which images are first retrieved
                   (using 'docker save') to be then loaded into KinD. This command requires --images.
```
2020-03-30 16:28:28 -05:00
Kevin Leimkuhler 29db6c12a1
Fix script argument regex (#4188)
Currently the release tag regex matches against arguments that have `edge` or
`stable` as a substring.

It should only match against arguments that are either `edge` or `stable`.

For example, the graceful error handling is not triggered for the following:
```
❯ bin/create-release-tag edge-20.3.3
bin/create-release-tag: line 92: release_tag: unbound variable
```

This PR fixes the regex so that the above results in graceful error handling.

```
❯ bin/create-release-tag edge-20.3.3
Error: valid release channels: edge, stable
Usage:
    bin/create-release-tag edge
    bin/create-release-tag stable 2.4.8
```
2020-03-19 15:13:17 -07:00
Alejandro Pedraza 1cbc26a2c1
Upgrade golangci-lint to v1.23.8 (#4181)
* Upgrade golangci-lint to v1.23.8

This should help with some timeouts we're seeing in CI.

I fixed some new warnings found in `inject.go` and `uninject.go`.
Also we now have to explicitly disable linting `/controller/gen`.

The linter was also complaining that in `/pkg/k8s/fake.go` the
`spClient.Interface` and `tsclient.Interface` returned in the function
`newFakeClientSetsFromManifests()` aren't used, but I opted to ignore
that to leave them available for future tests.
2020-03-18 09:13:19 -05:00
Kevin Leimkuhler 6369cffacc
Add KinD option to `install-pr` script (#4167)
## Motivation

After #4147 added the `install-pr` script, installing PRs into existing
clusters does not work if that cluster is a KinD cluster

Changing the script to be able to use KinD, and specifically automate `kind
load` would be helpful!

## Solution

The script can now be used in the following ways.

```
❯ bin/install-pr --help
Install Linkerd with the changes made in a GitHub Pull Request.

Usage:
    --context: The name of the kubeconfig context to use

    # Install Linkerd into the current cluster
    bin/install-pr 1234

    # Install Linkerd into the current KinD cluster
    bin/install-pr [-k|--kind] 1234

    # Install Linkerd into the 'kind-pr-1234' KinD cluster
    bin/install-pr [-k|--kind] --context kind-pr-1234 1234
```

The script assumes that the cluster (KinD or not) has already been created. If
the cluster is a KinD cluster, the `-k|--kind` flag should be passed.

If the `--context` flag is not passsed, the install defaults to the current
context (`kubectl config current-context`).

I also added a [`-h|--help]` option that describes how to use the script.
2020-03-17 10:54:33 -07:00
Alex Leong df59448046
Use curl (#4162)
We use curl for fetching remote files in our `bin` scripts.  Replace the use of `wget` with `curl` in `bin/shellcheck` for consistency.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-03-10 12:39:12 -07:00
Alex Leong 586911e340
Add bin/install-pr script (#4147)
# Install PR

This script takes a Github pull request number as an argument, downloads the
docker images from the pull request's artifacts, pushes them, and installs
them on your Kubernetes cluster.  Requires a Github personal access token
in the $GITHUB_TOKEN environment variable.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-03-10 10:58:03 -07:00
Kevin Leimkuhler d69445db55
Improve release tag script (#4144)
## Motivation

Closes #4140

Automatically create new edge release tag:
```
❯ bin/create-release-tag edge
edge-20.3.2 tag created and signed.

tag: edge-20.3.2

To push tag, run:
    git push origin edge-20.3.2
```

Validate new stable release tag:
```
❯ bin/create-release-tag stable 2.7.1
stable-2.7.1 tag created and signed.

tag: stable-2.7.1

To push tag, run:
    git push origin stable-2.7.1
```

## Solution

The release tag script now takes a release channel argument. If the release
channel argument is `stable`, a second argument is required for the version.

If the release channel is `edge`, the script gets the current edge version and
creates a new edge version with the current year: `YY`, month: `MM`, and
increments the current month minor if it is not a new month.

If the release channel is `stable`, the script will only validate the version.

Example error cases:

```
❯ bin/create-release-tag
Error: create-release-tag accepts 1 or 2 arguments
Usage:
    create-release-tag edge
    create-release-tag stable x.x.x
```

```
❯ bin/create-release-tag foo
Error: valid release channels: edge, stable
Usage:
    bin/create-release-tag edge
    bin/create-release-tag stable 2.4.8
```

```
❯ bin/create-release-tag edge 2.7.1
Error: accepts 1 argument
Usage:
    bin/create-release-tag edge
```

```
❯ bin/create-release-tag stable
Error: accepts 2 arguments
Usage:
    bin/create-release-tag stable 2.4.8
```

```
❯ bin/create-release-tag stable 2.7
Error: version reference incorrect
Usage:
    bin/create-release-tag stable 2.4.8
```

```
❯ bin/create-release-tag stable 2.7.1.1
Error: version reference incorrect
Usage:
    bin/create-release-tag stable 2.4.8
```
2020-03-10 10:03:46 -07:00
cpretzer 54deffaadb
Fix shellcheck warning (#4137)
This is a followup to #4129, fixing this warning:
```
In ./bin/create-release-tag line 32:
tmp=$(. "$bindir"/_release.sh; extract_release_notes)
                               ^-------------------^ SC2119: Use
                               extract_release_notes "$@" if function's
                               $1 should mean script's $1.
```

In order to use functions in bash that use optional arguments that don't
generate this warning, we have to disable the SC2120 check, as explained here:
https://github.com/koalaman/shellcheck/wiki/SC2120#exceptions
2020-03-05 09:49:18 -08:00
Alejandro Pedraza 578a2d1960
CI: Adjustments to the release job (#4129)
Extracted the logic to pull the latest release notes, out of
`bin/create-release-tag` into `bin/_release.sh` so that it can be reused
in the `release.yml` workflow, which needs to use that inside
`gh_release` when creating the github release in order to have prettier
markup release notes instead of a plaintext message pulled out of the tag
message.
The new extracted function also receives an optional argument with the
name of the file to put the release notes into, because the `body_path`
parameter in `softprops/action-gh-release` doesn't work with dynamic
vars.

Finally, now the `website_publish` job will only launch until the `gh_release`
has succeeded.
2020-03-05 09:03:30 -05:00
Andrew Seigner a37316a336
Introduce `bin/shellcheck`, add to ci (#4118)
PR #4117 was root-caused with the help of `shellcheck`.

This change introduces a `bin/shellcheck` script, and adds it to CI. In
CI, many checks are disabled to allow it to pass. This will at least
prevent introduction of new classes of shell issue, and should motivate
re-enabling more checks over time.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2020-03-02 13:18:08 -08:00
Andrew Seigner b52dc35587
Fix `bin/fetch-proxy` on Linux (#4117)
`bin/fetch-proxy` was failing on Linux:

```bash
$ bin/fetch-proxy
linkerd2-proxy-v2.87.0/
linkerd2-proxy-v2.87.0/LICENSE
linkerd2-proxy-v2.87.0/bin/
linkerd2-proxy-v2.87.0/bin/linkerd2-proxy
bin/fetch-proxy: 31: [: Linux: unexpected operator
/home/siggy/code/linkerd2/target/proxy/linkerd2-proxy-v2.87.0
```

Also in CI:
https://github.com/linkerd/linkerd2/runs/473746447?check_suite_focus=true#step:5:32

Unfortunately `bin/fetch-proxy` still returned a zero exit status, because
`set -e` does not apply to commands that are part of `if` statements.
From https://ss64.com/bash/set.html:
```
-e  Exit immediately if a simple command exits with a non-zero status, unless
    the command that fails is part of an until or  while loop, part of an
    if statement, part of a && or || list, or if the command's return status
    is being inverted using !.  -o errexit
```
Fortunately when the `if` command failed, it fell through to the `else` clause
for Linux, and copied `linkerd-proxy` successfully.

Root cause was a `==` instead of `=`. `shellcheck` confirms, and also
recommends quoting:

```bash
$ shellcheck bin/fetch-proxy

In bin/fetch-proxy line 31:
if [ $(uname) == "Darwin" ]; then
     ^-- SC2046: Quote this to prevent word splitting.
              ^-- SC2039: In POSIX sh, == in place of = is undefined.
```

Apply `shellcheck` recommendations.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2020-03-02 12:33:20 -08:00
Zahari Dichev edd7fd203d
Service Mirroring Component (#4028)
This PR introduces a service mirroring component that is responsible for watching remote clusters and mirroring their services locally.

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-03-02 21:16:08 +02:00
Kevin Leimkuhler 44f1078498
Fix `fetch-proxy` script on macos (#4112)
`sha256sum` is not installed by default. Use `openssl dgst -sha256` instead.
2020-02-27 17:03:02 -08:00
Kevin Leimkuhler e37cb3b932
Add success message for tag script (#4111)
This adds a message after running the `create-release-script` that I intended to
add as part of the initial PR. Example output:

```
❯ bin/create-release-tag $TAG tag created and signed.

tag: edge-93.1.1

To push tag, run:
    git push origin edge-93.1.1
```
2020-02-27 10:03:41 -08:00
Kevin Leimkuhler 4aac6445c4
Add script to create release tag (#4091)
## Motivation

Creating a release tag is a manual process that is prone to error by the
release responsible member.

Additionally, the automated release project will require that a message is
included that is a copy of the recent `CHANGES.md` changes.

These steps can be scripted so that the member will just need to run a release
script.

## Solution

A `bin/create-release-tag` script will:
- Take a `$TAG` argument (maybe can remove this in the future) to use as the
  tag name
- Pull out the top section of `CHANGES.md` to use as the commit message
- Create the a tag with `$TAG` name and release changes as the message

## Example

```
$ TAG="edge-20.2.3"
$ bin/create-release-tag $TAG
$ git push $TAG
```

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-02-22 16:30:17 -08:00
Alejandro Pedraza ea523a46b0
Fixed shellcheck warnings on bin/helm-build (#4080)
Followup to #4058

```
$ shellcheck -x bin/helm-build; echo $?
0
```
2020-02-21 09:51:21 -05:00
Alejandro Pedraza 9b64f0dc94
Reuse bin/helm-build in Helm integration tests (#4088)
Have the preliminary setup for the Helm integration tests use
`bin/helm-build` instead of directly calling `helm dependency update`.
This allows testing `bin/helm-build` itself, and also lints the linkerd2
and linkerd2-cni charts (the latter lint call is being added as well in this
PR).
2020-02-21 09:26:10 -05:00
Alejandro Pedraza 77af716ab2
bin/helm-build automatically updates version in values.yaml (#4058)
* bin/helm-build automatically updates version in values.yaml

Have the Helm charts building script (`bin/helm-build`) update the
linkerd version in the `values.yaml` files according to the tagged
version, thus removing the need of doing this manually on every release.

This is akin to the update we do in `version.go` at CLI build time.

Note that `shellcheck` is issuing some warnings about this script, but
that's on code that was already there, so that will be handled in an
followup PR.
2020-02-18 11:19:58 -05:00
Zahari Dichev 9b29a915d3
Improve cni resources labels (#4032)
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-02-11 12:10:08 +02:00
Alejandro Pedraza 1e8223e143
Allow CI to run concurrent builds in master (#4001)
* Allow CI to run concurrent builds in master

Fixes #3911

Refactors the `cloud_integration` test to run in separate GKE clusters
that are created and torn down on the fly.
It leverages a new "gcloud" github action that is also used to set up
gcloud in other build steps (`docker_deploy` and `chart_deploy`).

The action also generates unique names for those clusters, based on the
git commit SHA and `run_id`, a recently introduced variable that is
unique per CI run and available to all the jobs.
This fixes part of #3635 in that CI runs on the same SHA don't interfere
with one another (in the `cloud_integration` test; still to do for
`kind_integration`).

The "gcloud" GH action is hosted under its own repo in https://github.com/linkerd/linkerd2-action-gcloud
2020-02-07 16:23:36 -05:00
Zahari Dichev c609564dc8
Add helm upgrade integration test (#3976)
In light of the breaking changes we are introducing to the Helm chart and the convoluted upgrade process (see linkerd/website#647) an integration test can be quite helpful. This simply installs latest stable through helm install and then upgrades to the current head of the branch.

Signed-off-by: Zahari Dichev zaharidichev@gmail.com
2020-02-04 08:27:46 +02:00
Zahari Dichev 0dac920362 Init helm before cni dependency update (#3969)
Moves helm init before cni dependency update and fixes the following problem: https://github.com/linkerd/linkerd2/runs/406581136#step:4:16

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-01-24 09:34:33 -08:00
Zahari Dichev a9d38189fb Fix CNI config parsing (#3953)
This PR addreses the problem introduced after #3766.

Fixes #3941 

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-01-23 09:55:04 -08:00
Tarun Pothulapati eac06b973c Move common values to global (#3839)
* move values to global in template

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* update inject and cli

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* update unit tests

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* fix linting issues

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* remote controllerImageVersion from global

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* move identity out of global

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* update var name and comments

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* update bin and helm tests

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* update helm readme

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* fix proxy config

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* fix proxy config indentation

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* more linting issues

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* remove unnecessary lines

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-01-06 14:31:41 -08:00
Alejandro Pedraza bb790b22b4
Upgrade `kind` to v0.6.1 (#3864)
* Upgrade `kind` to v0.6.1

Fixes #3852

Upgraded `/bin/kind` to pull v0.6.1.
Also have `workflow.yml` use `KUBECONFIG` explicitly for setting the
location of the config file, now that `kind get kubeconfig-path` has
been deprecated (check
https://github.com/kubernetes-sigs/kind/releases/tag/v0.6.0 for detailed
info).
Note that in the build server the kind binary for this version is
`kind-0.6.1`, leaving the `kind` binary still pointing to v0.5.1 while
this gets merged and all the PR branches get this.
2019-12-30 14:32:37 -05:00
Alejandro Pedraza 8c18b0b972
Upgraded `Helm` cli to v2.16.1 (#3865)
Needed for k8s 1.16
2019-12-23 16:39:26 -05:00
Alejandro Pedraza 1ed70c8aff
Build linkerd2-cni Helm chart in `bin/helm-build` (#3846)
Fixes #3801

This will package and build the `linkerd2-cni` chart from the
`charts/linkerd2-cni` directory and update our Helm Hub's `index.yaml`
file to index it.

This will only be run in the `chart_deploy` job of our Github Actions
when an edge/stable tag is pushed.

Once that happens, users will be able to install the chart with a
command like:

```
helm install linkerd-edge/linkerd2-cni
```

Docs update will follow.
2019-12-20 10:25:11 -05:00
Eugene Glotov 748da80409 Inject preStop hook into the proxy sidecar container to stop it last (#3798)
* Inject preStop hook into the proxy sidecar container to stop it last

This commit adds support for a Graceful Shutdown technique that is used
by some Kubernetes administrators while the more perspective
configuration is being discussed in
https://github.com/kubernetes/kubernetes/issues/65502

The problem is that RollingUpdate strategy does not guarantee that all
traffic will be sent to a new pod _before_ the previous pod is removed.
Kubernetes inside is an event-driven system and when a pod is being
terminating, several processes can receive the event simultaneously.
And if an Ingress Controller gets the event too late or processes it
slower than Kubernetes removes the pod from its Service, users requests
will continue flowing into the black whole.

According [to the documentation](https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods)

> 1. If one of the Pod’s containers has defined a `preStop` hook,
> it is invoked inside of the container. If the `preStop` hook is still
> running after the grace period expires, step 2 is then invoked with
> a small (2 second) extended grace period.
>
> 2. The container is sent the `TERM` signal. Note that not all
> containers in the Pod will receive the `TERM` signal at the same time
> and may each require a preStop hook if the order in which
> they shut down matters.

This commit adds support for the `preStop` hook that can be configured
in three forms:

1. As command line argument `--wait-before-exit-seconds` for
  `linkerd inject` command.

2. As `linkerd2` Helm chart value `Proxy.WaitBeforeExitSeconds`.

2. As `config.alpha.linkerd.io/wait-before-exit-seconds` annotation.

If configured, it will add the following preHook to the proxy container
definition:

```yaml
lifecycle:
  preStop:
    exec:
      command:
        - /bin/bash
        - -c
        - sleep {{.Values.Proxy.WaitBeforeExitSeconds}}
```

To achieve max benefit from the option, the main container should have
its own `preStop` hook with the `sleep` command inside which has
a smaller period than is set for the proxy sidecar. And none of them
must be bigger than `terminationGracePeriodSeconds` configured for the
entire pod.

An example of a rendered Kubernetes resource where
`.Values.Proxy.WaitBeforeExitSeconds` is equal to `40`:

```yaml
       # application container
        lifecycle:
          preStop:
            exec:
              command:
                - /bin/bash
                - -c
                - sleep 20

        # linkerd-proxy container
        lifecycle:
          preStop:
            exec:
              command:
                - /bin/bash
                - -c
                - sleep 40
    terminationGracePeriodSeconds: 160 # for entire pod
```

Fixes #3747

Signed-off-by: Eugene Glotov <kivagant@gmail.com>
2019-12-18 16:58:14 -05:00
Tarun Pothulapati efb1101bdb Switch to smaller-case values in linkerd2-cni (#3827)
* update linkerd2-cni templates and cli
* update readme and docs
* update helm unit tests
* update helm build script
* use smaller case linkerd version

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2019-12-16 15:09:57 -08:00
Alejandro Pedraza 2a4c71760d
Enable cert rotation test to work with dynamic namespaces, take two (#3795)
* Enable cert rotation test to work with dynamic namespaces

This PR adds support for dynamic cert generation when running the cert rotation intergration tests. This allows to avoid baking in the namespace in the certificate CN, thereby allowing us to run these tests on the clouds.

The tests in #3775 were failing because the second secret holding the issuer cert replacement was a leaf cert and not a root/intermediary cert capable of signing the CSRs. This is how the replacement cert looked like:

```bash
$ k -n l5d-integration-external-issuer get secrets linkerd-identity-issuer-new -ojson | jq '.data|.["tls.crt"]' | tr -d '"' | base64 -d | step certificate inspect -
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 2 (0x2)
    Signature Algorithm: ECDSA-SHA256
        Issuer: CN=identity.l5d-integration-external-issuer.cluster.local
        Validity
            Not Before: Dec 6 19:16:08 2019 UTC
            Not After : Dec 5 19:16:28 2020 UTC
        Subject: CN=identity.l5d-integration-external-issuer.cluster.local
        Subject Public Key Info:
            Public Key Algorithm: ECDSA
                Public-Key: (256 bit)
                X:
                    93:d5:fa:f8:d1:44:4f:9a:8c:aa:0c:9e:4f:98:a3:
                    8d:28:d9:cc:f2:74:4c:5f:76:14:52:47:b9:fb:c9:
                    a3:33
                Y:
                    d2:04:74:95:2e:b4:78:28:94:8a:90:b2:fb:66:1b:
                    e7:60:e5:02:48:d2:02:0e:4d:9e:4f:6f:e9:0a:d9:
                    22:78
                Curve: P-256
        X509v3 extensions:
            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment
            X509v3 Extended Key Usage:
                TLS Web Server Authentication, TLS Web Client Authentication
            X509v3 Subject Alternative Name:
                DNS:identity.l5d-integration-external-issuer.cluster.local

    Signature Algorithm: ECDSA-SHA256
         30:46:02:21:00:f6:93:2f:10:ba:eb:be:bf:77:1a:2d:68:e6:
         04:17:a4:b4:2a:05:80:f7:c5:f7:37:82:7b:b7:9c:a1:66:6a:
         e1:02:21:00:b3:65:06:37:49:06:1e:13:98:7c:cf:f9:71:ce:
         5a:55:de:f6:1b:83:85:b0:a8:88:b7:cf:21:d1:16:f2:10:f9
```
For it to be a root/intermediate cert it should have had `CA:TRUE` under the `X509v3 extensions` section.

Why did the test pass sometimes? When it did pass for me, I could see in the linkerd-identity proxy logs something like:
```
ERR! [   320.964592s] linkerd2_proxy_identity::certify Received invalid ceritficate: invalid certificate: UnknownIssuer
```
so the cert retrieved from identity still was invalid but for some reason the proxy, sometimes, keeps on going despite that. And when one would delete the linkerd-identity pod, its proxy wouldn't come up at all, also showing that error.

With the changes from this branch, we no longer see that error in the logs and after deleting the linkerd-identity pod it comes back gracefully.
2019-12-11 15:50:06 -05:00
Zahari Dichev 6faf64e49f Revert "Enable cert rotation test to work with dynamic namespaces (#3775)" (#3787)
This reverts commit 0e45b9c03d.

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2019-12-05 15:33:22 -05:00
Zahari Dichev 0e45b9c03d
Enable cert rotation test to work with dynamic namespaces (#3775)
This PR adds support for dynamic cert generation when running the cert rotation intergration tests. This allows to avoid baking in the namespace in the certificate CN, thereby allowing us to run these tests on the clouds.

* Enable cert rotation test to work with dynamic namespaces

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>

* Address comments

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>

* Address further comments

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2019-12-05 10:08:01 +02:00
Joakim Roubert e1b3fdb029 Fix whitespace path handling in non-docker (build) scripts (#3650)
* Fix whitespace path handling in non-docker (build) scripts

Handling of whitespace paths was not fully implemented; this patch adds
the missing pieces. Also, only use bash where bash-specific
functionality is used/needed.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-11-26 09:48:41 -05:00
Alex Leong 0026103362 Unit and integration test fixups (#3730)
- Added cleanup step at the end of all integration tests.
- Disable external_issuer_integration_tests in cloud_tests due to
  namespace issue. Running this via `kind` tests is sufficient for now.
- Set a flakey test to `Skip`, relates to #3332.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-11-15 03:40:42 -08:00
Zahari Dichev 2d224302de
Add integration test for external issuer and cert rotation flows (#3709)
Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-11-14 06:58:32 +02:00
Alejandro Pedraza 3324966702
Upgrade go to 1.13.4 (#3702)
Fixes #3566

As explained in #3566, as of go 1.13 there's a strict check that ensures a dependency's timestamp matches it's sha (as declared in go.mod). Our smi-sdk dependency has a problem with that that got resolved later on, but more work would be required to upgrade that dependency. In the meantime a quick pair of replace statements at the bottom of go.mod fix the issue.
2019-11-13 12:54:36 -05:00
Zahari Dichev 7dd5dfc2ba
Check health of meshed apps before and after linkerd upgrade (#3641)
* Check stats of deployed app before and after linkerd upgrade to ensure nothing broke

Signed-off-by: zaharidichev <zaharidichev@gmail.com>

* Address naming remarks

Signed-off-by: zaharidichev <zaharidichev@gmail.com>

* Improve application health checking

Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-11-07 20:48:12 +02:00
Zahari Dichev 1bb9d66757 Integration test for custom cluster domain (#3660)
Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-11-04 14:49:52 -08:00
Joakim Roubert 80d644eb1d docker-build-proxy: make apt work behind proxy (#3643)
This patch sends the proxy settings to docker build if present.
Without this, the docker build will fail on apt-get update on a
system that is behind a proxy.

Change-Id: I3fcbad4d9a9c30e5f0a00f03c6d8629ed8cc97b0
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-11-04 13:17:44 -08:00
Joakim Roubert 478145ce45 Fix whitespace path handling in docker (build) scripts (#3634)
Handling of whitespace paths was not fully implemented; this patch adds
the missing pieces. Also, only use bash where bash-specific
functionality is used/needed.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-30 15:55:38 -07:00
Joakim Roubert b5309fad04 build-cli-bin: Use case for host_platform selection (#3626)
Increase readability and extensibility.

Change-Id: I0670950e14b59da0971397d08016176650602247
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-28 16:49:56 -05:00
Joakim Roubert 3411e22bdc fetch-proxy: Make POSIX compatible (#3625)
* fetch-proxy: Make POSIX compatible
* fetch-proxy: Update old comment to match current behavior

Getting the directory where the script resides can easily be done
without bash-specific functionality, and hence the script can be POSIX
compatible.

Change-Id: I30bd69dccbc950bdce3dc5da4bea279305a7b1f9
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-28 16:45:23 -05:00
Joakim Roubert 0341af86e8 build-cli-bin: POSIX compatible & handle whitespace paths (#3623)
Getting the directory where the script resides can easily be done
without bash-specific functionality, and hence the script can be POSIX
compatible. Also adding the missing pieces for handling paths with
whitespaces.

Change-Id: Ie2e867929be0322e476342438d9cf4a3d36f58f1
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-28 16:36:53 -05:00
Oliver Gould 87e03ae940
Update proxy update commit messages with tag info (#3594)
Each proxy release tag now includes a message.

This change updates the git-commit-proxy-version script to include this
message in the commit message in this repo.
2019-10-18 10:20:38 -07:00
Alejandro Pedraza e76c5c3d9d
Keep old releases in Helm repo index (#3589)
* Keep old releases in Helm repo index

When building the Helm repo index file, keep the references to the old
releases. Also rename and keep the old index file in case
something goes wrong when generating the new one.

Fixes #3561
2019-10-16 17:21:53 -05:00
Alex Leong 3dcff52b9f
Switch from using golangci fmt to using goimports (#3555)
CI currently enforcing formatting rules by using the fmt linter of golang-ci-lint which is invoked from the bin/lint script.  However it doesn't seem possible to use golang-ci-lint as a formatter, only as a linter which checks formatting.  This means any formatter used by your IDE or invoked manually may or may not use the same formatting rules as golang-ci-lint depending on which formatter you use and which specific revision of that formatter you use.  

In this change we stop using golang-ci-lint for format checking.  We introduce `tools.go` and add goimports to the `go.mod` and `go.sum` files.  This allows everyone to easily get the same revision of goimports by running `go install -mod=readonly golang.org/x/tools/cmd/goimports` from inside of the project.  We add a step in the CI workflow that uses goimports via the `bin/fmt` script to check formatting.

Some shell gymnastics were required in the `bin/fmt` script to work around some limitations of `goimports`:
* goimports does not have a built-in mechanism for excluding directories, and we need to exclude the vendor director as well as the generated Go sources
* goimports returns a 0 exit code, even when formatting errors are detected

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-10-16 13:56:11 -07:00
Saurav Tiwary 1e44513f30 Clean username before using as docker image tag (#3572)
* Clean username before using as docker image tag
* Allow Alphanumerics instead of just alphabets in docker image tag
Incorporate Alex's suggestions

Fixes #3570 

Signed-off-by: Saurav Tiwary <srv.twry@gmail.com>
2019-10-15 16:36:48 -07:00
Alejandro Pedraza 3de35ccc58
Remove Discovery service leftovers (#3500)
Followup to #2990, which refactored `linkerd endpoints` to use the
`Destination.Get` API instead of the `Discovery.Endpoints` API, leaving
the Discovery with no implented methods. This PR removes all the Discovery
code leftovers.

Fixes #3499
2019-10-15 11:20:21 -05:00
cpretzer 8f83a56431
Revert upgrade to buster based on CNI test failure after merge (#3486) 2019-09-26 13:40:43 -07:00
cpretzer 5455a344d8
Update base docker image to debian latest stable: buster (#3438)
* Update base docker image to debian latest stable: buster

Signed-off-by: Charles Pretzer <charles@buoyant.io>

* Update all files to use buster image
2019-09-26 09:02:12 -07:00
Kevin Leimkuhler 151104ec5a
Add script to load images into kind cluster (#3458)
## Summary

[kind](https://github.com/kubernetes-sigs/kind) has been a helpful tool for running local Kubernetes clusters and
testing linkerd builds. Once images are built with `bin/docker-build`, the
images must be loaded into the kind cluster.

This script should be run after `bin/docker-build` and will load the images into
the specified kind cluster.

Example:
```
$ bin/docker-build
$ kind get clusters # show available clusters to load images on to
kleimkuhler
$ bin/kind-load kleimkuhler
$ ./target/cli/linux/linkerd install | kubectl apply -f -
```

Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2019-09-23 14:43:31 -07:00
Oliver Gould d51f7f77a7
proxy: Update to v2.71.0 (#3433)
Update the proxy release process to fetch artifacts from tagged GitHub releases.

* Use GitHub Actions for Pull Requests (linkerd/linkerd2-proxy#343)
* ci: Run tests inside rust container (linkerd/linkerd2-proxy#344)
* update tracing crates (linkerd/linkerd2-proxy#346)
* core: Introduce the Recover trait (linkerd/linkerd2-proxy#347)
* ci: Automate releases via GitHub Actions (linkerd/linkerd2-proxy#349)
* Add opencensus exporter (linkerd/linkerd2-proxy#338)
* Add trace context crate (linkerd/linkerd2-proxy#339)
* ci: Use a readymade release action (linkerd/linkerd2-proxy#351)
* Add 587 to the list of ports to disable protocol detection (linkerd/linkerd2-proxy#350)
* Record SHA of package artifact (linkerd/linkerd2-proxy#353)
2019-09-17 15:18:24 -07:00
Alejandro Pedraza 8270ba363c
Add chart_deploy into workflow.yml (#3415)
* Have CI push the Helm artifacts into GCS

- Added missing OWNERS and README files
- Added maintainers section to  Chart.yaml
- Changed NOTES.txt so it points to the installation of the CLI
- Set the proxy-init version to v1.1.0 in values.yaml

Ref #3256

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-09-11 12:09:50 -05:00
Alejandro Pedraza bd702b99ae
Last changes before submitting to the Helm incubator (#3292)
* Last changes before submitting to the Helm incubator

- Added missing OWNERS and README files
- Added maintainers section to  Chart.yaml
- Changed NOTES.txt so it points to the installation of the CLI
- Set the proxy-init version to v1.1.0 in values.yaml
- Added missing ProfileValidator vars, and add 'do not edit' comment to the Identity.Issuer.CrtExpiryAnnotation value
- Added new self-hosted repo
- Added  option to bin/helm-build
- Added DisableHeartBeat to README

Ref #3256

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-09-10 14:24:39 -05:00