diff --git a/COMPONENT_VERSION b/COMPONENT_VERSION index 6618ab545..28cbf7c0a 100644 --- a/COMPONENT_VERSION +++ b/COMPONENT_VERSION @@ -1 +1 @@ -2.17.0 \ No newline at end of file +5.0.0 \ No newline at end of file diff --git a/api/v1/discoveredcluster_types.go b/api/v1/discoveredcluster_types.go index 21bfea88b..39b4409a8 100644 --- a/api/v1/discoveredcluster_types.go +++ b/api/v1/discoveredcluster_types.go @@ -160,13 +160,24 @@ func init() { SchemeBuilder.Register(&DiscoveredCluster{}, &DiscoveredClusterList{}) } +// timestampsEqual checks if two timestamp pointers are equal (handling nil cases). +func timestampsEqual(a, b *metav1.Time) bool { + if a == nil && b == nil { + return true + } + if a == nil || b == nil { + return false + } + return a.Truncate(time.Second).Equal(b.Truncate(time.Second)) +} + // Equal reports whether the spec of a is equal to b. func (a DiscoveredCluster) Equal(b DiscoveredCluster) bool { if a.Spec.APIURL != b.Spec.APIURL || - a.Spec.ActivityTimestamp.Truncate(time.Second) != b.Spec.ActivityTimestamp.Truncate(time.Second) || + !timestampsEqual(a.Spec.ActivityTimestamp, b.Spec.ActivityTimestamp) || a.Spec.CloudProvider != b.Spec.CloudProvider || a.Spec.Console != b.Spec.Console || - a.Spec.CreationTimestamp.Truncate(time.Second) != b.Spec.CreationTimestamp.Truncate(time.Second) || + !timestampsEqual(a.Spec.CreationTimestamp, b.Spec.CreationTimestamp) || a.Spec.Credential != b.Spec.Credential || a.Spec.DisplayName != b.Spec.DisplayName || a.Spec.ImportAsManagedCluster != b.Spec.ImportAsManagedCluster || diff --git a/build/Dockerfile.rhtap b/build/Dockerfile.rhtap index b45dc6192..c8d05c008 100644 --- a/build/Dockerfile.rhtap +++ b/build/Dockerfile.rhtap @@ -30,7 +30,7 @@ LABEL org.label-schema.vendor="Red Hat" \ io.k8s.description="Operator for managing discovered clusters from OpenShift Cluster Manager" \ com.redhat.component="multicluster-engine-discovery-operator-container" \ io.openshift.tags="data,images" \ - cpe="cpe:/a:redhat:multicluster_engine:2.17::el9" + cpe="cpe:/a:redhat:multicluster_engine:5.0::el9" WORKDIR / COPY --from=plugin-builder /workspace/manager .