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

Fix pulumi.DependsOn in test-infra-definitions #31393

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .gitlab/common/test_infra_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
variables:
# To use images from test-infra-definitions dev branches, set the SUFFIX variable to -dev
# and check the job creating the image to make sure you have the right SHA prefix
TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: ""
TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: "-dev"
# Make sure to update test-infra-definitions version in go.mod as well
TEST_INFRA_DEFINITIONS_BUILDIMAGES: 7cd5e8a62570
TEST_INFRA_DEFINITIONS_BUILDIMAGES: 404ca75a476c
2 changes: 1 addition & 1 deletion test/new-e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ require (
// `TEST_INFRA_DEFINITIONS_BUILDIMAGES` matches the commit sha in the module version
// Example: github.com/DataDog/test-infra-definitions v0.0.0-YYYYMMDDHHmmSS-0123456789AB
// => TEST_INFRA_DEFINITIONS_BUILDIMAGES: 0123456789AB
github.com/DataDog/test-infra-definitions v0.0.0-20241115164330-7cd5e8a62570
github.com/DataDog/test-infra-definitions v0.0.0-20241122164717-404ca75a476c
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.27.40
github.com/aws/aws-sdk-go-v2/service/ec2 v1.164.2
Expand Down
4 changes: 2 additions & 2 deletions test/new-e2e/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 3 additions & 28 deletions test/new-e2e/tests/containers/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,37 +946,12 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string,
}, 5*time.Minute, 10*time.Second, "The deployment with name %s in namespace %s does not exist or does not have the auto detected languages annotation", name, namespace)
}

// Record old pod, so we can be sure we are not looking at the incorrect one after deletion
oldPods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
pods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", name).String(),
})
suite.Require().NoError(err)
suite.Require().Len(oldPods.Items, 1)
oldPod := oldPods.Items[0]

// Delete the pod to ensure it is recreated after the admission controller is deployed
err = suite.K8sClient.CoreV1().Pods(namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", name).String(),
})
suite.Require().NoError(err)

// Wait for the fresh pod to be created
var pod corev1.Pod
suite.Require().EventuallyWithTf(func(c *assert.CollectT) {
pods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", name).String(),
})
if !assert.NoError(c, err) {
return
}
if !assert.Len(c, pods.Items, 1) {
return
}
pod = pods.Items[0]
if !assert.NotEqual(c, oldPod.Name, pod.Name) {
return
}
}, 2*time.Minute, 10*time.Second, "Failed to witness the creation of pod with name %s in namespace %s", name, namespace)
suite.Require().Len(pods.Items, 1)
pod := pods.Items[0]

suite.Require().Len(pod.Spec.Containers, 1)

Expand Down
Loading