Skip to content

Commit

Permalink
Merge pull request #763 from marun/increase-test-timeout
Browse files Browse the repository at this point in the history
Bug 1802247: Check operator readiness before each bound token controller test
  • Loading branch information
openshift-merge-robot committed Feb 13, 2020
2 parents 56052bc + b2cfc7d commit 0019392
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/e2e/bound_sa_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ func TestBoundTokenSignerController(t *testing.T) {
targetNamespace := operatorclient.TargetNamespace
operatorNamespace := operatorclient.OperatorNamespace

// Wait for operator readiness
test.WaitForKubeAPIServerClusterOperatorAvailableNotProgressingNotDegraded(t, configClient)

// Retrieve the operator secret. The values in the secret and config map in the
// operand namespace should match the values in the operator secret.
operatorSecret, err := kubeClient.Secrets(operatorNamespace).Get(tokenctl.NextSigningKeySecretName, metav1.GetOptions{})
Expand All @@ -61,13 +58,17 @@ func TestBoundTokenSignerController(t *testing.T) {

// The operand secret should be recreated after deletion.
t.Run("operand-secret-deletion", func(t *testing.T) {
test.WaitForKubeAPIServerClusterOperatorAvailableNotProgressingNotDegraded(t, configClient)

err := kubeClient.Secrets(targetNamespace).Delete(tokenctl.SigningKeySecretName, &metav1.DeleteOptions{})
require.NoError(t, err)
checkBoundTokenOperandSecret(t, kubeClient, regularTimeout, operatorSecret.Data)
})

// The operand config map should be recreated after deletion.
t.Run("configmap-deletion", func(t *testing.T) {
test.WaitForKubeAPIServerClusterOperatorAvailableNotProgressingNotDegraded(t, configClient)

err := kubeClient.ConfigMaps(targetNamespace).Delete(tokenctl.PublicKeyConfigMapName, &metav1.DeleteOptions{})
require.NoError(t, err)
checkCertConfigMap(t, kubeClient, map[string]string{
Expand All @@ -79,6 +80,8 @@ func TestBoundTokenSignerController(t *testing.T) {
// after deletion. The configmap in the operand namespace should be updated
// immediately, and the secret once the configmap is present on all nodes.
t.Run("operator-secret-deletion", func(t *testing.T) {
test.WaitForKubeAPIServerClusterOperatorAvailableNotProgressingNotDegraded(t, configClient)

// Delete the operator secret
err := kubeClient.Secrets(operatorNamespace).Delete(tokenctl.NextSigningKeySecretName, &metav1.DeleteOptions{})
require.NoError(t, err)
Expand Down

0 comments on commit 0019392

Please sign in to comment.