Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CP check after the readiness check #5848

Merged
merged 6 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Lots of fixes
  • Loading branch information
alpeb committed Mar 1, 2021
commit 8b4124e5fdaa02887d59e17f933fa3baca79968a
24 changes: 22 additions & 2 deletions test/integration/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,17 @@ func TestInstallOrUpgradeCli(t *testing.T) {
}

// apply stage 1
out, err = TestHelper.KubectlApply(out, "")
// Limit the pruning only to known resources
// that we intend to be delete in this stage to prevent it
// from deleting other resources that have the
// label
out, err = TestHelper.KubectlApplyWithArgs(out, []string{
"--prune",
"-l", "linkerd.io/control-plane-ns=linkerd",
"--prune-whitelist", "rbac.authorization.k8s.io/v1/clusterrole",
"--prune-whitelist", "rbac.authorization.k8s.io/v1/clusterrolebinding",
"--prune-whitelist", "apiregistration.k8s.io/v1/apiservice",
}...)
if err != nil {
testutil.AnnotatedFatalf(t, "'kubectl apply' command failed",
"kubectl apply command failed\n%s", out)
Expand Down Expand Up @@ -399,7 +409,17 @@ func TestInstallOrUpgradeCli(t *testing.T) {
}
}

out, err = TestHelper.KubectlApply(out, "")
// Limit the pruning only to known resources
// that we intend to be delete in this stage to prevent it
// from deleting other resources that have the
// label
out, err = TestHelper.KubectlApplyWithArgs(out, []string{
"--prune",
"-l", "linkerd.io/control-plane-ns=linkerd",
"--prune-whitelist", "apps/v1/deployment",
"--prune-whitelist", "core/v1/service",
"--prune-whitelist", "core/v1/configmap",
}...)
if err != nil {
testutil.AnnotatedFatalf(t, "'kubectl apply' command failed",
"'kubectl apply' command failed\n%s", out)
Expand Down
11 changes: 10 additions & 1 deletion testutil/kubernetes_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ func (h *KubernetesHelper) KubectlApply(stdin string, namespace string) (string,
return h.Kubectl(stdin, args...)
}

// KubectlApplyWithArgs applies a given configuration string with the passed
// flags
func (h *KubernetesHelper) KubectlApplyWithArgs(stdin string, cmdArgs ...string) (string, error) {
args := []string{"apply"}
args = append(args, cmdArgs...)
args = append(args, "-f", "-")
return h.Kubectl(stdin, args...)
}

// Kubectl executes an arbitrary Kubectl command
func (h *KubernetesHelper) Kubectl(stdin string, arg ...string) (string, error) {
withContext := append([]string{"--context=" + h.k8sContext}, arg...)
Expand Down Expand Up @@ -342,7 +351,7 @@ func (h *KubernetesHelper) URLFor(ctx context.Context, namespace, deployName str
// WaitRollout blocks until the specified deployment has been
// completely rolled out (and its pods are ready)
func (h *KubernetesHelper) WaitRollout(t *testing.T, deployment string) {
o, err := h.Kubectl("", "--namespace=linkerd", "wait", "--for=condition=available", "--timeout=120s", "deploy/"+deployment)
o, err := h.Kubectl("", "--namespace=linkerd", "rollout", "status", "--timeout=120s", "deploy/"+deployment)
if err != nil {
AnnotatedFatalf(t, fmt.Sprintf("failed to wait for condition=available for deploy/%s", deployment),
"failed to wait for condition=available for deploy/%s: %s: %s", deployment, err, o)
Expand Down
2 changes: 2 additions & 0 deletions viz/charts/linkerd-viz/templates/tap-injector-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ metadata:
namespace: {{ .Values.namespace }}
annotations:
{{ include "partials.annotations.created-by" . }}
labels:
linkerd.io/extension: viz
type: kubernetes.io/tls
data:
tls.crt: {{ ternary (b64enc (trim $ca.Cert)) (b64enc (trim .Values.tapInjector.crtPEM)) (empty .Values.tapInjector.crtPEM) }}
Expand Down
1 change: 1 addition & 0 deletions viz/charts/linkerd-viz/templates/tap-injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ metadata:
spec:
type: ClusterIP
selector:
linkerd.io/extension: viz
component: tap-injector
ports:
- name: tap-injector
Expand Down