linkerd2/pkg/config
Alex Leong c6536996f7
Add linkerd repair command (#5636)
In the stable-2.9.0, stable-2.9.1, and stable-2.9.2 releases, the `linkerd-config-overrides` secret is missing the `linkerd.io/control-plane-ns` label.  This means that if a `linkerd upgrade` is performed to one of these versions using the `--prune` flag, then the secret will be deleted.  Missing this secret will prevent any further upgrades.

We add a `linkerd repair` command which recreates the `linkerd-config-overrides` secret by fetching the installed values from the `linkerd-config` configmap and then re-populating the redacted identity values from the `linkerd-identity-issuer` secret.

Usage:

```bash
linkerd repair | kubectl apply -f -
```

To test:
```
# Set Linkerd version to stable-2.8.0
> linkerd install | kubectl apply -f -
# Set Linkerd version to stable-2.9.1
> linkerd upgrade | kubectl apply --prune -l linkerd.io/control-plane-ns=linkerd -f -
# Set Linkerd version to stable-2.9.2
> linkerd upgrade | kubectl apply --prune -l linkerd.io/control-plane-ns=linkerd -f -
(Command fails)
# Set Linkerd version to HEAD
> linkerd repair | kubectl apply -f -
# Set Linkerd version to stable-2.9.2
> linkerd upgrade | kubectl apply --prune -l linkerd.io/control-plane-ns=linkerd -f -
(Command succeeds)
> linkerd check
```

Signed-off-by: Alex Leong <alex@buoyant.io>
2021-02-04 16:47:04 -08:00
..
config.go Add linkerd repair command (#5636) 2021-02-04 16:47:04 -08:00