diff --git a/PROJECT b/PROJECT
index 50ac542dc..a307347a4 100644
--- a/PROJECT
+++ b/PROJECT
@@ -11,8 +11,8 @@ resources:
domain: operatorframework.io
group: olm
kind: ClusterExtension
- path: github.com/operator-framework/operator-controller/api/v1alpha1
- version: v1alpha1
+ path: github.com/operator-framework/operator-controller/api/v1
+ version: v1
- api:
crdVersion: v1
namespaced: true
@@ -20,6 +20,6 @@ resources:
domain: operatorframework.io
group: olm
kind: Extension
- path: github.com/operator-framework/operator-controller/api/v1alpha1
- version: v1alpha1
+ path: github.com/operator-framework/operator-controller/api/v1
+ version: v1
version: "3"
diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1/clusterextension_types.go
similarity index 99%
rename from api/v1alpha1/clusterextension_types.go
rename to api/v1/clusterextension_types.go
index 8ccdb66c5..696966c5a 100644
--- a/api/v1alpha1/clusterextension_types.go
+++ b/api/v1/clusterextension_types.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/api/v1alpha1/clusterextension_types_test.go b/api/v1/clusterextension_types_test.go
similarity index 99%
rename from api/v1alpha1/clusterextension_types_test.go
rename to api/v1/clusterextension_types_test.go
index 0ed4f1a08..297a15b13 100644
--- a/api/v1alpha1/clusterextension_types_test.go
+++ b/api/v1/clusterextension_types_test.go
@@ -1,4 +1,4 @@
-package v1alpha1_test
+package v1_test
import (
"fmt"
diff --git a/api/v1alpha1/groupversion_info.go b/api/v1/groupversion_info.go
similarity index 96%
rename from api/v1alpha1/groupversion_info.go
rename to api/v1/groupversion_info.go
index f46abbf3d..fdd9174ac 100644
--- a/api/v1alpha1/groupversion_info.go
+++ b/api/v1/groupversion_info.go
@@ -17,7 +17,7 @@ limitations under the License.
// Package v1alpha1 contains API Schema definitions for the olm v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=olm.operatorframework.io
-package v1alpha1
+package v1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,7 +26,7 @@ import (
var (
// GroupVersion is group version used to register these objects
- GroupVersion = schema.GroupVersion{Group: "olm.operatorframework.io", Version: "v1alpha1"}
+ GroupVersion = schema.GroupVersion{Group: "olm.operatorframework.io", Version: "v1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go
similarity index 98%
rename from api/v1alpha1/zz_generated.deepcopy.go
rename to api/v1/zz_generated.deepcopy.go
index e3b9b0336..622bd2b83 100644
--- a/api/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1/zz_generated.deepcopy.go
@@ -18,10 +18,10 @@ limitations under the License.
// Code generated by controller-gen. DO NOT EDIT.
-package v1alpha1
+package v1
import (
- "k8s.io/apimachinery/pkg/apis/meta/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -65,7 +65,7 @@ func (in *CatalogSource) DeepCopyInto(out *CatalogSource) {
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
- *out = new(v1.LabelSelector)
+ *out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
}
@@ -202,7 +202,7 @@ func (in *ClusterExtensionStatus) DeepCopyInto(out *ClusterExtensionStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
- *out = make([]v1.Condition, len(*in))
+ *out = make([]metav1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
diff --git a/cmd/manager/main.go b/cmd/manager/main.go
index 2efadb2a0..563e51479 100644
--- a/cmd/manager/main.go
+++ b/cmd/manager/main.go
@@ -49,7 +49,7 @@ import (
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/action"
"github.com/operator-framework/operator-controller/internal/applier"
"github.com/operator-framework/operator-controller/internal/authentication"
@@ -141,8 +141,8 @@ func main() {
setupLog.Info("set up manager")
cacheOptions := crcache.Options{
ByObject: map[client.Object]crcache.ByObject{
- &ocv1alpha1.ClusterExtension{}: {Label: k8slabels.Everything()},
- &catalogd.ClusterCatalog{}: {Label: k8slabels.Everything()},
+ &ocv1.ClusterExtension{}: {Label: k8slabels.Everything()},
+ &catalogd.ClusterCatalog{}: {Label: k8slabels.Everything()},
},
DefaultNamespaces: map[string]crcache.Config{
systemNamespace: {LabelSelector: k8slabels.Everything()},
@@ -196,7 +196,7 @@ func main() {
cfgGetter, err := helmclient.NewActionConfigGetter(mgr.GetConfig(), mgr.GetRESTMapper(),
helmclient.StorageDriverMapper(action.ChunkedStorageDriverMapper(coreClient, mgr.GetAPIReader(), systemNamespace)),
helmclient.ClientNamespaceMapper(func(obj client.Object) (string, error) {
- ext := obj.(*ocv1alpha1.ClusterExtension)
+ ext := obj.(*ocv1.ClusterExtension)
return ext.Spec.Namespace, nil
}),
helmclient.ClientRestConfigMapper(clientRestConfigMapper),
@@ -291,7 +291,7 @@ func main() {
cm := contentmanager.NewManager(clientRestConfigMapper, mgr.GetConfig(), mgr.GetRESTMapper())
err = clusterExtensionFinalizers.Register(controllers.ClusterExtensionCleanupContentManagerCacheFinalizer, finalizers.FinalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
- ext := obj.(*ocv1alpha1.ClusterExtension)
+ ext := obj.(*ocv1.ClusterExtension)
err := cm.Delete(ext)
return crfinalizer.Result{}, err
}))
diff --git a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
index ef946c56a..a908b256d 100644
--- a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
+++ b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
@@ -30,7 +30,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- name: v1alpha1
+ name: v1
schema:
openAPIV3Schema:
description: ClusterExtension is the Schema for the clusterextensions API
diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml
index bd1783176..7816e8fef 100644
--- a/config/samples/kustomization.yaml
+++ b/config/samples/kustomization.yaml
@@ -1,5 +1,5 @@
## Append samples of your project ##
resources:
-- olm_v1alpha1_clusterextension.yaml
+- olm_v1_clusterextension.yaml
- olm_v1alpha1_extension.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
diff --git a/config/samples/olm_v1alpha1_clusterextension.yaml b/config/samples/olm_v1_clusterextension.yaml
similarity index 99%
rename from config/samples/olm_v1alpha1_clusterextension.yaml
rename to config/samples/olm_v1_clusterextension.yaml
index f9bc5ff10..80aa801ae 100644
--- a/config/samples/olm_v1alpha1_clusterextension.yaml
+++ b/config/samples/olm_v1_clusterextension.yaml
@@ -267,7 +267,7 @@ subjects:
name: argocd-installer
namespace: argocd
---
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
diff --git a/docs/api-reference/operator-controller-api-reference.md b/docs/api-reference/operator-controller-api-reference.md
index 8977d3a3a..63ea96df6 100644
--- a/docs/api-reference/operator-controller-api-reference.md
+++ b/docs/api-reference/operator-controller-api-reference.md
@@ -1,10 +1,10 @@
# API Reference
## Packages
-- [olm.operatorframework.io/v1alpha1](#olmoperatorframeworkiov1alpha1)
+- [olm.operatorframework.io/v1](#olmoperatorframeworkiov1)
-## olm.operatorframework.io/v1alpha1
+## olm.operatorframework.io/v1
Package v1alpha1 contains API Schema definitions for the olm v1alpha1 API group
@@ -97,7 +97,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `apiVersion` _string_ | `olm.operatorframework.io/v1alpha1` | | |
+| `apiVersion` _string_ | `olm.operatorframework.io/v1` | | |
| `kind` _string_ | `ClusterExtension` | | |
| `kind` _string_ | Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
@@ -151,7 +151,7 @@ ClusterExtensionList contains a list of ClusterExtension
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `apiVersion` _string_ | `olm.operatorframework.io/v1alpha1` | | |
+| `apiVersion` _string_ | `olm.operatorframework.io/v1` | | |
| `kind` _string_ | `ClusterExtensionList` | | |
| `kind` _string_ | Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
diff --git a/docs/concepts/controlling-catalog-selection.md b/docs/concepts/controlling-catalog-selection.md
index 13b782d0f..ec987e556 100644
--- a/docs/concepts/controlling-catalog-selection.md
+++ b/docs/concepts/controlling-catalog-selection.md
@@ -18,7 +18,7 @@ To select a specific catalog by name, you can use the `matchLabels` field in you
#### Example
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: my-extension
@@ -39,7 +39,7 @@ If you have catalogs labeled with specific metadata, you can select them using `
#### Using `matchLabels`
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: my-extension
@@ -56,7 +56,7 @@ This selects catalogs labeled with `example.com/support: "true"`.
#### Using `matchExpressions`
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: my-extension
@@ -81,7 +81,7 @@ You can exclude catalogs by using the `NotIn` or `DoesNotExist` operators in `ma
#### Example: Exclude Specific Catalogs
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: my-extension
@@ -101,7 +101,7 @@ This excludes the catalog named `unwanted-catalog` from consideration.
#### Example: Exclude Catalogs with a Specific Label
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: my-extension
@@ -194,7 +194,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera
2. **Create a `ClusterExtension` with Catalog Selection**
```yaml
- apiVersion: olm.operatorframework.io/v1alpha1
+ apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: install-my-operator
diff --git a/docs/concepts/crd-upgrade-safety.md b/docs/concepts/crd-upgrade-safety.md
index 47ad18d7b..339315472 100644
--- a/docs/concepts/crd-upgrade-safety.md
+++ b/docs/concepts/crd-upgrade-safety.md
@@ -56,7 +56,7 @@ The CRD Upgrade Safety preflight check can be entirely disabled by adding the
`preflight.crdUpgradeSafety.disabled` field with a value of "true" to the ClusterExtension of the CRD.
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: clusterextension-sample
diff --git a/docs/concepts/upgrade-support.md b/docs/concepts/upgrade-support.md
index 9bc6e31ad..5abd579f1 100644
--- a/docs/concepts/upgrade-support.md
+++ b/docs/concepts/upgrade-support.md
@@ -38,7 +38,7 @@ If `1.0.0` is installed, OLM v1 behavior differs in the following ways:
You can change the default behavior of the upgrade constraints by setting the `upgradeConstraintPolicy` parameter in your cluster extension's custom resource (CR).
``` yaml hl_lines="10"
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name:
@@ -86,7 +86,7 @@ If you set the field to `SelfCertified`, no upgrade constraints are set on the p
Example `ClusterExtension` with `.spec.upgradeConstraintPolicy` field set to `SelfCertified`:
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: extension-sample
diff --git a/docs/howto/how-to-channel-based-upgrades.md b/docs/howto/how-to-channel-based-upgrades.md
index 501a7f951..e7638d1a1 100644
--- a/docs/howto/how-to-channel-based-upgrades.md
+++ b/docs/howto/how-to-channel-based-upgrades.md
@@ -5,7 +5,7 @@ A "channel" is a package author defined stream of updates for an extension. A se
Example:
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
@@ -27,7 +27,7 @@ Note that the `version` field also accepts a version range to further restrict t
Example:
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
diff --git a/docs/howto/how-to-pin-version.md b/docs/howto/how-to-pin-version.md
index 606b994aa..5dc0660b0 100644
--- a/docs/howto/how-to-pin-version.md
+++ b/docs/howto/how-to-pin-version.md
@@ -5,7 +5,7 @@ To disable automatic updates, and pin the version of an extension, set `version`
Example:
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
diff --git a/docs/howto/how-to-version-range-upgrades.md b/docs/howto/how-to-version-range-upgrades.md
index ddb753fba..dc239fa39 100644
--- a/docs/howto/how-to-version-range-upgrades.md
+++ b/docs/howto/how-to-version-range-upgrades.md
@@ -5,7 +5,7 @@ Set the version for the desired package in the Catalog source to a comparison st
Example:
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
diff --git a/docs/howto/how-to-z-stream-upgrades.md b/docs/howto/how-to-z-stream-upgrades.md
index 8666e09b7..1a638fd1b 100644
--- a/docs/howto/how-to-z-stream-upgrades.md
+++ b/docs/howto/how-to-z-stream-upgrades.md
@@ -5,7 +5,7 @@ To restrict automatic updates to only z-stream patches and avoid breaking change
Example:
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
diff --git a/docs/tutorials/downgrade-extension.md b/docs/tutorials/downgrade-extension.md
index 0e57d4687..e400600fa 100644
--- a/docs/tutorials/downgrade-extension.md
+++ b/docs/tutorials/downgrade-extension.md
@@ -31,7 +31,7 @@ Add the `crdUpgradeSafety` field and set its `policy` to `Disabled` in the `Clus
**Example:**
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: example-extension
@@ -71,7 +71,7 @@ Set the `upgradeConstraintPolicy` to `SelfCertified` in the `ClusterExtension` r
**Example:**
```yaml
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: example-extension
@@ -113,7 +113,7 @@ Once the CRD safety checks are disabled and upgrade constraints are set, you can
Within the YAML editor, update the `spec` section as follows:
```yaml
- apiVersion: olm.operatorframework.io/v1alpha1
+ apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name:
diff --git a/docs/tutorials/install-extension.md b/docs/tutorials/install-extension.md
index 95bdb5c3a..92b7aadeb 100644
--- a/docs/tutorials/install-extension.md
+++ b/docs/tutorials/install-extension.md
@@ -34,7 +34,7 @@ For information on determining the ServiceAccount's permission, please see [Deri
1. Create a CR for the Kubernetes extension you want to install:
``` yaml title="Example CR"
- apiVersion: olm.operatorframework.io/v1alpha1
+ apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name:
@@ -107,7 +107,7 @@ For information on determining the ServiceAccount's permission, please see [Deri
Namespace:
Labels:
Annotations:
- API Version: olm.operatorframework.io/v1alpha1
+ API Version: olm.operatorframework.io/v1
Kind: ClusterExtension
Metadata:
Creation Timestamp: 2024-10-03T16:02:40Z
diff --git a/docs/tutorials/upgrade-extension.md b/docs/tutorials/upgrade-extension.md
index ea0a20344..1c0e8b061 100644
--- a/docs/tutorials/upgrade-extension.md
+++ b/docs/tutorials/upgrade-extension.md
@@ -23,7 +23,7 @@ For more detailed information see [Upgrade Support](../concepts/upgrade-support.
Suppose we have successfully created and installed v0.5.0 of the ArgoCD operator with the following `ClusterExtension`:
``` yaml title="Example CR"
-apiVersion: olm.operatorframework.io/v1alpha1
+apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: argocd
@@ -43,7 +43,7 @@ spec:
``` terminal
kubectl apply -f - < 0 {
- status, reason, message = metav1.ConditionTrue, ocv1alpha1.ReasonDeprecated, strings.Join(deprecationMessages, ";")
+ status, reason, message = metav1.ConditionTrue, ocv1.ReasonDeprecated, strings.Join(deprecationMessages, ";")
}
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
- Type: ocv1alpha1.TypeDeprecated,
+ Type: ocv1.TypeDeprecated,
Reason: reason,
Status: status,
Message: message,
@@ -383,14 +383,14 @@ func SetDeprecationStatus(ext *ocv1alpha1.ClusterExtension, bundleName string, d
// finally, set the individual deprecation conditions for package, channel, and bundle
for _, conditionType := range []string{
- ocv1alpha1.TypePackageDeprecated,
- ocv1alpha1.TypeChannelDeprecated,
- ocv1alpha1.TypeBundleDeprecated,
+ ocv1.TypePackageDeprecated,
+ ocv1.TypeChannelDeprecated,
+ ocv1.TypeBundleDeprecated,
} {
entries, ok := deprecations[conditionType]
- status, reason, message := metav1.ConditionFalse, ocv1alpha1.ReasonDeprecated, ""
+ status, reason, message := metav1.ConditionFalse, ocv1.ReasonDeprecated, ""
if ok {
- status, reason = metav1.ConditionTrue, ocv1alpha1.ReasonDeprecated
+ status, reason = metav1.ConditionTrue, ocv1.ReasonDeprecated
for _, entry := range entries {
message = fmt.Sprintf("%s\n%s", message, entry.Message)
}
@@ -408,7 +408,7 @@ func SetDeprecationStatus(ext *ocv1alpha1.ClusterExtension, bundleName string, d
// SetupWithManager sets up the controller with the Manager.
func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager) error {
controller, err := ctrl.NewControllerManagedBy(mgr).
- For(&ocv1alpha1.ClusterExtension{}).
+ For(&ocv1.ClusterExtension{}).
Watches(&catalogd.ClusterCatalog{},
crhandler.EnqueueRequestsFromMapFunc(clusterExtensionRequestsForCatalog(mgr.GetClient(), mgr.GetLogger())),
builder.WithPredicates(predicate.Funcs{
@@ -438,7 +438,7 @@ func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager) error {
return nil
}
-func wrapErrorWithResolutionInfo(resolved ocv1alpha1.BundleMetadata, err error) error {
+func wrapErrorWithResolutionInfo(resolved ocv1.BundleMetadata, err error) error {
return fmt.Errorf("%w for resolved bundle %q with version %q", err, resolved.Name, resolved.Version)
}
@@ -447,7 +447,7 @@ func clusterExtensionRequestsForCatalog(c client.Reader, logger logr.Logger) crh
return func(ctx context.Context, _ client.Object) []reconcile.Request {
// no way of associating an extension to a catalog so create reconcile requests for everything
clusterExtensions := metav1.PartialObjectMetadataList{}
- clusterExtensions.SetGroupVersionKind(ocv1alpha1.GroupVersion.WithKind("ClusterExtensionList"))
+ clusterExtensions.SetGroupVersionKind(ocv1.GroupVersion.WithKind("ClusterExtensionList"))
err := c.List(ctx, &clusterExtensions)
if err != nil {
logger.Error(err, "unable to enqueue cluster extensions for catalog reconcile")
@@ -471,11 +471,11 @@ type DefaultInstalledBundleGetter struct {
}
type InstalledBundle struct {
- ocv1alpha1.BundleMetadata
+ ocv1.BundleMetadata
Image string
}
-func (d *DefaultInstalledBundleGetter) GetInstalledBundle(ctx context.Context, ext *ocv1alpha1.ClusterExtension) (*InstalledBundle, error) {
+func (d *DefaultInstalledBundleGetter) GetInstalledBundle(ctx context.Context, ext *ocv1.ClusterExtension) (*InstalledBundle, error) {
cl, err := d.ActionClientFor(ctx, ext)
if err != nil {
return nil, err
@@ -494,7 +494,7 @@ func (d *DefaultInstalledBundleGetter) GetInstalledBundle(ctx context.Context, e
for _, rel := range relhis {
if rel.Info != nil && rel.Info.Status == release.StatusDeployed {
return &InstalledBundle{
- BundleMetadata: ocv1alpha1.BundleMetadata{
+ BundleMetadata: ocv1.BundleMetadata{
Name: rel.Labels[labels.BundleNameKey],
Version: rel.Labels[labels.BundleVersionKey],
},
diff --git a/internal/controllers/clusterextension_controller_test.go b/internal/controllers/clusterextension_controller_test.go
index 448327944..ab4dc5e18 100644
--- a/internal/controllers/clusterextension_controller_test.go
+++ b/internal/controllers/clusterextension_controller_test.go
@@ -27,7 +27,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
"github.com/operator-framework/operator-registry/alpha/declcfg"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/conditionsets"
"github.com/operator-framework/operator-controller/internal/controllers"
"github.com/operator-framework/operator-controller/internal/finalizers"
@@ -50,7 +50,7 @@ func TestClusterExtensionDoesNotExist(t *testing.T) {
func TestClusterExtensionResolutionFails(t *testing.T) {
pkgName := fmt.Sprintf("non-existent-%s", rand.String(6))
cl, reconciler := newClientAndReconciler(t)
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
return nil, nil, nil, fmt.Errorf("no package %q found", pkgName)
})
ctx := context.Background()
@@ -58,17 +58,17 @@ func TestClusterExtensionResolutionFails(t *testing.T) {
t.Log("When the cluster extension specifies a non-existent package")
t.Log("By initializing cluster state")
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
},
},
Namespace: "default",
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: "default",
},
},
@@ -88,14 +88,14 @@ func TestClusterExtensionResolutionFails(t *testing.T) {
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected conditions")
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, cond)
require.Equal(t, metav1.ConditionTrue, cond.Status)
- require.Equal(t, ocv1alpha1.ReasonRetrying, cond.Reason)
+ require.Equal(t, ocv1.ReasonRetrying, cond.Reason)
require.Equal(t, fmt.Sprintf("no package %q found", pkgName), cond.Message)
verifyInvariants(ctx, t, reconciler.Client, clusterExtension)
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionResolutionSuccessfulUnpackFails(t *testing.T) {
@@ -132,19 +132,19 @@ func TestClusterExtensionResolutionSuccessfulUnpackFails(t *testing.T) {
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -154,7 +154,7 @@ func TestClusterExtensionResolutionSuccessfulUnpackFails(t *testing.T) {
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -174,23 +174,23 @@ func TestClusterExtensionResolutionSuccessfulUnpackFails(t *testing.T) {
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
t.Log("By checking the status fields")
- expectedBundleMetadata := ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
+ expectedBundleMetadata := ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected conditions")
expectStatus := metav1.ConditionTrue
- expectReason := ocv1alpha1.ReasonRetrying
+ expectReason := ocv1.ReasonRetrying
if tc.expectTerminal {
expectStatus = metav1.ConditionFalse
- expectReason = ocv1alpha1.ReasonBlocked
+ expectReason = ocv1.ReasonBlocked
}
- progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond)
require.Equal(t, expectStatus, progressingCond.Status)
require.Equal(t, expectReason, progressingCond.Reason)
require.Contains(t, progressingCond.Message, fmt.Sprintf("for resolved bundle %q with version %q", expectedBundleMetadata.Name, expectedBundleMetadata.Version))
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
})
}
}
@@ -214,19 +214,19 @@ func TestClusterExtensionUnpackUnexpectedState(t *testing.T) {
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -236,7 +236,7 @@ func TestClusterExtensionUnpackUnexpectedState(t *testing.T) {
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -249,7 +249,7 @@ func TestClusterExtensionUnpackUnexpectedState(t *testing.T) {
_, _ = reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: extKey})
}, "reconciliation should panic on unknown unpack state")
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionResolutionAndUnpackSuccessfulApplierFails(t *testing.T) {
@@ -272,19 +272,19 @@ func TestClusterExtensionResolutionAndUnpackSuccessfulApplierFails(t *testing.T)
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -294,7 +294,7 @@ func TestClusterExtensionResolutionAndUnpackSuccessfulApplierFails(t *testing.T)
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -313,23 +313,23 @@ func TestClusterExtensionResolutionAndUnpackSuccessfulApplierFails(t *testing.T)
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
t.Log("By checking the status fields")
- expectedBundleMetadata := ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
+ expectedBundleMetadata := ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected installed conditions")
- installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
require.NotNil(t, installedCond)
require.Equal(t, metav1.ConditionFalse, installedCond.Status)
- require.Equal(t, ocv1alpha1.ReasonFailed, installedCond.Reason)
+ require.Equal(t, ocv1.ReasonFailed, installedCond.Reason)
t.Log("By checking the expected progressing conditions")
- progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond)
require.Equal(t, metav1.ConditionTrue, progressingCond.Status)
- require.Equal(t, ocv1alpha1.ReasonRetrying, progressingCond.Reason)
+ require.Equal(t, ocv1.ReasonRetrying, progressingCond.Reason)
require.Contains(t, progressingCond.Message, fmt.Sprintf("for resolved bundle %q with version %q", expectedBundleMetadata.Name, expectedBundleMetadata.Version))
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionApplierFailsWithBundleInstalled(t *testing.T) {
@@ -352,19 +352,19 @@ func TestClusterExtensionApplierFailsWithBundleInstalled(t *testing.T) {
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -374,7 +374,7 @@ func TestClusterExtensionApplierFailsWithBundleInstalled(t *testing.T) {
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -388,7 +388,7 @@ func TestClusterExtensionApplierFailsWithBundleInstalled(t *testing.T) {
}
reconciler.InstalledBundleGetter = &MockInstalledBundleGetter{
bundle: &controllers.InstalledBundle{
- BundleMetadata: ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"},
+ BundleMetadata: ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"},
Image: "quay.io/operatorhubio/prometheus@fake1.0.0",
},
}
@@ -412,23 +412,23 @@ func TestClusterExtensionApplierFailsWithBundleInstalled(t *testing.T) {
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
t.Log("By checking the status fields")
- expectedBundleMetadata := ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
+ expectedBundleMetadata := ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
require.Equal(t, expectedBundleMetadata, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected installed conditions")
- installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
require.NotNil(t, installedCond)
require.Equal(t, metav1.ConditionTrue, installedCond.Status)
- require.Equal(t, ocv1alpha1.ReasonSucceeded, installedCond.Reason)
+ require.Equal(t, ocv1.ReasonSucceeded, installedCond.Reason)
t.Log("By checking the expected progressing conditions")
- progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond)
require.Equal(t, metav1.ConditionTrue, progressingCond.Status)
- require.Equal(t, ocv1alpha1.ReasonRetrying, progressingCond.Reason)
+ require.Equal(t, ocv1.ReasonRetrying, progressingCond.Reason)
require.Contains(t, progressingCond.Message, fmt.Sprintf("for resolved bundle %q with version %q", expectedBundleMetadata.Name, expectedBundleMetadata.Version))
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionManagerFailed(t *testing.T) {
@@ -451,19 +451,19 @@ func TestClusterExtensionManagerFailed(t *testing.T) {
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -473,7 +473,7 @@ func TestClusterExtensionManagerFailed(t *testing.T) {
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -495,21 +495,21 @@ func TestClusterExtensionManagerFailed(t *testing.T) {
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
t.Log("By checking the status fields")
- require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
+ require.Equal(t, ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected installed conditions")
- installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
require.NotNil(t, installedCond)
require.Equal(t, metav1.ConditionTrue, installedCond.Status)
- require.Equal(t, ocv1alpha1.ReasonSucceeded, installedCond.Reason)
+ require.Equal(t, ocv1.ReasonSucceeded, installedCond.Reason)
t.Log("By checking the expected progressing conditions")
- progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond)
require.Equal(t, metav1.ConditionTrue, progressingCond.Status)
- require.Equal(t, ocv1alpha1.ReasonRetrying, progressingCond.Reason)
+ require.Equal(t, ocv1.ReasonRetrying, progressingCond.Reason)
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) {
@@ -532,20 +532,20 @@ func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) {
installNamespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
- SourceType: ocv1alpha1.SourceTypeCatalog,
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
+ SourceType: ocv1.SourceTypeCatalog,
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: installNamespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -555,7 +555,7 @@ func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) {
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -579,21 +579,21 @@ func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) {
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
t.Log("By checking the status fields")
- require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
+ require.Equal(t, ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected installed conditions")
- installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
require.NotNil(t, installedCond)
require.Equal(t, metav1.ConditionTrue, installedCond.Status)
- require.Equal(t, ocv1alpha1.ReasonSucceeded, installedCond.Reason)
+ require.Equal(t, ocv1.ReasonSucceeded, installedCond.Reason)
t.Log("By checking the expected progressing conditions")
- progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond)
require.Equal(t, metav1.ConditionTrue, progressingCond.Status)
- require.Equal(t, ocv1alpha1.ReasonRetrying, progressingCond.Reason)
+ require.Equal(t, ocv1.ReasonRetrying, progressingCond.Reason)
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionInstallationSucceeds(t *testing.T) {
@@ -616,19 +616,19 @@ func TestClusterExtensionInstallationSucceeds(t *testing.T) {
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -638,7 +638,7 @@ func TestClusterExtensionInstallationSucceeds(t *testing.T) {
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -660,21 +660,21 @@ func TestClusterExtensionInstallationSucceeds(t *testing.T) {
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
t.Log("By checking the status fields")
- require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
+ require.Equal(t, ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected installed conditions")
- installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ installedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
require.NotNil(t, installedCond)
require.Equal(t, metav1.ConditionTrue, installedCond.Status)
- require.Equal(t, ocv1alpha1.ReasonSucceeded, installedCond.Reason)
+ require.Equal(t, ocv1.ReasonSucceeded, installedCond.Reason)
t.Log("By checking the expected progressing conditions")
- progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond)
require.Equal(t, metav1.ConditionTrue, progressingCond.Status)
- require.Equal(t, ocv1alpha1.ReasonSucceeded, progressingCond.Reason)
+ require.Equal(t, ocv1.ReasonSucceeded, progressingCond.Reason)
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
}
func TestClusterExtensionDeleteFinalizerFails(t *testing.T) {
@@ -697,19 +697,19 @@ func TestClusterExtensionDeleteFinalizerFails(t *testing.T) {
namespace := fmt.Sprintf("test-ns-%s", rand.String(8))
serviceAccount := fmt.Sprintf("test-sa-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{Name: extKey.Name},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkgName,
Version: pkgVer,
Channels: []string{pkgChan},
},
},
Namespace: namespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: serviceAccount,
},
},
@@ -718,7 +718,7 @@ func TestClusterExtensionDeleteFinalizerFails(t *testing.T) {
require.NoError(t, err)
t.Log("It sets resolution success status")
t.Log("By running reconcile")
- reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1alpha1.ClusterExtension, _ *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+ reconciler.Resolver = resolve.Func(func(_ context.Context, _ *ocv1.ClusterExtension, _ *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
v := bsemver.MustParse("1.0.0")
return &declcfg.Bundle{
Name: "prometheus.v1.0.0",
@@ -736,7 +736,7 @@ func TestClusterExtensionDeleteFinalizerFails(t *testing.T) {
}
reconciler.InstalledBundleGetter = &MockInstalledBundleGetter{
bundle: &controllers.InstalledBundle{
- BundleMetadata: ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"},
+ BundleMetadata: ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"},
Image: "quay.io/operatorhubio/prometheus@fake1.0.0",
},
}
@@ -756,37 +756,37 @@ func TestClusterExtensionDeleteFinalizerFails(t *testing.T) {
t.Log("By fetching updated cluster extension after first reconcile")
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
- expectedBundleMetadata := ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
+ expectedBundleMetadata := ocv1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}
require.Equal(t, expectedBundleMetadata, clusterExtension.Status.Install.Bundle)
require.NotNil(t, cond)
require.Equal(t, metav1.ConditionTrue, cond.Status)
- require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
+ require.NoError(t, cl.DeleteAllOf(ctx, &ocv1.ClusterExtension{}))
res, err = reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: extKey})
require.Error(t, err, res)
t.Log("By fetching updated cluster extension after second reconcile")
require.NoError(t, cl.Get(ctx, extKey, clusterExtension))
- cond = apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond = apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
require.Equal(t, expectedBundleMetadata, clusterExtension.Status.Install.Bundle)
require.NotNil(t, cond)
require.Equal(t, metav1.ConditionTrue, cond.Status)
require.Equal(t, fakeFinalizer, clusterExtension.Finalizers[0])
- cond = apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond = apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, cond)
require.Equal(t, metav1.ConditionTrue, cond.Status)
require.Contains(t, cond.Message, finalizersMessage)
}
-func verifyInvariants(ctx context.Context, t *testing.T, c client.Client, ext *ocv1alpha1.ClusterExtension) {
+func verifyInvariants(ctx context.Context, t *testing.T, c client.Client, ext *ocv1.ClusterExtension) {
key := client.ObjectKeyFromObject(ext)
require.NoError(t, c.Get(ctx, key, ext))
verifyConditionsInvariants(t, ext)
}
-func verifyConditionsInvariants(t *testing.T, ext *ocv1alpha1.ClusterExtension) {
+func verifyConditionsInvariants(t *testing.T, ext *ocv1.ClusterExtension) {
// Expect that the cluster extension's set of conditions contains all defined
// condition types for the ClusterExtension API. Every reconcile should always
// ensure every condition type's status/reason/message reflects the state
@@ -804,48 +804,48 @@ func verifyConditionsInvariants(t *testing.T, ext *ocv1alpha1.ClusterExtension)
func TestSetDeprecationStatus(t *testing.T) {
for _, tc := range []struct {
name string
- clusterExtension *ocv1alpha1.ClusterExtension
- expectedClusterExtension *ocv1alpha1.ClusterExtension
+ clusterExtension *ocv1.ClusterExtension
+ expectedClusterExtension *ocv1.ClusterExtension
bundle *declcfg.Bundle
deprecation *declcfg.Deprecation
}{
{
name: "no deprecations, all deprecation statuses set to False",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
@@ -857,53 +857,53 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated channel, but no channel specified, all deprecation statuses set to False",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{},
+ Catalog: &ocv1.CatalogSource{},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{},
+ Catalog: &ocv1.CatalogSource{},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
@@ -922,57 +922,57 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated channel, but a non-deprecated channel specified, all deprecation statuses set to False",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"nondeprecated"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"nondeprecated"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
@@ -993,57 +993,57 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated channel specified, ChannelDeprecated and Deprecated status set to true, others set to false",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
@@ -1065,57 +1065,57 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated package and channel specified, deprecated bundle, all deprecation statuses set to true",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
@@ -1150,57 +1150,57 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated channel specified, deprecated bundle, all deprecation statuses set to true, all deprecation statuses set to true except PackageDeprecated",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
@@ -1229,57 +1229,57 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated package and channel specified, all deprecation statuses set to true except BundleDeprecated",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
@@ -1307,57 +1307,57 @@ func TestSetDeprecationStatus(t *testing.T) {
},
{
name: "deprecated channels specified, ChannelDeprecated and Deprecated status set to true, others set to false",
- clusterExtension: &ocv1alpha1.ClusterExtension{
+ clusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel", "anotherbadchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{},
},
},
- expectedClusterExtension: &ocv1alpha1.ClusterExtension{
+ expectedClusterExtension: &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Generation: 1,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
Channels: []string{"badchannel", "anotherbadchannel"},
},
},
},
- Status: ocv1alpha1.ClusterExtensionStatus{
+ Status: ocv1.ClusterExtensionStatus{
Conditions: []metav1.Condition{
{
- Type: ocv1alpha1.TypeDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypePackageDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypePackageDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeChannelDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeChannelDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
},
{
- Type: ocv1alpha1.TypeBundleDeprecated,
- Reason: ocv1alpha1.ReasonDeprecated,
+ Type: ocv1.TypeBundleDeprecated,
+ Reason: ocv1.ReasonDeprecated,
Status: metav1.ConditionFalse,
ObservedGeneration: 1,
},
@@ -1434,7 +1434,7 @@ func (mag *MockActionGetter) Reconcile(rel *release.Release) error {
func TestGetInstalledBundleHistory(t *testing.T) {
getter := controllers.DefaultInstalledBundleGetter{}
- ext := ocv1alpha1.ClusterExtension{
+ ext := ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: "test-ext",
},
@@ -1473,7 +1473,7 @@ func TestGetInstalledBundleHistory(t *testing.T) {
},
nil,
&controllers.InstalledBundle{
- BundleMetadata: ocv1alpha1.BundleMetadata{
+ BundleMetadata: ocv1.BundleMetadata{
Name: "test-ext",
Version: "1.0",
},
@@ -1508,7 +1508,7 @@ func TestGetInstalledBundleHistory(t *testing.T) {
},
nil,
&controllers.InstalledBundle{
- BundleMetadata: ocv1alpha1.BundleMetadata{
+ BundleMetadata: ocv1.BundleMetadata{
Name: "test-ext",
Version: "1.0",
},
diff --git a/internal/controllers/common_controller.go b/internal/controllers/common_controller.go
index 1da2d8a13..7cee10c10 100644
--- a/internal/controllers/common_controller.go
+++ b/internal/controllers/common_controller.go
@@ -24,11 +24,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
// setInstalledStatusFromBundle sets the installed status based on the given installedBundle.
-func setInstalledStatusFromBundle(ext *ocv1alpha1.ClusterExtension, installedBundle *InstalledBundle) {
+func setInstalledStatusFromBundle(ext *ocv1.ClusterExtension, installedBundle *InstalledBundle) {
// Nothing is installed
if installedBundle == nil {
setInstallStatus(ext, nil)
@@ -36,7 +36,7 @@ func setInstalledStatusFromBundle(ext *ocv1alpha1.ClusterExtension, installedBun
return
}
// Something is installed
- installStatus := &ocv1alpha1.ClusterExtensionInstallStatus{
+ installStatus := &ocv1.ClusterExtensionInstallStatus{
Bundle: installedBundle.BundleMetadata,
}
setInstallStatus(ext, installStatus)
@@ -44,59 +44,59 @@ func setInstalledStatusFromBundle(ext *ocv1alpha1.ClusterExtension, installedBun
}
// setInstalledStatusConditionSuccess sets the installed status condition to success.
-func setInstalledStatusConditionSuccess(ext *ocv1alpha1.ClusterExtension, message string) {
+func setInstalledStatusConditionSuccess(ext *ocv1.ClusterExtension, message string) {
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
- Type: ocv1alpha1.TypeInstalled,
+ Type: ocv1.TypeInstalled,
Status: metav1.ConditionTrue,
- Reason: ocv1alpha1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
Message: message,
ObservedGeneration: ext.GetGeneration(),
})
}
// setInstalledStatusConditionFailed sets the installed status condition to failed.
-func setInstalledStatusConditionFailed(ext *ocv1alpha1.ClusterExtension, message string) {
+func setInstalledStatusConditionFailed(ext *ocv1.ClusterExtension, message string) {
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
- Type: ocv1alpha1.TypeInstalled,
+ Type: ocv1.TypeInstalled,
Status: metav1.ConditionFalse,
- Reason: ocv1alpha1.ReasonFailed,
+ Reason: ocv1.ReasonFailed,
Message: message,
ObservedGeneration: ext.GetGeneration(),
})
}
// setInstalledStatusConditionUnknown sets the installed status condition to unknown.
-func setInstalledStatusConditionUnknown(ext *ocv1alpha1.ClusterExtension, message string) {
+func setInstalledStatusConditionUnknown(ext *ocv1.ClusterExtension, message string) {
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
- Type: ocv1alpha1.TypeInstalled,
+ Type: ocv1.TypeInstalled,
Status: metav1.ConditionUnknown,
- Reason: ocv1alpha1.ReasonFailed,
+ Reason: ocv1.ReasonFailed,
Message: message,
ObservedGeneration: ext.GetGeneration(),
})
}
-func setInstallStatus(ext *ocv1alpha1.ClusterExtension, installStatus *ocv1alpha1.ClusterExtensionInstallStatus) {
+func setInstallStatus(ext *ocv1.ClusterExtension, installStatus *ocv1.ClusterExtensionInstallStatus) {
ext.Status.Install = installStatus
}
-func setStatusProgressing(ext *ocv1alpha1.ClusterExtension, err error) {
+func setStatusProgressing(ext *ocv1.ClusterExtension, err error) {
progressingCond := metav1.Condition{
- Type: ocv1alpha1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: ocv1alpha1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
Message: "desired state reached",
ObservedGeneration: ext.GetGeneration(),
}
if err != nil {
- progressingCond.Reason = ocv1alpha1.ReasonRetrying
+ progressingCond.Reason = ocv1.ReasonRetrying
progressingCond.Message = err.Error()
}
if errors.Is(err, reconcile.TerminalError(nil)) {
progressingCond.Status = metav1.ConditionFalse
- progressingCond.Reason = ocv1alpha1.ReasonBlocked
+ progressingCond.Reason = ocv1.ReasonBlocked
}
apimeta.SetStatusCondition(&ext.Status.Conditions, progressingCond)
diff --git a/internal/controllers/common_controller_test.go b/internal/controllers/common_controller_test.go
index 40aacce72..7b644172d 100644
--- a/internal/controllers/common_controller_test.go
+++ b/internal/controllers/common_controller_test.go
@@ -11,53 +11,53 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestSetStatusProgressing(t *testing.T) {
for _, tc := range []struct {
name string
err error
- clusterExtension *ocv1alpha1.ClusterExtension
+ clusterExtension *ocv1.ClusterExtension
expected metav1.Condition
}{
{
name: "non-nil ClusterExtension, nil error, Progressing condition has status True with reason Success",
err: nil,
- clusterExtension: &ocv1alpha1.ClusterExtension{},
+ clusterExtension: &ocv1.ClusterExtension{},
expected: metav1.Condition{
- Type: ocv1alpha1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: ocv1alpha1.ReasonSucceeded,
+ Reason: ocv1.ReasonSucceeded,
Message: "desired state reached",
},
},
{
name: "non-nil ClusterExtension, non-terminal error, Progressing condition has status True with reason Retrying",
err: errors.New("boom"),
- clusterExtension: &ocv1alpha1.ClusterExtension{},
+ clusterExtension: &ocv1.ClusterExtension{},
expected: metav1.Condition{
- Type: ocv1alpha1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
- Reason: ocv1alpha1.ReasonRetrying,
+ Reason: ocv1.ReasonRetrying,
Message: "boom",
},
},
{
name: "non-nil ClusterExtension, terminal error, Progressing condition has status False with reason Blocked",
err: reconcile.TerminalError(errors.New("boom")),
- clusterExtension: &ocv1alpha1.ClusterExtension{},
+ clusterExtension: &ocv1.ClusterExtension{},
expected: metav1.Condition{
- Type: ocv1alpha1.TypeProgressing,
+ Type: ocv1.TypeProgressing,
Status: metav1.ConditionFalse,
- Reason: ocv1alpha1.ReasonBlocked,
+ Reason: ocv1.ReasonBlocked,
Message: "terminal error: boom",
},
},
} {
t.Run(tc.name, func(t *testing.T) {
setStatusProgressing(tc.clusterExtension, tc.err)
- progressingCond := meta.FindStatusCondition(tc.clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ progressingCond := meta.FindStatusCondition(tc.clusterExtension.Status.Conditions, ocv1.TypeProgressing)
require.NotNil(t, progressingCond, "progressing condition should be set but was not")
diff := cmp.Diff(*progressingCond, tc.expected, cmpopts.IgnoreFields(metav1.Condition{}, "LastTransitionTime", "ObservedGeneration"))
require.Empty(t, diff, "difference between actual and expected Progressing conditions")
diff --git a/internal/controllers/suite_test.go b/internal/controllers/suite_test.go
index 97ea3c427..52fd8900a 100644
--- a/internal/controllers/suite_test.go
+++ b/internal/controllers/suite_test.go
@@ -35,7 +35,7 @@ import (
helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/contentmanager"
cmcache "github.com/operator-framework/operator-controller/internal/contentmanager/cache"
"github.com/operator-framework/operator-controller/internal/controllers"
@@ -65,7 +65,7 @@ func newClient(t *testing.T) client.Client {
// TODO: this is a live client, which behaves differently than a cache client.
// We may want to use a caching client instead to get closer to real behavior.
sch := runtime.NewScheme()
- require.NoError(t, ocv1alpha1.AddToScheme(sch))
+ require.NoError(t, ocv1.AddToScheme(sch))
cl, err := client.New(config, client.Options{Scheme: sch})
require.NoError(t, err)
require.NotNil(t, cl)
@@ -80,7 +80,7 @@ func (m *MockInstalledBundleGetter) SetBundle(bundle *controllers.InstalledBundl
m.bundle = bundle
}
-func (m *MockInstalledBundleGetter) GetInstalledBundle(ctx context.Context, ext *ocv1alpha1.ClusterExtension) (*controllers.InstalledBundle, error) {
+func (m *MockInstalledBundleGetter) GetInstalledBundle(ctx context.Context, ext *ocv1.ClusterExtension) (*controllers.InstalledBundle, error) {
return m.bundle, nil
}
@@ -92,7 +92,7 @@ type MockApplier struct {
state string
}
-func (m *MockApplier) Apply(_ context.Context, _ fs.FS, _ *ocv1alpha1.ClusterExtension, _ map[string]string, _ map[string]string) ([]client.Object, string, error) {
+func (m *MockApplier) Apply(_ context.Context, _ fs.FS, _ *ocv1.ClusterExtension, _ map[string]string, _ map[string]string) ([]client.Object, string, error) {
if m.err != nil {
return nil, m.state, m.err
}
@@ -107,14 +107,14 @@ type MockManagedContentCacheManager struct {
cache cmcache.Cache
}
-func (m *MockManagedContentCacheManager) Get(_ context.Context, _ *ocv1alpha1.ClusterExtension) (cmcache.Cache, error) {
+func (m *MockManagedContentCacheManager) Get(_ context.Context, _ *ocv1.ClusterExtension) (cmcache.Cache, error) {
if m.err != nil {
return nil, m.err
}
return m.cache, nil
}
-func (m *MockManagedContentCacheManager) Delete(_ *ocv1alpha1.ClusterExtension) error {
+func (m *MockManagedContentCacheManager) Delete(_ *ocv1.ClusterExtension) error {
return m.err
}
diff --git a/internal/resolve/catalog.go b/internal/resolve/catalog.go
index 761448bea..859771055 100644
--- a/internal/resolve/catalog.go
+++ b/internal/resolve/catalog.go
@@ -18,7 +18,7 @@ import (
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
"github.com/operator-framework/operator-registry/alpha/declcfg"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/bundleutil"
"github.com/operator-framework/operator-controller/internal/catalogmetadata/compare"
"github.com/operator-framework/operator-controller/internal/catalogmetadata/filter"
@@ -38,7 +38,7 @@ type foundBundle struct {
}
// Resolve returns a Bundle from a catalog that needs to get installed on the cluster.
-func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterExtension, installedBundle *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1.ClusterExtension, installedBundle *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
packageName := ext.Spec.Source.Catalog.PackageName
versionRange := ext.Spec.Source.Catalog.Version
channels := ext.Spec.Source.Catalog.Channels
@@ -89,7 +89,7 @@ func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterEx
predicates = append(predicates, filter.InMastermindsSemverRange(versionRangeConstraints))
}
- if ext.Spec.Source.Catalog.UpgradeConstraintPolicy != ocv1alpha1.UpgradeConstraintPolicySelfCertified && installedBundle != nil {
+ if ext.Spec.Source.Catalog.UpgradeConstraintPolicy != ocv1.UpgradeConstraintPolicySelfCertified && installedBundle != nil {
successorPredicate, err := filter.SuccessorsOf(*installedBundle, packageFBC.Channels...)
if err != nil {
return fmt.Errorf("error finding upgrade edges: %w", err)
@@ -187,7 +187,7 @@ type resolutionError struct {
PackageName string
Version string
Channels []string
- InstalledBundle *ocv1alpha1.BundleMetadata
+ InstalledBundle *ocv1.BundleMetadata
ResolvedBundles []foundBundle
}
diff --git a/internal/resolve/catalog_test.go b/internal/resolve/catalog_test.go
index ba6a70027..b59733e70 100644
--- a/internal/resolve/catalog_test.go
+++ b/internal/resolve/catalog_test.go
@@ -20,14 +20,14 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
"github.com/operator-framework/operator-registry/alpha/property"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
"github.com/operator-framework/operator-controller/internal/features"
)
func TestInvalidClusterExtensionVersionRange(t *testing.T) {
r := CatalogResolver{}
pkgName := randPkg()
- ce := buildFooClusterExtension(pkgName, []string{}, "foobar", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "foobar", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, `desired version range "foobar" is invalid: improper constraint: foobar`)
}
@@ -37,7 +37,7 @@ func TestErrorWalkingCatalogs(t *testing.T) {
return fmt.Errorf("fake error")
}}
pkgName := randPkg()
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, "error walking catalogs: fake error")
}
@@ -50,7 +50,7 @@ func TestErrorGettingPackage(t *testing.T) {
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
pkgName := randPkg()
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, fmt.Sprintf(`error walking catalogs: error getting package %q from catalog "a": fake error`, pkgName))
}
@@ -69,7 +69,7 @@ func TestPackageDoesNotExist(t *testing.T) {
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
pkgName := randPkg()
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, fmt.Sprintf(`no bundles found for package %q`, pkgName))
}
@@ -88,7 +88,7 @@ func TestPackageExists(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "3.0.0"), *gotBundle)
@@ -117,7 +117,7 @@ func TestValidationFailed(t *testing.T) {
},
},
}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
require.Error(t, err)
}
@@ -136,7 +136,7 @@ func TestVersionDoesNotExist(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "4.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "4.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, fmt.Sprintf(`no bundles found for package %q matching version "4.0.0"`, pkgName))
}
@@ -155,7 +155,7 @@ func TestVersionExists(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <2.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <2.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "1.0.2"), *gotBundle)
@@ -177,7 +177,7 @@ func TestChannelDoesNotExist(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{"stable"}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{"stable"}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, fmt.Sprintf(`no bundles found for package %q in channels [stable]`, pkgName))
}
@@ -196,7 +196,7 @@ func TestChannelExists(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{"beta"}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{"beta"}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "1.0.2"), *gotBundle)
@@ -218,7 +218,7 @@ func TestChannelExistsButNotVersion(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{"beta"}, "3.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{"beta"}, "3.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, fmt.Sprintf(`no bundles found for package %q matching version "3.0.0" in channels [beta]`, pkgName))
}
@@ -237,7 +237,7 @@ func TestVersionExistsButNotChannel(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{"stable"}, "1.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{"stable"}, "1.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
assert.EqualError(t, err, fmt.Sprintf(`no bundles found for package %q matching version "1.0.0" in channels [stable]`, pkgName))
}
@@ -256,7 +256,7 @@ func TestChannelAndVersionExist(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{"alpha"}, "0.1.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{"alpha"}, "0.1.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "0.1.0"), *gotBundle)
@@ -278,7 +278,7 @@ func TestPreferNonDeprecated(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, ">=0.1.0 <=1.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=0.1.0 <=1.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "0.1.0"), *gotBundle)
@@ -300,7 +300,7 @@ func TestAcceptDeprecated(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "1.0.1"), *gotBundle)
@@ -383,7 +383,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
t.Run("when bundle candidates for a package are deprecated in all but one catalog", func(t *testing.T) {
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.3", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.3", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
// We choose the only non-deprecated package
@@ -393,7 +393,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
})
t.Run("when bundle candidates are found and deprecated in multiple catalogs", func(t *testing.T) {
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.Error(t, err)
// We will not make a decision on which catalog to use
@@ -404,7 +404,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
})
t.Run("when bundle candidates are found and not deprecated in multiple catalogs", func(t *testing.T) {
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.4", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.4", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.Error(t, err)
// We will not make a decision on which catalog to use
@@ -415,7 +415,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) {
})
t.Run("highest semver bundle is chosen when candidates are all from the same catalog", func(t *testing.T) {
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.4 <=1.0.5", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.4 <=1.0.5", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
// Bundles within one catalog for a package will be sorted by semver and deprecation and the best is returned
@@ -440,8 +440,8 @@ func TestUpgradeFoundLegacy(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
- installedBundle := &ocv1alpha1.BundleMetadata{
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
+ installedBundle := &ocv1.BundleMetadata{
Name: bundleName(pkgName, "0.1.0"),
Version: "0.1.0",
}
@@ -468,8 +468,8 @@ func TestUpgradeNotFoundLegacy(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "<1.0.0 >=2.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
- installedBundle := &ocv1alpha1.BundleMetadata{
+ ce := buildFooClusterExtension(pkgName, []string{}, "<1.0.0 >=2.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
+ installedBundle := &ocv1.BundleMetadata{
Name: bundleName(pkgName, "0.1.0"),
Version: "0.1.0",
}
@@ -493,8 +493,8 @@ func TestUpgradeFoundSemver(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
- installedBundle := &ocv1alpha1.BundleMetadata{
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
+ installedBundle := &ocv1.BundleMetadata{
Name: bundleName(pkgName, "1.0.0"),
Version: "1.0.0",
}
@@ -523,8 +523,8 @@ func TestUpgradeNotFoundSemver(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "!=0.1.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
- installedBundle := &ocv1alpha1.BundleMetadata{
+ ce := buildFooClusterExtension(pkgName, []string{}, "!=0.1.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
+ installedBundle := &ocv1.BundleMetadata{
Name: bundleName(pkgName, "0.1.0"),
Version: "0.1.0",
}
@@ -548,8 +548,8 @@ func TestDowngradeFound(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "<1.0.2", ocv1alpha1.UpgradeConstraintPolicySelfCertified)
- installedBundle := &ocv1alpha1.BundleMetadata{
+ ce := buildFooClusterExtension(pkgName, []string{}, "<1.0.2", ocv1.UpgradeConstraintPolicySelfCertified)
+ installedBundle := &ocv1.BundleMetadata{
Name: bundleName(pkgName, "1.0.2"),
Version: "1.0.2",
}
@@ -576,8 +576,8 @@ func TestDowngradeNotFound(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, ">0.1.0 <1.0.0", ocv1alpha1.UpgradeConstraintPolicySelfCertified)
- installedBundle := &ocv1alpha1.BundleMetadata{
+ ce := buildFooClusterExtension(pkgName, []string{}, ">0.1.0 <1.0.0", ocv1.UpgradeConstraintPolicySelfCertified)
+ installedBundle := &ocv1.BundleMetadata{
Name: bundleName(pkgName, "1.0.2"),
Version: "1.0.2",
}
@@ -640,17 +640,17 @@ func TestCatalogWalker(t *testing.T) {
})
}
-func buildFooClusterExtension(pkg string, channels []string, version string, upgradeConstraintPolicy ocv1alpha1.UpgradeConstraintPolicy) *ocv1alpha1.ClusterExtension {
- return &ocv1alpha1.ClusterExtension{
+func buildFooClusterExtension(pkg string, channels []string, version string, upgradeConstraintPolicy ocv1.UpgradeConstraintPolicy) *ocv1.ClusterExtension {
+ return &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: pkg,
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
+ Spec: ocv1.ClusterExtensionSpec{
Namespace: "default",
- ServiceAccount: ocv1alpha1.ServiceAccountReference{Name: "default"},
- Source: ocv1alpha1.SourceConfig{
+ ServiceAccount: ocv1.ServiceAccountReference{Name: "default"},
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: pkg,
Version: version,
Channels: channels,
@@ -760,13 +760,13 @@ func genPackage(pkg string) *declcfg.DeclarativeConfig {
func TestInvalidClusterExtensionCatalogMatchExpressions(t *testing.T) {
r := CatalogResolver{}
- ce := &ocv1alpha1.ClusterExtension{
+ ce := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
- Catalog: &ocv1alpha1.CatalogSource{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
+ Catalog: &ocv1.CatalogSource{
PackageName: "foo",
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
@@ -792,13 +792,13 @@ func TestInvalidClusterExtensionCatalogMatchLabelsName(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := &ocv1alpha1.ClusterExtension{
+ ce := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
- Catalog: &ocv1alpha1.CatalogSource{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
+ Catalog: &ocv1.CatalogSource{
PackageName: "foo",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"": "value"},
@@ -818,13 +818,13 @@ func TestInvalidClusterExtensionCatalogMatchLabelsValue(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := &ocv1alpha1.ClusterExtension{
+ ce := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
- Catalog: &ocv1alpha1.CatalogSource{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
+ Catalog: &ocv1.CatalogSource{
PackageName: "foo",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"name": "&value"},
@@ -849,7 +849,7 @@ func TestClusterExtensionMatchLabel(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
ce.Spec.Source.Catalog.Selector = &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": "b"},
}
@@ -870,7 +870,7 @@ func TestClusterExtensionNoMatchLabel(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
ce.Spec.Source.Catalog.Selector = &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": "a"},
}
@@ -914,7 +914,7 @@ func TestUnequalPriority(t *testing.T) {
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, gotVersion, _, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
require.Equal(t, bsemver.MustParse("1.0.0"), *gotVersion)
@@ -935,7 +935,7 @@ func TestMultiplePriority(t *testing.T) {
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.Error(t, err)
require.ErrorContains(t, err, "in multiple catalogs with the same priority [a b c]")
@@ -958,7 +958,7 @@ func TestMultipleChannels(t *testing.T) {
},
}
r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs}
- ce := buildFooClusterExtension(pkgName, []string{"beta", "alpha"}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{"beta", "alpha"}, "", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
assert.Equal(t, genBundle(pkgName, "2.0.0"), *gotBundle)
@@ -991,7 +991,7 @@ func TestAllCatalogsDisabled(t *testing.T) {
WalkCatalogsFunc: CatalogWalker(listCatalogs, getPackage),
}
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
_, _, _, err := r.Resolve(context.Background(), ce, nil)
require.Error(t, err)
assert.Contains(t, err.Error(), "no bundles found for package")
@@ -1031,7 +1031,7 @@ func TestSomeCatalogsDisabled(t *testing.T) {
WalkCatalogsFunc: CatalogWalker(listCatalogs, getPackage),
}
- ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided)
+ ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0", ocv1.UpgradeConstraintPolicyCatalogProvided)
gotBundle, gotVersion, _, err := r.Resolve(context.Background(), ce, nil)
require.NoError(t, err)
require.NotNil(t, gotBundle)
diff --git a/internal/resolve/resolver.go b/internal/resolve/resolver.go
index de9b952b0..625111d63 100644
--- a/internal/resolve/resolver.go
+++ b/internal/resolve/resolver.go
@@ -7,15 +7,15 @@ import (
"github.com/operator-framework/operator-registry/alpha/declcfg"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
type Resolver interface {
- Resolve(ctx context.Context, ext *ocv1alpha1.ClusterExtension, installedBundle *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error)
+ Resolve(ctx context.Context, ext *ocv1.ClusterExtension, installedBundle *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error)
}
-type Func func(ctx context.Context, ext *ocv1alpha1.ClusterExtension, installedBundle *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error)
+type Func func(ctx context.Context, ext *ocv1.ClusterExtension, installedBundle *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error)
-func (f Func) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterExtension, installedBundle *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
+func (f Func) Resolve(ctx context.Context, ext *ocv1.ClusterExtension, installedBundle *ocv1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) {
return f(ctx, ext, installedBundle)
}
diff --git a/internal/scheme/scheme.go b/internal/scheme/scheme.go
index 933d89b05..f247d9e7e 100644
--- a/internal/scheme/scheme.go
+++ b/internal/scheme/scheme.go
@@ -9,14 +9,14 @@ import (
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
var Scheme = runtime.NewScheme()
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(Scheme))
- utilruntime.Must(ocv1alpha1.AddToScheme(Scheme))
+ utilruntime.Must(ocv1.AddToScheme(Scheme))
utilruntime.Must(catalogd.AddToScheme(Scheme))
utilruntime.Must(appsv1.AddToScheme(Scheme))
utilruntime.Must(corev1.AddToScheme(Scheme))
diff --git a/test/e2e/cluster_extension_install_test.go b/test/e2e/cluster_extension_install_test.go
index 2a93a1de4..d590ee789 100644
--- a/test/e2e/cluster_extension_install_test.go
+++ b/test/e2e/cluster_extension_install_test.go
@@ -30,7 +30,7 @@ import (
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
const (
@@ -192,7 +192,7 @@ func createClusterRoleAndBindingForSA(ctx context.Context, name string, sa *core
return nil
}
-func testInit(t *testing.T) (*ocv1alpha1.ClusterExtension, *catalogd.ClusterCatalog, *corev1.ServiceAccount, *corev1.Namespace) {
+func testInit(t *testing.T) (*ocv1.ClusterExtension, *catalogd.ClusterCatalog, *corev1.ServiceAccount, *corev1.Namespace) {
var err error
clusterExtensionName := fmt.Sprintf("clusterextension-%s", rand.String(8))
@@ -200,7 +200,7 @@ func testInit(t *testing.T) (*ocv1alpha1.ClusterExtension, *catalogd.ClusterCata
ns, err := createNamespace(context.Background(), clusterExtensionName)
require.NoError(t, err)
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: clusterExtensionName,
},
@@ -249,7 +249,7 @@ func ensureNoExtensionResources(t *testing.T, clusterExtensionName string) {
}, 2*pollDuration, pollInterval)
}
-func testCleanup(t *testing.T, cat *catalogd.ClusterCatalog, clusterExtension *ocv1alpha1.ClusterExtension, sa *corev1.ServiceAccount, ns *corev1.Namespace) {
+func testCleanup(t *testing.T, cat *catalogd.ClusterCatalog, clusterExtension *ocv1.ClusterExtension, sa *corev1.ServiceAccount, ns *corev1.Namespace) {
t.Logf("By deleting ClusterCatalog %q", cat.Name)
require.NoError(t, c.Delete(context.Background(), cat))
require.Eventually(t, func() bool {
@@ -260,7 +260,7 @@ func testCleanup(t *testing.T, cat *catalogd.ClusterCatalog, clusterExtension *o
t.Logf("By deleting ClusterExtension %q", clusterExtension.Name)
require.NoError(t, c.Delete(context.Background(), clusterExtension))
require.Eventually(t, func() bool {
- err := c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, &ocv1alpha1.ClusterExtension{})
+ err := c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, &ocv1.ClusterExtension{})
return errors.IsNotFound(err)
}, pollDuration, pollInterval)
@@ -308,10 +308,10 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer getArtifactsOutput(t)
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: tc.packageName,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -319,7 +319,7 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -335,20 +335,20 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
t.Log("By eventually reporting progressing as True")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
t.Log("By eventually installing the package successfully")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
assert.Contains(ct, cond.Message, "Installed bundle")
assert.NotEmpty(ct, clusterExtension.Status.Install.Bundle)
}
@@ -364,15 +364,15 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer getArtifactsOutput(t)
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -388,10 +388,10 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
t.Log("By eventually reporting Progressing == True and Reason Retrying")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonRetrying, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonRetrying, cond.Reason)
assert.Contains(ct, cond.Message, "in multiple catalogs with the same priority [operatorhubio test-catalog]")
}
}, pollDuration, pollInterval)
@@ -406,17 +406,17 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
defer getArtifactsOutput(t)
t.Log("By creating an ClusterExtension at a specified version")
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Version: "1.0.0",
// No Selector since this is an exact version match
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -425,17 +425,17 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionInstallStatus{Bundle: ocv1alpha1.BundleMetadata{
+ &ocv1.ClusterExtensionInstallStatus{Bundle: ocv1.BundleMetadata{
Name: "prometheus-operator.1.0.0",
Version: "1.0.0",
}},
clusterExtension.Status.Install,
)
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -452,9 +452,9 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
t.Log("By eventually reporting Progressing == True and Reason Retrying")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
- assert.Equal(ct, ocv1alpha1.ReasonRetrying, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonRetrying, cond.Reason)
assert.Equal(ct, "error upgrading from currently installed version \"1.0.0\": no bundles found for package \"prometheus\" matching version \"1.2.0\"", cond.Message)
}
}, pollDuration, pollInterval)
@@ -469,16 +469,16 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
defer getArtifactsOutput(t)
t.Log("By creating an ClusterExtension at a specified version")
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Version: "1.0.0",
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -486,10 +486,10 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
t.Log("By eventually reporting a successful resolution")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -497,15 +497,15 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
t.Log("By updating the ClusterExtension resource to a non-successor version")
// 1.2.0 does not replace/skip/skipRange 1.0.0.
clusterExtension.Spec.Source.Catalog.Version = "1.2.0"
- clusterExtension.Spec.Source.Catalog.UpgradeConstraintPolicy = ocv1alpha1.UpgradeConstraintPolicySelfCertified
+ clusterExtension.Spec.Source.Catalog.UpgradeConstraintPolicy = ocv1.UpgradeConstraintPolicySelfCertified
require.NoError(t, c.Update(context.Background(), clusterExtension))
t.Log("By eventually reporting a satisfiable resolution")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
}
@@ -518,16 +518,16 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
defer getArtifactsOutput(t)
t.Log("By creating an ClusterExtension at a specified version")
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Version: "1.0.0",
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -535,10 +535,10 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
t.Log("By eventually reporting a successful resolution")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -550,10 +550,10 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
t.Log("By eventually reporting a successful resolution and bundle path")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
}
@@ -565,10 +565,10 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer getArtifactsOutput(t)
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Selector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
@@ -582,7 +582,7 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -593,10 +593,10 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
t.Log("By reporting a successful resolution and bundle path")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -617,10 +617,10 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
t.Log("By eventually reporting a successful resolution and bundle path")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
}
@@ -640,7 +640,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
extensionCatalog, err := createTestCatalog(context.Background(), testCatalogName, latestCatalogImage)
require.NoError(t, err)
clusterExtensionName := fmt.Sprintf("clusterextension-%s", rand.String(8))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: clusterExtensionName,
},
@@ -652,10 +652,10 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer getArtifactsOutput(t)
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -663,7 +663,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -674,10 +674,10 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
t.Log("By reporting a successful resolution and bundle path")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
@@ -698,10 +698,10 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
t.Log("By eventually reporting a successful resolution and bundle path")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
}
@@ -713,10 +713,10 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer getArtifactsOutput(t)
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -724,7 +724,7 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -735,10 +735,10 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
t.Log("By reporting a successful installation")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
assert.Contains(ct, cond.Message, "Installed bundle")
}
}, pollDuration, pollInterval)
@@ -776,10 +776,10 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
defer testCleanup(t, extensionCatalog, clusterExtension, sa, ns)
defer getArtifactsOutput(t)
- clusterExtension.Spec = ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ clusterExtension.Spec = ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: "prometheus",
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"olm.operatorframework.io/metadata.name": extensionCatalog.Name},
@@ -787,7 +787,7 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
},
},
Namespace: ns.Name,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
}
@@ -803,20 +803,20 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
t.Log("By eventually reporting Progressing == True with Reason Retrying")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonRetrying, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonRetrying, cond.Reason)
}
}, pollDuration, pollInterval)
t.Log("By eventually failing to install the package successfully due to insufficient ServiceAccount permissions")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionFalse, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonFailed, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonFailed, cond.Reason)
assert.Equal(ct, "No bundle installed", cond.Message)
}
}, pollDuration, pollInterval)
@@ -831,10 +831,10 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
t.Log("By eventually installing the package successfully")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
assert.Contains(ct, cond.Message, "Installed bundle")
assert.NotEmpty(ct, clusterExtension.Status.Install)
}
@@ -843,10 +843,10 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
t.Log("By eventually reporting Progressing == True with Reason Success")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: clusterExtension.Name}, clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeProgressing)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeProgressing)
if assert.NotNil(ct, cond) {
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}
}, pollDuration, pollInterval)
}
@@ -882,7 +882,7 @@ func getArtifactsOutput(t *testing.T) {
}
// get all cluster extensions save them to the artifact path.
- clusterExtensions := ocv1alpha1.ClusterExtensionList{}
+ clusterExtensions := ocv1.ClusterExtensionList{}
if err := c.List(context.Background(), &clusterExtensions, client.InNamespace("")); err != nil {
fmt.Printf("Failed to list cluster extensions: %v", err)
}
diff --git a/test/extension-developer-e2e/extension_developer_test.go b/test/extension-developer-e2e/extension_developer_test.go
index bb6bdad39..1ee2fffe4 100644
--- a/test/extension-developer-e2e/extension_developer_test.go
+++ b/test/extension-developer-e2e/extension_developer_test.go
@@ -20,7 +20,7 @@ import (
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestExtensionDeveloper(t *testing.T) {
@@ -30,7 +30,7 @@ func TestExtensionDeveloper(t *testing.T) {
scheme := runtime.NewScheme()
require.NoError(t, catalogd.AddToScheme(scheme))
- require.NoError(t, ocv1alpha1.AddToScheme(scheme))
+ require.NoError(t, ocv1.AddToScheme(scheme))
require.NoError(t, corev1.AddToScheme(scheme))
require.NoError(t, rbacv1.AddToScheme(scheme))
@@ -64,19 +64,19 @@ func TestExtensionDeveloper(t *testing.T) {
}
require.NoError(t, c.Create(ctx, sa))
- clusterExtension := &ocv1alpha1.ClusterExtension{
+ clusterExtension := &ocv1.ClusterExtension{
ObjectMeta: metav1.ObjectMeta{
Name: "registryv1",
},
- Spec: ocv1alpha1.ClusterExtensionSpec{
- Source: ocv1alpha1.SourceConfig{
+ Spec: ocv1.ClusterExtensionSpec{
+ Source: ocv1.SourceConfig{
SourceType: "Catalog",
- Catalog: &ocv1alpha1.CatalogSource{
+ Catalog: &ocv1.CatalogSource{
PackageName: os.Getenv("REG_PKG_NAME"),
},
},
Namespace: installNamespace,
- ServiceAccount: ocv1alpha1.ServiceAccountReference{
+ ServiceAccount: ocv1.ServiceAccountReference{
Name: sa.Name,
},
},
@@ -200,14 +200,14 @@ func TestExtensionDeveloper(t *testing.T) {
require.NoError(t, c.Create(context.Background(), clusterExtension))
t.Log("It should have a status condition type of Installed with a status of True and a reason of Success")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
- ext := &ocv1alpha1.ClusterExtension{}
+ ext := &ocv1.ClusterExtension{}
assert.NoError(ct, c.Get(context.Background(), client.ObjectKeyFromObject(clusterExtension), ext))
- cond := meta.FindStatusCondition(ext.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := meta.FindStatusCondition(ext.Status.Conditions, ocv1.TypeInstalled)
if !assert.NotNil(ct, cond) {
return
}
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
}, 2*time.Minute, time.Second)
require.NoError(t, c.Delete(context.Background(), catalog))
require.NoError(t, c.Delete(context.Background(), clusterExtension))
diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go
index 78f7284a8..d6f46ca94 100644
--- a/test/upgrade-e2e/post_upgrade_test.go
+++ b/test/upgrade-e2e/post_upgrade_test.go
@@ -20,7 +20,7 @@ import (
catalogdv1alpha1 "github.com/operator-framework/catalogd/api/core/v1alpha1"
- ocv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
+ ocv1 "github.com/operator-framework/operator-controller/api/v1"
)
func TestClusterExtensionAfterOLMUpgrade(t *testing.T) {
@@ -76,15 +76,15 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) {
}, time.Minute, time.Second)
t.Log("Checking that the ClusterExtension is installed")
- var clusterExtension ocv1alpha1.ClusterExtension
+ var clusterExtension ocv1.ClusterExtension
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(ctx, types.NamespacedName{Name: testClusterExtensionName}, &clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
if !assert.NotNil(ct, cond) {
return
}
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
assert.Contains(ct, cond.Message, "Installed bundle")
if assert.NotNil(ct, clusterExtension.Status.Install) {
assert.NotEmpty(ct, clusterExtension.Status.Install.Bundle.Version)
@@ -101,13 +101,13 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) {
t.Log("Checking that the ClusterExtension installs successfully")
require.EventuallyWithT(t, func(ct *assert.CollectT) {
assert.NoError(ct, c.Get(ctx, types.NamespacedName{Name: testClusterExtensionName}, &clusterExtension))
- cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeInstalled)
+ cond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeInstalled)
if !assert.NotNil(ct, cond) {
return
}
- assert.Equal(ct, ocv1alpha1.ReasonSucceeded, cond.Reason)
+ assert.Equal(ct, ocv1.ReasonSucceeded, cond.Reason)
assert.Contains(ct, cond.Message, "Installed bundle")
- assert.Equal(ct, ocv1alpha1.BundleMetadata{Name: "prometheus-operator.1.0.1", Version: "1.0.1"}, clusterExtension.Status.Install.Bundle)
+ assert.Equal(ct, ocv1.BundleMetadata{Name: "prometheus-operator.1.0.1", Version: "1.0.1"}, clusterExtension.Status.Install.Bundle)
assert.NotEqual(ct, previousVersion, clusterExtension.Status.Install.Bundle.Version)
}, time.Minute, time.Second)
}