This document describes the constraints and pinned dependencies in this project.
Current Version: v0.0.0-20240404200104-96ed2d49b255
Why Pinned: The observability-operator needs to support both OpenShift console API v1 and v1alpha1 for backward compatibility:
- OpenShift >= 4.17 uses
console/v1API - OpenShift < 4.17 uses
console/v1alpha1API
Newer versions of github.com/openshift/api (after April 2024) have removed the console/v1alpha1 API, breaking compatibility with older OpenShift versions.
Impact: The codebase maintains dual API support with runtime version detection to create the appropriate Console Plugin resources.
Files Affected:
pkg/controllers/uiplugin/controller.go- Version detection logicpkg/controllers/uiplugin/components.go- Dual Console Plugin creationpkg/controllers/uiplugin/plugin_info_builder.go- Plugin info structure with LegacyProxiespkg/operator/scheme.go- API scheme registration- All uiplugin package files using
osv1alpha1imports
The following dependencies can be safely updated:
- Kubernetes API packages (
k8s.io/*) - Controller Runtime (
sigs.k8s.io/controller-runtime) - Prometheus packages (
github.com/prometheus/*) - RHOBS Prometheus Operator (
github.com/rhobs/obo-prometheus-operator) - Go standard library extensions (
golang.org/x/*) - Utility libraries (
github.com/go-logr/logr,github.com/google/go-cmp, etc.)
To update dependencies safely:
-
Individual updates: Update specific packages excluding openshift/api:
go get -u k8s.io/api k8s.io/apimachinery k8s.io/client-go go get -u sigs.k8s.io/controller-runtime go get -u github.com/rhobs/obo-prometheus-operator@v0.83.0-rhobs1
-
Avoid bulk updates: Don't use
go get -u ./...as it will try to update openshift/api -
Always test: Run
make test-unitandmake buildafter each update -
Fix go.sum: Run
go mod tidyafter updates to fix missing entries
When OpenShift < 4.17 support is no longer needed:
- Remove
console/v1alpha1API usage - Unpin
github.com/openshift/api - Remove dual API support code
- Update this document