Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5ed8cf4
add PDB to make sure at least 1 pod is always available during upgrad…
jianzhangbjz Nov 27, 2025
4355cde
Update ClusterExtensionRevision API docs (#2350)
perdasilva Nov 27, 2025
91b03c7
🌱 new tag symmetry and required validations (#2358)
grokspawn Dec 1, 2025
4e5542f
:seedling: Bump pymdown-extensions from 10.17.1 to 10.17.2 (#2364)
dependabot[bot] Dec 1, 2025
b23e124
institute 2wk dependency cooldown policy (#2363)
grokspawn Dec 1, 2025
34394ce
Fix testCatalogName conflict in parallel e2e tests (#2367)
jianzhangbjz Dec 2, 2025
0072857
Merge branch 'main' into synchronize
Dec 2, 2025
4a547db
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
b6f4da7
UPSTREAM: <carry>: Add new tests for single/own namespaces install modes
camilamacedo86 Oct 6, 2025
93b3929
UPSTREAM: <carry>: Upgrade OCP image from 4.20 to 4.21
camilamacedo86 Oct 13, 2025
b3b6d06
UPSTREAM: <carry>: [Default Catalog Tests] - Change logic to get ocp …
camilamacedo86 Oct 13, 2025
58c2f61
UPSTREAM: <carry>: Update OCP catalogs to v4.21
tmshort Oct 13, 2025
3fa03ea
UPSTREAM: <carry>: support singleown cases in disconnected
kuiwang02 Oct 16, 2025
9d58caa
UPSTREAM: <carry>: fix cases 81696 and 74618 for product code changes
kuiwang02 Oct 17, 2025
84201cb
UPSTREAM: <carry>: Define Default timeouts and apply their usage accr…
camilamacedo86 Oct 22, 2025
ec5a401
UPSTREAM: <carry>: Update to new feature-gate options in helm
tmshort Oct 22, 2025
df6d7d4
UPSTREAM: <carry>: Fix flake for single/own ns tests by ensuring uniq…
camilamacedo86 Oct 22, 2025
27c04e5
UPSTREAM: <carry>: [OTE]: Enhance single/own ns based on review comme…
camilamacedo86 Oct 24, 2025
9393d7f
UPSTREAM: <carry>: Update OwnSingle template to use spec.config.inlin…
kuiwang02 Nov 3, 2025
1a4b54e
UPSTREAM: <carry>: [OTE]: Add webhook cleanup validation on extension…
camilamacedo86 Nov 4, 2025
be96547
UPSTREAM: <carry>: Add [OTP] to migrated cases
kuiwang02 Nov 7, 2025
f3f9743
UPSTREAM: <carry>: [OTE]: Upgrade dependencies used
camilamacedo86 Nov 5, 2025
0ae57c7
UPSTREAM: <carry>: fix(OTE): fix OpenShift Kubernetes replace version…
camilamacedo86 Nov 10, 2025
31c8501
UPSTREAM: <carry>: [Default Catalog Tests] Upgrade go 1.24.6 and depe…
camilamacedo86 Nov 11, 2025
f7ae9c3
UPSTREAM: <carry>: add disconnected environment support with custom p…
kuiwang02 Nov 12, 2025
63848dc
UPSTREAM: <carry>: migrate jiazha test cases to OTE
jianzhangbjz Nov 14, 2025
bac284b
UPSTREAM: <carry>: migrate clustercatalog case to ote
Xia-Zhao-rh Oct 17, 2025
7ad780d
UPSTREAM: <carry>: migrate olmv1 QE stress cases
kuiwang02 Nov 20, 2025
e037806
UPSTREAM: <carry>: Use busybox/httpd to simulate probes
tmshort Nov 25, 2025
ed96aa9
UPSTREAM: <carry>: migrate olmv1 QE cases
Xia-Zhao-rh Nov 25, 2025
71859c9
UPSTREAM: <carry>: add agent for olmv1 qe cases
kuiwang02 Oct 21, 2025
e4972ac
UPSTREAM: <drop>: go mod vendor
Dec 2, 2025
0176527
UPSTREAM: <drop>: remove upstream GitHub configuration
Dec 2, 2025
f45bd14
UPSTREAM: <drop>: configure the commit-checker
Dec 2, 2025
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
Prev Previous commit
Next Next commit
UPSTREAM: <carry>: Fix flake for single/own ns tests by ensuring uniq…
…uess and waiting for k8s cleanups

Co-Author: [email protected]
  • Loading branch information
camilamacedo86 authored and ci-robot committed Dec 2, 2025
commit df6d7d4ac1222e5be4403a6c9b253c84c749c41e
75 changes: 49 additions & 26 deletions openshift/tests-extension/test/olmv1-singleownnamespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"
Expand Down Expand Up @@ -277,9 +278,7 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace] OLMv1 ope
var (
k8sClient client.Client
activeNamespaces map[string]struct{}
catalogName string
packageName string
crdSuffix string
singleownImage string
)

BeforeEach(func(ctx SpecContext) {
Expand All @@ -291,29 +290,8 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace] OLMv1 ope
helpers.RequireImageRegistry(ctx)
k8sClient = env.Get().K8sClient
activeNamespaces = map[string]struct{}{}

// Generate unique CRD suffix for parallel execution
crdSuffix = rand.String(4)

// Build in-cluster bundle and catalog
singleownImage := image.LocationFor("quay.io/olmtest/webhook-operator:v0.0.5")
packageName = fmt.Sprintf("singleown-operator-both-%s", crdSuffix)
By(fmt.Sprintf("using singleown operator image: %s, CRD suffix: %s, package: %s", singleownImage, crdSuffix, packageName))

replacements := map[string]string{
"{{ TEST-BUNDLE }}": "",
"{{ NAMESPACE }}": "",
"{{ TEST-CONTROLLER }}": singleownImage,
"{{ CRD-SUFFIX }}": crdSuffix,
"{{ PACKAGE-NAME }}": packageName,
}

var nsName, opName string
_, nsName, catalogName, opName = helpers.NewCatalogAndClusterBundles(ctx, replacements,
singleownindex.AssetNames, singleownindex.Asset,
singleownbundle.AssetNames, singleownbundle.Asset,
)
By(fmt.Sprintf("singleown bundle %q and catalog %q built successfully in namespace %q", opName, catalogName, nsName))
singleownImage = image.LocationFor("quay.io/olmtest/webhook-operator:v0.0.5")
By(fmt.Sprintf("using singleown operator image: %s", singleownImage))
})

AfterEach(func(ctx SpecContext) {
Expand Down Expand Up @@ -359,6 +337,29 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace] OLMv1 ope
activeNamespaces[watchNamespace] = struct{}{}
}

// Ensure unique names per scenario
crdSuffix := rand.String(4)
packageName := fmt.Sprintf("singleown-operator-both-%s", crdSuffix)
By(fmt.Sprintf("building singleown operator assets for %s scenario: image=%s, CRD suffix=%s, package=%s", sc.label, singleownImage, crdSuffix, packageName))

replacements := map[string]string{
"{{ TEST-BUNDLE }}": "",
"{{ NAMESPACE }}": "",
"{{ TEST-CONTROLLER }}": singleownImage,
"{{ CRD-SUFFIX }}": crdSuffix, // Unique CRD suffix per scenario
"{{ PACKAGE-NAME }}": packageName,
"webhook-operator-webhooktest-admin-role": fmt.Sprintf("webhook-operator-webhooktest-admin-role-%s", crdSuffix),
"webhook-operator-webhooktest-editor-role": fmt.Sprintf("webhook-operator-webhooktest-editor-role-%s", crdSuffix),
"webhook-operator-webhooktest-viewer-role": fmt.Sprintf("webhook-operator-webhooktest-viewer-role-%s", crdSuffix),
"webhook-operator-metrics-reader": fmt.Sprintf("webhook-operator-metrics-reader-%s", crdSuffix),
}

_, nsName, catalogName, opName := helpers.NewCatalogAndClusterBundles(ctx, replacements,
singleownindex.AssetNames, singleownindex.Asset,
singleownbundle.AssetNames, singleownbundle.Asset,
)
By(fmt.Sprintf("singleown bundle %q and catalog %q built successfully in namespace %q for %s scenario", opName, catalogName, nsName, sc.label))

By(fmt.Sprintf("ensuring no ClusterExtension for %s before %s scenario", packageName, sc.label))
crdName := fmt.Sprintf("webhooktests-%s.webhook.operators.coreos.io", crdSuffix)
helpers.EnsureCleanupClusterExtension(context.Background(), packageName, crdName)
Expand Down Expand Up @@ -432,6 +433,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace] OLMv1 ope
DeferCleanup(func() {
By(fmt.Sprintf("cleanup: deleting ClusterExtension %s", ce.Name))
_ = k8sClient.Delete(context.Background(), ce, client.PropagationPolicy(metav1.DeletePropagationForeground))
if crdName != "" {
crd := &apiextensionsv1.CustomResourceDefinition{}
if err := k8sClient.Get(context.Background(), client.ObjectKey{Name: crdName}, crd); err == nil {
By(fmt.Sprintf("cleanup: deleting CRD %s", crdName))
_ = k8sClient.Delete(context.Background(), crd)
}
}
})

By(fmt.Sprintf("waiting for the ClusterExtension %s to be installed for %s scenario", ceName, sc.label))
Expand Down Expand Up @@ -459,6 +467,8 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace] OLMv1 ope
g.Expect(found).To(BeTrue(), "failed to find deployment with olm.targetNamespaces annotation")
}).WithTimeout(helpers.DefaultTimeout).WithPolling(helpers.DefaultPolling).Should(Succeed())

// Ginkgo never invokes those deferred cleanups until we exit the whole spec, so the first scenario’s
// cluster resources survive long enough to collide with the second scenario.
By(fmt.Sprintf("cleaning up resources created for %s scenario to allow next scenario", sc.label))
deletePolicy := metav1.DeletePropagationForeground
Expect(k8sClient.Delete(ctx, ce, client.PropagationPolicy(deletePolicy))).To(Succeed(), "failed to delete ClusterExtension %q", ceName)
Expand All @@ -471,6 +481,19 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace] OLMv1 ope
Expect(k8sClient.Delete(ctx, watchNSObj, client.PropagationPolicy(deletePolicy))).To(Succeed(), "failed to delete watch namespace %q", watchNamespace)
}
Expect(k8sClient.Delete(ctx, installNS, client.PropagationPolicy(deletePolicy))).To(Succeed(), "failed to delete install namespace %q", installNamespace)

By(fmt.Sprintf("waiting for namespace %s to be fully deleted before next scenario", installNamespace))
Eventually(func() bool {
err := k8sClient.Get(ctx, client.ObjectKey{Name: installNamespace}, &corev1.Namespace{})
return errors.IsNotFound(err)
}).WithTimeout(helpers.DefaultTimeout).WithPolling(helpers.DefaultPolling).Should(BeTrue(), "expected namespace %s to be deleted", installNamespace)
if watchNSObj != nil {
By(fmt.Sprintf("waiting for namespace %s to be fully deleted before next scenario", watchNamespace))
Eventually(func() bool {
err := k8sClient.Get(ctx, client.ObjectKey{Name: watchNamespace}, &corev1.Namespace{})
return errors.IsNotFound(err)
}).WithTimeout(helpers.DefaultTimeout).WithPolling(helpers.DefaultPolling).Should(BeTrue(), "expected namespace %s to be deleted", watchNamespace)
}
}
})
})
Expand Down