Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion COMPONENT_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.17.0
5.0.0
15 changes: 13 additions & 2 deletions api/v1/discoveredcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.rhtap
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
Loading