Skip to content

Commit b384006

Browse files
committed
fix(e2e): use testNamespace for ownedAPIService test
1 parent 2211644 commit b384006

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

test/e2e/catalog_e2e_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestCatalogLoadingBetweenRestarts(t *testing.T) {
5454
require.NoError(t, err)
5555

5656
// get catalog operator deployment
57-
deployment, err := getOperatorDeployment(c, labels.Set{"app": "catalog-operator"})
57+
deployment, err := getOperatorDeployment(c, operatorNamespace, labels.Set{"app": "catalog-operator"})
5858
require.NoError(t, err)
5959
require.NotNil(t, deployment, "Could not find catalog operator deployment")
6060

@@ -77,8 +77,8 @@ func TestCatalogLoadingBetweenRestarts(t *testing.T) {
7777
t.Logf("Catalog source sucessfully loaded after rescale")
7878
}
7979

80-
func getOperatorDeployment(c operatorclient.ClientInterface, operatorLabels labels.Set) (*appsv1.Deployment, error) {
81-
deployments, err := c.ListDeploymentsWithLabels(operatorNamespace, operatorLabels)
80+
func getOperatorDeployment(c operatorclient.ClientInterface, namespace string, operatorLabels labels.Set) (*appsv1.Deployment, error) {
81+
deployments, err := c.ListDeploymentsWithLabels(namespace, operatorLabels)
8282
if err != nil || deployments == nil || len(deployments.Items) != 1 {
8383
return nil, fmt.Errorf("Error getting single operator deployment for label: %v", operatorLabels)
8484
}
@@ -95,7 +95,7 @@ func rescaleDeployment(c operatorclient.ClientInterface, deployment *appsv1.Depl
9595
}
9696

9797
waitForScaleup := func() (bool, error) {
98-
fetchedDeployment, err := c.GetDeployment(operatorNamespace, deployment.GetName())
98+
fetchedDeployment, err := c.GetDeployment(deployment.GetNamespace(), deployment.GetName())
9999
if err != nil {
100100
return true, err
101101
}

test/e2e/csv_e2e_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,19 +723,19 @@ func TestCreateCSVRequirementsMetCRD(t *testing.T) {
723723
err = wait.Poll(pollInterval, pollDuration, func() (bool, error) {
724724
dep, err := c.GetDeployment(testNamespace, depName)
725725
if k8serrors.IsNotFound(err) {
726-
fmt.Printf("deployment %s not found", depName)
726+
fmt.Printf("deployment %s not found\n", depName)
727727
return false, nil
728728
} else if err != nil {
729-
fmt.Printf("unexpected error fetching deployment %s", depName)
729+
fmt.Printf("unexpected error fetching deployment %s\n", depName)
730730
return false, err
731731
}
732732
if dep.Status.UpdatedReplicas == *(dep.Spec.Replicas) &&
733733
dep.Status.Replicas == *(dep.Spec.Replicas) &&
734734
dep.Status.AvailableReplicas == *(dep.Spec.Replicas) {
735-
fmt.Printf("deployment ready")
735+
fmt.Println("deployment ready")
736736
return true, nil
737737
}
738-
fmt.Printf("deployment not ready")
738+
fmt.Println("deployment not ready")
739739
return false, nil
740740
})
741741
require.NoError(t, err)
@@ -1009,12 +1009,12 @@ func TestCreateCSVWithOwnedAPIService(t *testing.T) {
10091009
// Induce a cert rotation
10101010
fetchedCSV.Status.CertsLastUpdated = metav1.Now()
10111011
fetchedCSV.Status.CertsRotateAt = metav1.Now()
1012-
fetchedCSV, err = crc.OperatorsV1alpha1().ClusterServiceVersions(operatorNamespace).UpdateStatus(fetchedCSV)
1012+
fetchedCSV, err = crc.OperatorsV1alpha1().ClusterServiceVersions(testNamespace).UpdateStatus(fetchedCSV)
10131013
require.NoError(t, err)
10141014

10151015
_, err = fetchCSV(t, crc, csv.Name, func(csv *v1alpha1.ClusterServiceVersion) bool {
10161016
// Should create deployment
1017-
dep, err = c.GetDeployment(operatorNamespace, depName)
1017+
dep, err = c.GetDeployment(testNamespace, depName)
10181018
require.NoError(t, err)
10191019

10201020
// Should have a new ca hash annotation

test/e2e/util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func catalogSourceSynced(catalog *v1alpha1.CatalogSource) bool {
240240
if !catalog.Status.LastSync.IsZero() {
241241
return true
242242
}
243-
fmt.Printf("not synced: %#v", catalog)
243+
244244
return false
245245
}
246246

0 commit comments

Comments
 (0)