Skip to content

ClusterBus should report status #371

@scothis

Description

@scothis

Expected Behavior

The ClusterBus resources should have status similar to the Bus resource.

Actual Behavior

The ClusterBus status is empty

Steps to Reproduce the Problem

  1. create a ClusterBus
  2. check it's status

Additional Info

func (c *Controller) updateClusterBusStatus(
clusterBus *channelsv1alpha1.ClusterBus,
dispatcherService *corev1.Service,
dispatcherDeployment *appsv1.Deployment,
provisionerDeployment *appsv1.Deployment,
) error {
// NEVER modify objects from the store. It's a read-only, local cache.
// You can use DeepCopy() to make a deep copy of original object and modify this copy
// Or create a copy manually for better performance
clusterBusCopy := clusterBus.DeepCopy()
// Only update if status has changed
if !equality.Semantic.DeepEqual(clusterBus.Status, clusterBusCopy.Status) {
// If the CustomResourceSubresources feature gate is not enabled,
// we must use Update instead of UpdateStatus to update the Status block of the ClusterBus resource.
// UpdateStatus will not allow changes to the Spec of the resource,
// which is ideal for ensuring nothing other than resource status has been updated.
_, err := c.clusterbusclientset.ChannelsV1alpha1().ClusterBuses().Update(clusterBusCopy)
return err
}
return nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions