mirror of https://github.com/linkerd/linkerd2.git
Add missing SAs to linkerd check (#4194)
* Add missing SAs to linkerd check This adds the service accounts `linkerd-destination` and `linkerd-smi-metrics` that were missing from the "control plane ServiceAccounts exist" check.
This commit is contained in:
parent
e3bffb31a1
commit
d6c588f683
|
@ -181,10 +181,12 @@ var (
|
||||||
|
|
||||||
expectedServiceAccountNames = []string{
|
expectedServiceAccountNames = []string{
|
||||||
"linkerd-controller",
|
"linkerd-controller",
|
||||||
|
"linkerd-destination",
|
||||||
"linkerd-grafana",
|
"linkerd-grafana",
|
||||||
"linkerd-identity",
|
"linkerd-identity",
|
||||||
"linkerd-prometheus",
|
"linkerd-prometheus",
|
||||||
"linkerd-proxy-injector",
|
"linkerd-proxy-injector",
|
||||||
|
"linkerd-smi-metrics",
|
||||||
"linkerd-sp-validator",
|
"linkerd-sp-validator",
|
||||||
"linkerd-web",
|
"linkerd-web",
|
||||||
"linkerd-tap",
|
"linkerd-tap",
|
||||||
|
|
|
@ -749,6 +749,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-destination
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-identity
|
name: linkerd-identity
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -776,6 +785,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-smi-metrics
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-sp-validator
|
name: linkerd-sp-validator
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -942,6 +960,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-destination
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-identity
|
name: linkerd-identity
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -969,6 +996,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-smi-metrics
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-sp-validator
|
name: linkerd-sp-validator
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -1144,6 +1180,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-destination
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-identity
|
name: linkerd-identity
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -1171,6 +1216,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-smi-metrics
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-sp-validator
|
name: linkerd-sp-validator
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -1355,6 +1409,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-destination
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-identity
|
name: linkerd-identity
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -1382,6 +1445,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-smi-metrics
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-sp-validator
|
name: linkerd-sp-validator
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -1575,6 +1647,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-destination
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-identity
|
name: linkerd-identity
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
@ -1602,6 +1683,15 @@ metadata:
|
||||||
`
|
`
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: linkerd-smi-metrics
|
||||||
|
namespace: test-ns
|
||||||
|
labels:
|
||||||
|
linkerd.io/control-plane-ns: test-ns
|
||||||
|
`,
|
||||||
|
`
|
||||||
|
kind: ServiceAccount
|
||||||
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: linkerd-sp-validator
|
name: linkerd-sp-validator
|
||||||
namespace: test-ns
|
namespace: test-ns
|
||||||
|
|
|
@ -416,6 +416,24 @@ func TestCheckHelmStableBeforeUpgrade(t *testing.T) {
|
||||||
if TestHelper.UpgradeHelmFromVersion() == "" {
|
if TestHelper.UpgradeHelmFromVersion() == "" {
|
||||||
t.Skip("Skipping as this is not a helm upgrade test")
|
t.Skip("Skipping as this is not a helm upgrade test")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove when 2.8.0 is released
|
||||||
|
_, err := TestHelper.Kubectl("",
|
||||||
|
"--namespace", TestHelper.GetLinkerdNamespace(),
|
||||||
|
"create", "serviceaccount", "linkerd-smi-metrics",
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("linkerd-smi-metrics SA creation failed: %s", err)
|
||||||
|
}
|
||||||
|
_, err = TestHelper.Kubectl("",
|
||||||
|
"--namespace", TestHelper.GetLinkerdNamespace(),
|
||||||
|
"label", "serviceaccount", "linkerd-smi-metrics",
|
||||||
|
"linkerd.io/control-plane-ns="+TestHelper.GetLinkerdNamespace(),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("linkerd-smi-metrics SA labeling failed: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
testCheckCommand(t, "", TestHelper.UpgradeHelmFromVersion(), "", TestHelper.UpgradeHelmFromVersion())
|
testCheckCommand(t, "", TestHelper.UpgradeHelmFromVersion(), "", TestHelper.UpgradeHelmFromVersion())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,6 +442,16 @@ func TestUpgradeHelm(t *testing.T) {
|
||||||
t.Skip("Skipping as this is not a helm upgrade test")
|
t.Skip("Skipping as this is not a helm upgrade test")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove when 2.8.0 is released
|
||||||
|
_, err := TestHelper.Kubectl("",
|
||||||
|
"--namespace", TestHelper.GetLinkerdNamespace(),
|
||||||
|
"delete", "serviceaccount", "linkerd-smi-metrics",
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("linkerd-smi-metrics SA deletion failed: %s", err)
|
||||||
|
}
|
||||||
|
time.Sleep(3 * time.Second)
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"--reset-values",
|
"--reset-values",
|
||||||
"--atomic",
|
"--atomic",
|
||||||
|
|
Loading…
Reference in New Issue