-
Notifications
You must be signed in to change notification settings - Fork 23
test: Add OLMv1 test support #1438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR adds support for both OLM v1 and v2 in the end-to-end upgrade tests by introducing Extension and ExtensionSource abstractions and dedicated installer functions, refactors the upgrade_test to use these new installers with conditional branching on OLM version, cleans up obsolete scheme registrations, and updates related module dependencies. Sequence diagram for conditional OLM installer selection in upgrade testssequenceDiagram
participant TestRunner
participant OLMv1Installer
participant OLMv2Installer
TestRunner->>OLMv1Installer: Install Extension (if OLMv1)
TestRunner->>OLMv2Installer: Install Extension (if OLMv2)
OLMv1Installer-->>TestRunner: Extension installed
OLMv2Installer-->>TestRunner: Extension installed
ER diagram for ExtensionSource and Extension relationshiperDiagram
EXTENSIONSOURCE ||--o| EXTENSION : provides
EXTENSIONSOURCE {
string id
string type
}
EXTENSION {
string name
string version
}
Class diagram for new OLMv1 test support abstractionsclassDiagram
class Extension {
+Install()
+Uninstall()
+Upgrade()
}
class ExtensionSource {
+GetExtension() Extension
}
class OLMv1Extension {
+Install()
+Uninstall()
+Upgrade()
}
class OLMv2Extension {
+Install()
+Uninstall()
+Upgrade()
}
Extension <|.. OLMv1Extension
Extension <|.. OLMv2Extension
ExtensionSource --> Extension
Class diagram for upgrade_test refactor with installer functionsclassDiagram
class UpgradeTest {
+RunUpgradeTest()
-installer
}
class OLMInstaller {
+InstallExtension()
+UninstallExtension()
+UpgradeExtension()
}
UpgradeTest --> OLMInstaller
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Compliance Guide 🔍(Compliance updated until commit 642d86d)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit d1e04dd
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Avoid using a fixed time.Sleep for propagating catalog updates—consider polling a well-defined condition or watching for resource events to reduce test flakiness.
- DeferCleanup currently only deletes the extension and catalog; make sure to also clean up the ServiceAccount and ClusterRoleBinding created by OlmV1Installer to prevent resource leaks.
- There’s duplicated setup logic between OlmInstaller and OlmV1Installer—extract common creation and readiness-checking steps into shared helpers to reduce code duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Avoid using a fixed time.Sleep for propagating catalog updates—consider polling a well-defined condition or watching for resource events to reduce test flakiness.
- DeferCleanup currently only deletes the extension and catalog; make sure to also clean up the ServiceAccount and ClusterRoleBinding created by OlmV1Installer to prevent resource leaks.
- There’s duplicated setup logic between OlmInstaller and OlmV1Installer—extract common creation and readiness-checking steps into shared helpers to reduce code duplication.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||
ed394e5 to
44b578d
Compare
44b578d to
642d86d
Compare
PR Type
Enhancement, Tests
Description
Add OLMv1 support alongside existing OLMv1alpha support
olm_v1.gomodule withOlmV1Installerfor ClusterExtension/ClusterCatalogolm_types.gowith common Extension and ExtensionSource interfacesolm.goto use wrapper types implementing shared interfacesSimplify upgrade test by abstracting OLM installation logic
OLM_V1Update dependencies to support OLMv1 operator-controller
github.com/operator-framework/operator-controller v1.5.1Diagram Walkthrough
File Walkthrough
olm_types.go
Define common OLM extension interfacestest/e2e/support/kubernetes/olm/olm_types.go
Extensioninterface with methods for readiness, versionretrieval, and unwrapping
ExtensionSourceinterface with methods for readiness, imageupdates, and unwrapping
implementations
olm.go
Implement OLMv1alpha installer with interface wrapperstest/e2e/support/kubernetes/olm/olm.go
subscriptionExtensionwrapper for v1alpha1.Subscription withIsReady and GetVersion methods
catalogSourceWrapperfor v1alpha1.CatalogSource with IsReadyand UpdateSourceImage methods
OlmInstallerfunction to set up OLMv1alpha resources(OperatorGroup, CatalogSource, Subscription)
interfaces
olm_v1.go
Implement OLMv1 installer with interface wrapperstest/e2e/support/kubernetes/olm/olm_v1.go
clusterExtensionWrapperfor olmV1.ClusterExtension withreadiness and version checks
clusterCatalogSourcefor olmV1.ClusterCatalog with readinessand image update methods
OlmV1Installerfunction to set up OLMv1 resources(ServiceAccount, ClusterRoleBinding, ClusterCatalog, ClusterExtension)
interfaces
common.go
Remove OLM imports and scheme registrationtest/e2e/support/common.go
CreateClient function
upgrade_test.go
Refactor upgrade test to use OLM installerstest/e2e/upgrade_test.go
OLM_V1environment variable checkinterfaces
findClusterServiceVersionand relatedCSV-specific logic
tracking and readiness checks
strings
go.mod
Add OLMv1 operator-controller dependencygo.mod
github.com/operator-framework/operator-controller v1.5.1for OLMv1support
github.com/onsi/ginkgo/v2from v2.23.4 to v2.25.1github.com/onsi/gomegafrom v1.37.0 to v1.38.2go.sum
Update dependency checksumsgo.sum
cel-go, and related packages
opentelemetry)