Skip to content

Commit

Permalink
remove changed types
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Lopez committed Aug 11, 2020
1 parent 606e5a1 commit 8e80582
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 30 deletions.
14 changes: 7 additions & 7 deletions pkg/apis/duck/v1alpha1/channelable_combined_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type ChannelableCombinedSpec struct {
SubscribableTypeSpec `json:",inline"`

// SubscribableSpec is for the v1beta1 spec compatibility.
//SubscribableSpec eventingduckv1beta1.SubscribableSpec `json:",inline"`
SubscribableSpecv1beta1 eventingduckv1beta1.SubscribableSpec `json:",inline"`

// DeliverySpec contains options controlling the event delivery
// for the v1beta1 spec compatibility.
Expand All @@ -80,7 +80,7 @@ type ChannelableCombinedStatus struct {
// SubscribableTypeStatus is the v1alpha1 part of the Subscribers status
SubscribableTypeStatus `json:",inline"`
// SubscribableStatus is the v1beta1 part of the Subscribers status.
//eventingduckv1beta1.SubscribableStatus `json:",inline"`
SubscribableStatusv1beta1 eventingduckv1beta1.SubscribableStatus `json:",inline"`
// SubscribableStatusv1 is the v1 part of the Subscribers status.
eventingduckv1.SubscribableStatus `json:",inline"`
// ErrorChannel is set by the channel when it supports native error handling via a channel
Expand Down Expand Up @@ -111,7 +111,7 @@ func (c *ChannelableCombined) Populate() {
ReplyURI: apis.HTTP("sink2"),
}},
}
/*c.Spec.SubscribableSpec = eventingduckv1beta1.SubscribableSpec{
c.Spec.SubscribableSpecv1beta1 = eventingduckv1beta1.SubscribableSpec{
// Populate ALL fields
Subscribers: []eventingduckv1beta1.SubscriberSpec{{
UID: "2f9b5e8e-deb6-11e8-9f32-f2801f1b9fd1",
Expand All @@ -124,7 +124,7 @@ func (c *ChannelableCombined) Populate() {
SubscriberURI: apis.HTTP("call2"),
ReplyURI: apis.HTTP("sink2"),
}},
}*/
}
c.Spec.SubscribableSpec = eventingduckv1.SubscribableSpec{
// Populate ALL fields
Subscribers: []eventingduckv1.SubscriberSpec{{
Expand Down Expand Up @@ -199,9 +199,9 @@ func (c *ChannelableCombined) Populate() {
Hostname: "test-domain",
},
},
/*SubscribableStatus: eventingduckv1beta1.SubscribableStatus{
Subscribers: subscribers,
},*/
SubscribableStatusv1beta1: eventingduckv1beta1.SubscribableStatus{
Subscribers: subscribersv1beta1,
},
SubscribableStatus: eventingduckv1.SubscribableStatus{
Subscribers: subscribers,
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/apis/duck/v1alpha1/channelable_combined_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestChannelableCombinedPopulate(t *testing.T) {
delay := "5s"
want := &ChannelableCombined{
Spec: ChannelableCombinedSpec{
/*SubscribableSpec: eventingduckv1beta1.SubscribableSpec{
SubscribableSpecv1beta1: eventingduckv1beta1.SubscribableSpec{
// Populate ALL fields
Subscribers: []eventingduckv1beta1.SubscriberSpec{{
UID: "2f9b5e8e-deb6-11e8-9f32-f2801f1b9fd1",
Expand All @@ -62,7 +62,7 @@ func TestChannelableCombinedPopulate(t *testing.T) {
SubscriberURI: apis.HTTP("call2"),
ReplyURI: apis.HTTP("sink2"),
}},
},*/
},
SubscribableSpec: eventingduckv1.SubscribableSpec{
// Populate ALL fields
Subscribers: []eventingduckv1.SubscriberSpec{{
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestChannelableCombinedPopulate(t *testing.T) {
Hostname: "test-domain",
},
},
/*SubscribableStatus: eventingduckv1beta1.SubscribableStatus{
SubscribableStatusv1beta1: eventingduckv1beta1.SubscribableStatus{
Subscribers: []eventingduckv1beta1.SubscriberStatus{{
UID: "2f9b5e8e-deb6-11e8-9f32-f2801f1b9fd1",
ObservedGeneration: 1,
Expand All @@ -147,7 +147,7 @@ func TestChannelableCombinedPopulate(t *testing.T) {
Ready: corev1.ConditionFalse,
Message: "Some message",
}},
},*/
},
SubscribableStatus: eventingduckv1.SubscribableStatus{
Subscribers: []eventingduckv1.SubscriberStatus{{
UID: "2f9b5e8e-deb6-11e8-9f32-f2801f1b9fd1",
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/duck/v1alpha1/subscribable_types_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (source *SubscribableTypeStatus) ConvertTo(ctx context.Context, obj apis.Co
if source.SubscribableStatus != nil &&
len(source.SubscribableStatus.Subscribersv1beta1) > 0 {
sink.Subscribers = make([]eventingduckv1beta1.SubscriberStatus, len(source.SubscribableStatus.Subscribersv1beta1))
for i, ss := range source.SubscribableStatus.Subscribers {
for i, ss := range source.SubscribableStatus.Subscribersv1beta1 {
sink.Subscribers[i] = eventingduckv1beta1.SubscriberStatus{
UID: ss.UID,
ObservedGeneration: ss.ObservedGeneration,
Expand Down
8 changes: 0 additions & 8 deletions pkg/apis/duck/v1alpha1/subscribable_types_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ func TestSubscribableTypeConversionV1alphaV1beta1(t *testing.T) {
},
Status: SubscribableTypeStatus{
SubscribableStatus: &SubscribableStatus{
Subscribers: []v1.SubscriberStatus{
{
UID: "status-uid-1",
ObservedGeneration: 99,
Ready: corev1.ConditionTrue,
Message: "msg",
},
},
Subscribersv1beta1: []v1beta1.SubscriberStatus{
{
UID: "status-uid-1",
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/testing/v1/channelable.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"knative.dev/eventing/pkg/apis/duck/v1alpha1"
"knative.dev/eventing/pkg/apis/messaging"
"knative.dev/pkg/apis"
pkgduckv1 "knative.dev/pkg/apis/duck/v1"
pkgduckv1alpha1 "knative.dev/pkg/apis/duck/v1alpha1"
pkgduckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"
)

// Channelable allows us to have a fake channel for testinv1alpha1
Expand Down Expand Up @@ -105,7 +105,7 @@ func WithChannelableReady() ChannelableOption {
func WithChannelableAddress(a string) ChannelableOption {
return func(c *v1alpha1.Channelable) {
c.Status.Address = &pkgduckv1alpha1.Addressable{
Addressablev1: pkgduckv1.Addressable{
Addressable: pkgduckv1beta1.Addressable{
URL: apis.HTTP(a),
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import (
type Addressable struct {
v1beta1.Addressable `json:",omitempty"`

Addressablev1 v1.Addressable `json:",omitempty"`

Hostname string `json:"hostname,omitempty"`
}

Expand Down Expand Up @@ -134,12 +132,6 @@ func (t *AddressableType) Populate() {
Host: "foo.bar.svc.cluster.local",
},
},
Addressablev1: v1.Addressable{
URL: &apis.URL{
Scheme: "http",
Host: "foo.bar.svc.cluster.local",
},
},
Hostname: "this is not empty",
},
}
Expand Down

0 comments on commit 8e80582

Please sign in to comment.