Skip to content

Commit

Permalink
Re-enable webhook checks on migration setup test (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajivnathan authored Oct 17, 2023
1 parent 107256e commit c259f0b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
4 changes: 0 additions & 4 deletions test/migration/setup/setup_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (

func TestSetupMigration(t *testing.T) {
// given
// set env var to skip the mutating webhook check on migration setup temporarily since the old deployment
// will deploy the webhooks with the old configuration but the tests will be expecting the new configuration
// This should be removed after PR https://github.com/codeready-toolchain/toolchain-e2e/pull/809 is merged
t.Setenv("skip-webhook-checks-on-setup", "true")
awaitilities := WaitForDeployments(t)

runner := migration.SetupMigrationRunner{
Expand Down
12 changes: 0 additions & 12 deletions testsupport/wait/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"reflect"
"sort"
"strings"
Expand Down Expand Up @@ -2240,12 +2239,6 @@ func (a *MemberAwaitility) verifySecret(t *testing.T) []byte {
}

func (a *MemberAwaitility) verifyMutatingWebhookConfig(t *testing.T, ca []byte) {
if val := os.Getenv("skip-webhook-checks-on-setup"); val == "true" {
// skipped temporarily only for setup migration test but applies for after migration test
// This should be removed after PR https://github.com/codeready-toolchain/toolchain-e2e/pull/809 is merged
return
}

t.Logf("checking MutatingWebhookConfiguration")
actualMutWbhConf := &admv1.MutatingWebhookConfiguration{}
a.waitForResource(t, "", "member-operator-webhook", actualMutWbhConf)
Expand Down Expand Up @@ -2320,11 +2313,6 @@ func (a *MemberAwaitility) verifyMutatingWebhookConfig(t *testing.T, ca []byte)
}

func (a *MemberAwaitility) verifyValidatingWebhookConfig(t *testing.T, ca []byte) {
if val := os.Getenv("skip-webhook-checks-on-setup"); val == "true" {
// skipped temporarily only for setup migration test but applies for after migration test
// This should be removed after PR https://github.com/codeready-toolchain/toolchain-e2e/pull/809 is merged
return
}
t.Logf("checking ValidatingWebhookConfiguration '%s'", "member-operator-validating-webhook")
actualValWbhConf := &admv1.ValidatingWebhookConfiguration{}
a.waitForResource(t, "", "member-operator-validating-webhook", actualValWbhConf)
Expand Down

0 comments on commit c259f0b

Please sign in to comment.