Skip to content

Commit

Permalink
Fix incluster suite
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed Dec 15, 2021
1 parent 79a97c4 commit 394d8c5
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/e2e/incluster/incluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ func TestIncluster(t *testing.T) {
}

var _ = BeforeSuite(func() {
// Default to using ContourConfiguration CRD.
originalArgs := f.Deployment.ContourDeployment.Spec.Template.Spec.Containers[0].Args
var newArgs []string
for _, arg := range originalArgs {
if !strings.Contains(arg, "--config-path") {
newArgs = append(newArgs, arg)
}
}
newArgs = append(newArgs, "--contour-config-name=incluster-tests")
f.Deployment.ContourDeployment.Spec.Template.Spec.Containers[0].Args = newArgs
require.NoError(f.T(), f.Deployment.EnsureResourcesForInclusterContour(false))
})

Expand All @@ -50,17 +60,8 @@ var _ = Describe("Incluster", func() {
var contourConfig *contour_api_v1alpha1.ContourConfiguration

BeforeEach(func() {
// Default to using ContourConfiguration CRD.
contourConfig = e2e.DefaultContourConfiguration()
originalArgs := f.Deployment.ContourDeployment.Spec.Template.Spec.Containers[0].Args
newArgs := []string{}
for _, arg := range originalArgs {
if !strings.Contains(arg, "--config-path") {
newArgs = append(newArgs, arg)
}
}
newArgs = append(newArgs, "--contour-config-name="+contourConfig.Name)
f.Deployment.ContourDeployment.Spec.Template.Spec.Containers[0].Args = newArgs
contourConfig.Name = "incluster-tests"
})

JustBeforeEach(func() {
Expand Down

0 comments on commit 394d8c5

Please sign in to comment.