diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go
index 155d1a712..433f37859 100644
--- a/api/v1alpha1/clusterextension_types.go
+++ b/api/v1alpha1/clusterextension_types.go
@@ -23,8 +23,7 @@ import (
)
var (
- ClusterExtensionGVK = SchemeBuilder.GroupVersion.WithKind("ClusterExtension")
- ClusterExtensionKind = ClusterExtensionGVK.Kind
+ ClusterExtensionKind = "ClusterExtension"
)
type UpgradeConstraintPolicy string
@@ -386,7 +385,7 @@ type PreflightConfig struct {
// The CRD Upgrade Safety pre-flight check safeguards from unintended
// consequences of upgrading a CRD, such as data loss.
//
- // This field is required if the spec.preflight field is specified.
+ // This field is required if the spec.install.preflight field is specified.
CRDUpgradeSafety *CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety"`
}
@@ -394,7 +393,7 @@ type PreflightConfig struct {
type CRDUpgradeSafetyPreflightConfig struct {
// policy is used to configure the state of the CRD Upgrade Safety pre-flight check.
//
- // This field is required when the spec.preflight.crdUpgradeSafety field is
+ // This field is required when the spec.install.preflight.crdUpgradeSafety field is
// specified.
//
// Allowed values are ["Enabled", "Disabled"]. The default value is "Enabled".
@@ -485,15 +484,17 @@ type ClusterExtensionStatus struct {
// - Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.
// - Message: a human readable message that further elaborates on the state of the condition
//
- // The current set of condition types are:
- // - "Installed", represents whether or not the package referenced in the spec.packageName field has been installed
+ // The global set of condition types are:
+ // - "Installed", represents whether or not the a bundle has been installed for this ClusterExtension
// - "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec
- // - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types.
- // - "PackageDeprecated", represents whether or not the package specified in the spec.packageName field has been deprecated
- // - "ChannelDeprecated", represents whether or not the channel specified in spec.channel has been deprecated
- // - "BundleDeprecated", represents whether or not the bundle installed is deprecated
// - "Unpacked", represents whether or not the bundle contents have been successfully unpacked
//
+ // When the ClusterExtension is sourced from a catalog, the following conditions are also possible:
+ // - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types
+ // - "PackageDeprecated", represents whether or not the package specified in the spec.source.catalog.packageName field has been deprecated
+ // - "ChannelDeprecated", represents whether or not any channel specified in spec.source.catalog.channels has been deprecated
+ // - "BundleDeprecated", represents whether or not the installed bundle is deprecated
+ //
// The current set of reasons are:
// - "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful
// - "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation.
@@ -511,13 +512,7 @@ type ClusterExtensionInstallStatus struct {
//
// A "bundle" is a versioned set of content that represents the resources that
// need to be applied to a cluster to install a package.
- //
- // This field is only updated once a bundle has been successfully installed and
- // once set will only be updated when a new version of the bundle has
- // successfully replaced the currently installed version.
- //
- //+optional
- Bundle *BundleMetadata `json:"bundle,omitempty"`
+ Bundle BundleMetadata `json:"bundle"`
}
type ClusterExtensionResolutionStatus struct {
@@ -525,8 +520,9 @@ type ClusterExtensionResolutionStatus struct {
// resolution to meet all installation/upgrade constraints and is slated to be
// installed or upgraded to.
//
- //+optional
- Bundle *BundleMetadata `json:"bundle,omitempty"`
+ // A "bundle" is a versioned set of content that represents the resources that
+ // need to be applied to a cluster to install a package.
+ Bundle BundleMetadata `json:"bundle"`
}
//+kubebuilder:object:root=true
diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go
index 702c3f404..ed65d696b 100644
--- a/api/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1alpha1/zz_generated.deepcopy.go
@@ -127,11 +127,7 @@ func (in *ClusterExtensionInstallConfig) DeepCopy() *ClusterExtensionInstallConf
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterExtensionInstallStatus) DeepCopyInto(out *ClusterExtensionInstallStatus) {
*out = *in
- if in.Bundle != nil {
- in, out := &in.Bundle, &out.Bundle
- *out = new(BundleMetadata)
- **out = **in
- }
+ out.Bundle = in.Bundle
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterExtensionInstallStatus.
@@ -179,11 +175,7 @@ func (in *ClusterExtensionList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterExtensionResolutionStatus) DeepCopyInto(out *ClusterExtensionResolutionStatus) {
*out = *in
- if in.Bundle != nil {
- in, out := &in.Bundle, &out.Bundle
- *out = new(BundleMetadata)
- **out = **in
- }
+ out.Bundle = in.Bundle
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterExtensionResolutionStatus.
@@ -219,12 +211,12 @@ func (in *ClusterExtensionStatus) DeepCopyInto(out *ClusterExtensionStatus) {
if in.Install != nil {
in, out := &in.Install, &out.Install
*out = new(ClusterExtensionInstallStatus)
- (*in).DeepCopyInto(*out)
+ **out = **in
}
if in.Resolution != nil {
in, out := &in.Resolution, &out.Resolution
*out = new(ClusterExtensionResolutionStatus)
- (*in).DeepCopyInto(*out)
+ **out = **in
}
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
diff --git a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
index c4466517a..c25c2ccb2 100644
--- a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
+++ b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
@@ -100,14 +100,14 @@ spec:
The CRD Upgrade Safety pre-flight check safeguards from unintended
consequences of upgrading a CRD, such as data loss.
- This field is required if the spec.preflight field is specified.
+ This field is required if the spec.install.preflight field is specified.
properties:
policy:
default: Enabled
description: |-
policy is used to configure the state of the CRD Upgrade Safety pre-flight check.
- This field is required when the spec.preflight.crdUpgradeSafety field is
+ This field is required when the spec.install.preflight.crdUpgradeSafety field is
specified.
Allowed values are ["Enabled", "Disabled"]. The default value is "Enabled".
@@ -474,15 +474,17 @@ spec:
- Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.
- Message: a human readable message that further elaborates on the state of the condition
- The current set of condition types are:
- - "Installed", represents whether or not the package referenced in the spec.packageName field has been installed
+ The global set of condition types are:
+ - "Installed", represents whether or not the a bundle has been installed for this ClusterExtension
- "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec
- - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types.
- - "PackageDeprecated", represents whether or not the package specified in the spec.packageName field has been deprecated
- - "ChannelDeprecated", represents whether or not the channel specified in spec.channel has been deprecated
- - "BundleDeprecated", represents whether or not the bundle installed is deprecated
- "Unpacked", represents whether or not the bundle contents have been successfully unpacked
+ When the ClusterExtension is sourced from a catalog, the following conditions are also possible:
+ - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types
+ - "PackageDeprecated", represents whether or not the package specified in the spec.source.catalog.packageName field has been deprecated
+ - "ChannelDeprecated", represents whether or not any channel specified in spec.source.catalog.channels has been deprecated
+ - "BundleDeprecated", represents whether or not the installed bundle is deprecated
+
The current set of reasons are:
- "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful
- "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation.
@@ -552,10 +554,6 @@ spec:
A "bundle" is a versioned set of content that represents the resources that
need to be applied to a cluster to install a package.
-
- This field is only updated once a bundle has been successfully installed and
- once set will only be updated when a new version of the bundle has
- successfully replaced the currently installed version.
properties:
name:
description: |-
@@ -571,6 +569,8 @@ spec:
- name
- version
type: object
+ required:
+ - bundle
type: object
resolution:
properties:
@@ -579,6 +579,9 @@ spec:
bundle is a representation of the bundle that was identified during
resolution to meet all installation/upgrade constraints and is slated to be
installed or upgraded to.
+
+ A "bundle" is a versioned set of content that represents the resources that
+ need to be applied to a cluster to install a package.
properties:
name:
description: |-
@@ -594,6 +597,8 @@ spec:
- name
- version
type: object
+ required:
+ - bundle
type: object
type: object
type: object
diff --git a/docs/refs/api/operator-controller-api-reference.md b/docs/refs/api/operator-controller-api-reference.md
index 1935340c1..d03bc4df4 100644
--- a/docs/refs/api/operator-controller-api-reference.md
+++ b/docs/refs/api/operator-controller-api-reference.md
@@ -62,7 +62,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `policy` _[CRDUpgradeSafetyPolicy](#crdupgradesafetypolicy)_ | policy is used to configure the state of the CRD Upgrade Safety pre-flight check.
This field is required when the spec.preflight.crdUpgradeSafety field is
specified.
Allowed values are ["Enabled", "Disabled"]. The default value is "Enabled".
When set to "Disabled", the CRD Upgrade Safety pre-flight check will be skipped
when performing an upgrade operation. This should be used with caution as
unintended consequences such as data loss can occur.
When set to "Enabled", the CRD Upgrade Safety pre-flight check will be run when
performing an upgrade operation. | Enabled | Enum: [Enabled Disabled]
|
+| `policy` _[CRDUpgradeSafetyPolicy](#crdupgradesafetypolicy)_ | policy is used to configure the state of the CRD Upgrade Safety pre-flight check.
This field is required when the spec.install.preflight.crdUpgradeSafety field is
specified.
Allowed values are ["Enabled", "Disabled"]. The default value is "Enabled".
When set to "Disabled", the CRD Upgrade Safety pre-flight check will be skipped
when performing an upgrade operation. This should be used with caution as
unintended consequences such as data loss can occur.
When set to "Enabled", the CRD Upgrade Safety pre-flight check will be run when
performing an upgrade operation. | Enabled | Enum: [Enabled Disabled]
|
#### CatalogSource
@@ -139,7 +139,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `bundle` _[BundleMetadata](#bundlemetadata)_ | bundle is a representation of the currently installed bundle.
A "bundle" is a versioned set of content that represents the resources that
need to be applied to a cluster to install a package.
This field is only updated once a bundle has been successfully installed and
once set will only be updated when a new version of the bundle has
successfully replaced the currently installed version. | | |
+| `bundle` _[BundleMetadata](#bundlemetadata)_ | bundle is a representation of the currently installed bundle.
A "bundle" is a versioned set of content that represents the resources that
need to be applied to a cluster to install a package. | | |
#### ClusterExtensionList
@@ -175,7 +175,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `bundle` _[BundleMetadata](#bundlemetadata)_ | bundle is a representation of the bundle that was identified during
resolution to meet all installation/upgrade constraints and is slated to be
installed or upgraded to. | | |
+| `bundle` _[BundleMetadata](#bundlemetadata)_ | bundle is a representation of the bundle that was identified during
resolution to meet all installation/upgrade constraints and is slated to be
installed or upgraded to.
A "bundle" is a versioned set of content that represents the resources that
need to be applied to a cluster to install a package. | | |
#### ClusterExtensionSpec
@@ -210,7 +210,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `install` _[ClusterExtensionInstallStatus](#clusterextensioninstallstatus)_ | | | |
| `resolution` _[ClusterExtensionResolutionStatus](#clusterextensionresolutionstatus)_ | | | |
-| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterExtension.
The status is represented by a set of "conditions".
Each condition is generally structured in the following format:
- Type: a string representation of the condition type. More or less the condition "name".
- Status: a string representation of the state of the condition. Can be one of ["True", "False", "Unknown"].
- Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.
- Message: a human readable message that further elaborates on the state of the condition
The current set of condition types are:
- "Installed", represents whether or not the package referenced in the spec.packageName field has been installed
- "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec
- "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types.
- "PackageDeprecated", represents whether or not the package specified in the spec.packageName field has been deprecated
- "ChannelDeprecated", represents whether or not the channel specified in spec.channel has been deprecated
- "BundleDeprecated", represents whether or not the bundle installed is deprecated
- "Unpacked", represents whether or not the bundle contents have been successfully unpacked
The current set of reasons are:
- "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful
- "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation. | | |
+| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterExtension.
The status is represented by a set of "conditions".
Each condition is generally structured in the following format:
- Type: a string representation of the condition type. More or less the condition "name".
- Status: a string representation of the state of the condition. Can be one of ["True", "False", "Unknown"].
- Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.
- Message: a human readable message that further elaborates on the state of the condition
The global set of condition types are:
- "Installed", represents whether or not the a bundle has been installed for this ClusterExtension
- "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec
- "Unpacked", represents whether or not the bundle contents have been successfully unpacked
When the ClusterExtension is sourced from a catalog, the following conditions are also possible:
- "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types
- "PackageDeprecated", represents whether or not the package specified in the spec.source.catalog.packageName field has been deprecated
- "ChannelDeprecated", represents whether or not any channel specified in spec.source.catalog.channels has been deprecated
- "BundleDeprecated", represents whether or not the installed bundle is deprecated
The current set of reasons are:
- "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful
- "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation. | | |
#### PreflightConfig
@@ -226,7 +226,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `crdUpgradeSafety` _[CRDUpgradeSafetyPreflightConfig](#crdupgradesafetypreflightconfig)_ | crdUpgradeSafety is used to configure the CRD Upgrade Safety pre-flight
checks that run prior to upgrades of installed content.
The CRD Upgrade Safety pre-flight check safeguards from unintended
consequences of upgrading a CRD, such as data loss.
This field is required if the spec.preflight field is specified. | | |
+| `crdUpgradeSafety` _[CRDUpgradeSafetyPreflightConfig](#crdupgradesafetypreflightconfig)_ | crdUpgradeSafety is used to configure the CRD Upgrade Safety pre-flight
checks that run prior to upgrades of installed content.
The CRD Upgrade Safety pre-flight check safeguards from unintended
consequences of upgrading a CRD, such as data loss.
This field is required if the spec.install.preflight field is specified. | | |
#### ServiceAccountReference
diff --git a/internal/bundleutil/bundle.go b/internal/bundleutil/bundle.go
index 1bfd0c063..38eb30047 100644
--- a/internal/bundleutil/bundle.go
+++ b/internal/bundleutil/bundle.go
@@ -30,8 +30,8 @@ func GetVersion(b declcfg.Bundle) (*bsemver.Version, error) {
}
// MetadataFor returns a BundleMetadata for the given bundle name and version.
-func MetadataFor(bundleName string, bundleVersion bsemver.Version) *ocv1alpha1.BundleMetadata {
- return &ocv1alpha1.BundleMetadata{
+func MetadataFor(bundleName string, bundleVersion bsemver.Version) ocv1alpha1.BundleMetadata {
+ return ocv1alpha1.BundleMetadata{
Name: bundleName,
Version: bundleVersion.String(),
}
diff --git a/internal/catalogmetadata/filter/successors.go b/internal/catalogmetadata/filter/successors.go
index 54e2083b1..cfae6eff0 100644
--- a/internal/catalogmetadata/filter/successors.go
+++ b/internal/catalogmetadata/filter/successors.go
@@ -12,7 +12,7 @@ import (
"github.com/operator-framework/operator-controller/internal/features"
)
-func SuccessorsOf(installedBundle *ocv1alpha1.BundleMetadata, channels ...declcfg.Channel) (Predicate[declcfg.Bundle], error) {
+func SuccessorsOf(installedBundle ocv1alpha1.BundleMetadata, channels ...declcfg.Channel) (Predicate[declcfg.Bundle], error) {
var successors successorsPredicateFunc = legacySuccessor
if features.OperatorControllerFeatureGate.Enabled(features.ForceSemverUpgradeConstraints) {
successors = semverSuccessor
@@ -42,9 +42,9 @@ func SuccessorsOf(installedBundle *ocv1alpha1.BundleMetadata, channels ...declcf
// successorsPredicateFunc returns a predicate to find successors
// for a bundle. Predicate must not include the current version.
-type successorsPredicateFunc func(installedBundle *ocv1alpha1.BundleMetadata, channels ...declcfg.Channel) (Predicate[declcfg.Bundle], error)
+type successorsPredicateFunc func(installedBundle ocv1alpha1.BundleMetadata, channels ...declcfg.Channel) (Predicate[declcfg.Bundle], error)
-func legacySuccessor(installedBundle *ocv1alpha1.BundleMetadata, channels ...declcfg.Channel) (Predicate[declcfg.Bundle], error) {
+func legacySuccessor(installedBundle ocv1alpha1.BundleMetadata, channels ...declcfg.Channel) (Predicate[declcfg.Bundle], error) {
installedBundleVersion, err := bsemver.Parse(installedBundle.Version)
if err != nil {
return nil, fmt.Errorf("error parsing installed bundle version: %w", err)
@@ -88,7 +88,7 @@ func legacySuccessor(installedBundle *ocv1alpha1.BundleMetadata, channels ...dec
// in a channel entry that is necessary to determine if a bundle is a successor.
// A semver range check is the only necessary element. If filtering by channel
// membership is necessary, an additional filter for that purpose should be applied.
-func semverSuccessor(installedBundle *ocv1alpha1.BundleMetadata, _ ...declcfg.Channel) (Predicate[declcfg.Bundle], error) {
+func semverSuccessor(installedBundle ocv1alpha1.BundleMetadata, _ ...declcfg.Channel) (Predicate[declcfg.Bundle], error) {
currentVersion, err := mmsemver.NewVersion(installedBundle.Version)
if err != nil {
return nil, err
diff --git a/internal/catalogmetadata/filter/successors_test.go b/internal/catalogmetadata/filter/successors_test.go
index d70110bcd..1d7cc72c3 100644
--- a/internal/catalogmetadata/filter/successors_test.go
+++ b/internal/catalogmetadata/filter/successors_test.go
@@ -129,7 +129,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsEnabled(t *testing.
for _, tt := range []struct {
name string
- installedBundle *ocv1alpha1.BundleMetadata
+ installedBundle ocv1alpha1.BundleMetadata
expectedResult []declcfg.Bundle
}{
{
@@ -162,7 +162,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsEnabled(t *testing.
},
{
name: "installed bundle not found",
- installedBundle: &ocv1alpha1.BundleMetadata{
+ installedBundle: ocv1alpha1.BundleMetadata{
Name: "test-package.v9.0.0",
Version: "9.0.0",
},
@@ -281,7 +281,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsDisabled(t *testing
for _, tt := range []struct {
name string
- installedBundle *ocv1alpha1.BundleMetadata
+ installedBundle ocv1alpha1.BundleMetadata
expectedResult []declcfg.Bundle
}{
{
@@ -319,7 +319,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsDisabled(t *testing
},
{
name: "installed bundle not found",
- installedBundle: &ocv1alpha1.BundleMetadata{
+ installedBundle: ocv1alpha1.BundleMetadata{
Name: "test-package.v9.0.0",
Version: "9.0.0",
},
@@ -368,7 +368,7 @@ func TestLegacySuccessor(t *testing.T) {
},
},
}
- installedBundle := &ocv1alpha1.BundleMetadata{
+ installedBundle := ocv1alpha1.BundleMetadata{
Name: "package1.v0.0.1",
Version: "0.0.1",
}
diff --git a/internal/controllers/clusterextension_controller_test.go b/internal/controllers/clusterextension_controller_test.go
index d420206f0..60be87deb 100644
--- a/internal/controllers/clusterextension_controller_test.go
+++ b/internal/controllers/clusterextension_controller_test.go
@@ -152,7 +152,7 @@ func TestClusterExtensionResolutionSucceeds(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.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected conditions")
@@ -228,7 +228,7 @@ func TestClusterExtensionUnpackFails(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.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected conditions")
@@ -306,7 +306,7 @@ func TestClusterExtensionUnpackUnexpectedState(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.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected conditions")
@@ -388,7 +388,7 @@ func TestClusterExtensionUnpackSucceeds(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.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected resolution conditions")
@@ -470,7 +470,7 @@ func TestClusterExtensionInstallationFailedApplierFails(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.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
require.Empty(t, clusterExtension.Status.Install)
t.Log("By checking the expected resolution conditions")
@@ -561,8 +561,8 @@ 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.Resolution.Bundle)
- require.Equal(t, &ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected resolution conditions")
resolvedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeResolved)
@@ -661,8 +661,8 @@ 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.Resolution.Bundle)
- require.Equal(t, &ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected resolution conditions")
resolvedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeResolved)
@@ -758,8 +758,8 @@ 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.Resolution.Bundle)
- require.Equal(t, &ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Resolution.Bundle)
+ require.Equal(t, ocv1alpha1.BundleMetadata{Name: "prometheus.v1.0.0", Version: "1.0.0"}, clusterExtension.Status.Install.Bundle)
t.Log("By checking the expected resolution conditions")
resolvedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeResolved)
diff --git a/internal/resolve/catalog.go b/internal/resolve/catalog.go
index 17439269e..0c9dac762 100644
--- a/internal/resolve/catalog.go
+++ b/internal/resolve/catalog.go
@@ -84,7 +84,7 @@ func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterEx
}
if ext.Spec.Source.Catalog.UpgradeConstraintPolicy != ocv1alpha1.UpgradeConstraintPolicySelfCertified && installedBundle != nil {
- successorPredicate, err := filter.SuccessorsOf(installedBundle, packageFBC.Channels...)
+ successorPredicate, err := filter.SuccessorsOf(*installedBundle, packageFBC.Channels...)
if err != nil {
return fmt.Errorf("error finding upgrade edges: %w", err)
}
diff --git a/test/e2e/cluster_extension_install_test.go b/test/e2e/cluster_extension_install_test.go
index ad89cef9f..638539ff7 100644
--- a/test/e2e/cluster_extension_install_test.go
+++ b/test/e2e/cluster_extension_install_test.go
@@ -257,7 +257,7 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.2.0",
Version: "1.2.0",
}},
@@ -366,14 +366,14 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.0.0",
Version: "1.0.0",
}},
clusterExtension.Status.Resolution,
)
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionInstallStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionInstallStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.0.0",
Version: "1.0.0",
}},
@@ -434,7 +434,7 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.0.0",
Version: "1.0.0",
}},
@@ -458,7 +458,7 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.2.0",
Version: "1.2.0",
}},
@@ -501,7 +501,7 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.0.0",
Version: "1.0.0",
}},
@@ -524,7 +524,7 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.0.1",
Version: "1.0.1",
}},
@@ -578,7 +578,7 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.2.0",
Version: "1.2.0",
}},
@@ -612,7 +612,7 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.2.0.0",
Version: "2.0.0",
}},
@@ -678,7 +678,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.2.0",
Version: "1.2.0",
}},
@@ -712,7 +712,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.2.0.0",
Version: "2.0.0",
}},
@@ -759,7 +759,7 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.2.0",
Version: "1.2.0",
}},
@@ -832,7 +832,7 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason)
assert.Contains(ct, cond.Message, "resolved to")
assert.Equal(ct,
- &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: &ocv1alpha1.BundleMetadata{
+ &ocv1alpha1.ClusterExtensionResolutionStatus{Bundle: ocv1alpha1.BundleMetadata{
Name: "prometheus-operator.1.2.0",
Version: "1.2.0",
}},
diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go
index 11bbf7544..751730b8a 100644
--- a/test/upgrade-e2e/post_upgrade_test.go
+++ b/test/upgrade-e2e/post_upgrade_test.go
@@ -107,8 +107,8 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) {
}
assert.Equal(ct, ocv1alpha1.ReasonSuccess, 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.Resolution.Bundle)
- assert.Equal(ct, &ocv1alpha1.BundleMetadata{Name: "prometheus-operator.1.0.1", Version: "1.0.1"}, clusterExtension.Status.Install.Bundle)
+ assert.Equal(ct, ocv1alpha1.BundleMetadata{Name: "prometheus-operator.1.0.1", Version: "1.0.1"}, clusterExtension.Status.Resolution.Bundle)
+ assert.Equal(ct, ocv1alpha1.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)
}