Skip to content

Commit

Permalink
Set appID on sleep deployment, and return true on found container
Browse files Browse the repository at this point in the history
Signed-off-by: joshvanl <me@joshvanl.dev>
  • Loading branch information
JoshVanL committed Oct 19, 2023
1 parent 7cfbb33 commit ae861c5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/e2e/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,11 @@ func SidecarInjects() func(t *testing.T) {
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"app": "sleep"}},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"app": "sleep"},
Annotations: map[string]string{"dapr.io/enabled": "true"},
Labels: map[string]string{"app": "sleep"},
Annotations: map[string]string{
"dapr.io/enabled": "true",
"dapr.io/app-id": "sleep",
},
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{
Expand All @@ -732,6 +735,8 @@ func SidecarInjects() func(t *testing.T) {
require.NoError(t, err)

t.Cleanup(func() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)

Check failure on line 738 in tests/e2e/common/common.go

View workflow job for this annotation

GitHub Actions / Build linux_amd64 binaries

shadow: declaration of "ctx" shadows declaration at line 702 (govet)
defer cancel()
assert.NoError(t,
client.AppsV1().Deployments(DaprTestNamespace).Delete(ctx, deploy.Name, metav1.DeleteOptions{}),
)
Expand Down Expand Up @@ -780,6 +785,7 @@ func SidecarInjects() func(t *testing.T) {
if len(pod.Spec.Containers) != 2 || pod.Spec.Containers[1].Name != "daprd" {
return false, errors.New("expected injected daprd container")
}
return true, nil
}
}
}
Expand Down

0 comments on commit ae861c5

Please sign in to comment.