From 3aeccadd47d0bc3d6686d9038543180e721e8bf7 Mon Sep 17 00:00:00 2001 From: Scott Nichols Date: Wed, 10 Oct 2018 15:59:27 -0700 Subject: [PATCH] Adding standard isReady method to Channel. --- pkg/apis/eventing/v1alpha1/channel_types.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/apis/eventing/v1alpha1/channel_types.go b/pkg/apis/eventing/v1alpha1/channel_types.go index 316f2f7e407..5c809cfbd65 100644 --- a/pkg/apis/eventing/v1alpha1/channel_types.go +++ b/pkg/apis/eventing/v1alpha1/channel_types.go @@ -117,6 +117,16 @@ func (cs *ChannelStatus) GetCondition(t duckv1alpha1.ConditionType) *duckv1alpha return chanCondSet.Manage(cs).GetCondition(t) } +// IsReady returns true if the resource is ready overall. +func (cs *ChannelStatus) IsReady() bool { + return chanCondSet.Manage(cs).IsHappy() +} + +// InitializeConditions sets relevant unset conditions to Unknown state. +func (cs *ChannelStatus) InitializeConditions() { + chanCondSet.Manage(cs).InitializeConditions() +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ChannelList is a collection of Channels.